|
From: Gait B. <gai...@ti...> - 2003-05-07 06:49:47
|
Hi Jason,
this is the message I used to get from SAAJ on HTTP responses before I
plugged an extra try catch block. Reason for the error: SAAJ was built for
synchronous HTTP messaging and expects a SOAP message (with content type
text/xml) coming back on the HTTP Response when sending something out. But
since ebXML defaults to async messaging, you can not rely on a SOAP message
coming back on any but the 500 response. In fact, any 2xx response must be
accepted as a successful send (unless you force sync acks). To fix it, you
actually need to patch SAAJ, see the copy of that message below.
Kind Regards, Gait.
-- my original posted fix -------
Hi,
I've observed the same problem while doing some tests against other
receivers. In my case, the other party was responding with a 200 OK message,
and a nice HTML document telling me my message was well received. Very
friendly, but not what the Sun JAXM implementation was expecting. According
to the specs, the response is valid unless you're running synchronous
communications. In fact, any 2XX response is fine when using async
responses. So I ended up patching JAXM to catch the error on the response
message.
Get JAXM 1.1 from SUN, and change line 333 of
jaxm1.1-scsl\jaxm-ri\src\com\sun\xml\messaging\saaj\client\p2p\HttpSoapConne
ction.java to look like:
try {
response = messageFactory.createMessage(headers, in);
} catch (SOAPException ex) {
if( responseCode== HttpURLConnection.HTTP_INTERNAL_ERROR ) {
throw ex;
}
response = null;
}
then rebuild jaxm, and copy the patched saaj-ri.jar into your ebxmlms. That
should do the trick.
Of course, this will also catch the error while doing synchronous
communications, which is probably not what we want.
As an aside, be aware that the createMessage call will print a stack trace
before the error is caught, so don't worry if you still get the error trace
in the tomcat console.
--Gait.
----------
----- Original Message -----
From: "Jason van Zyl" <ja...@ze...>
To: <ebx...@li...>
Sent: Tuesday, May 06, 2003 7:26 PM
Subject: [ebxmlms-develop] SOAPException: unable to internalize message
(invalid content type: text/html)
> Hi,
>
> I see some mention of this being fixed and I tried the latest nightly
> download and I'm getting the error. CVS has been dead all day from where
> I am. Has this issue been resolved?
>
> Maybe it is something I have to look for in my setup, I'm using Jetty
> not Tomcat.
>
> --
> jvz.
>
> > Jason van Zyl
> > ja...@ze...
> > http://tambora.zenplex.org
> >
> > In short, man creates for himself a new religion of a rational
> > and technical order to justify his work and to be justified in it.
> >
> > -- Jacques Ellul, The Technological Society
> >
> >
> >
> > -------------------------------------------------------
> > Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
> > The only event dedicated to issues related to Linux enterprise solutions
> > www.enterpriselinuxforum.com
> >
> > _______________________________________________
> > ebxmlms-develop mailing list
> > ebx...@li...
> > https://lists.sourceforge.net/lists/listinfo/ebxmlms-develop
>
|