dev@jax-ws.java.net

Re: NPE in SOAPBindingCodec.java - failure in MTOM interop tests

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 23 Aug 2006 13:00:22 +0200

Hi Deepak,

[Moving to dev_at_jax-ws].

I renamed that class from CodecFacade to SOAPBindingCodec, which IMHO is
more meaningful. Before the rename i integrated FI into this class.

Recently there have been a couple of other changes to the attachment
code. So i am not sure what exactly is at fault.

I presume this test fails when the MS client is talking to the WSIT
service, as the stack trace indicates. But it would seem that the
messages you show are for the WSIT client talking to the MS service. Is
it also failing the other way around?


I think the problem is with the of MimeMultipartParser.getNextPart().
The logic implies that a null root part is returned if a start parameter
is present and there is no attachment part with a content id that is the
start parameter (in which case an exception should be thrown rather than
returning null).

The MS response has a start parameter of:

    <http://tempuri.org/0>

and the attachment part with that content ID is:

    Content-ID: <http://tempuri.org/0>

BUT line 157 of MimeMultipartParser.getNextPart() does this:

if(contentId.charAt(0)=='<')
     contentId=contentId.substring(1,contentId.length()-1);

I am presuming that the bracketing '<' and '>' are not removed from the
start parameter String that MimeMultipartParser uses.

Either the bracketing '<' and '>' should or not be present. I seem to
recall all sorts of recent issues with this in the latest code.

Paul.


Deepak V R wrote:
> Paul,
>
> When I try to run MTOM interop tests on wsit, I see they are failing
> with this exception.
> ========================
> java.lang.NullPointerException
> at
> com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:224)
> at com.sun.xml.ws.encoding.MimeCodec.decode(MimeCodec.java:116)
> at
> com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:180)
> at
> com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:151)
>
> at
> com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:235)
> at
> com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:97)
>
> at
> com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:161)
>
> at
> com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:49)
> ========================
>
> Any idea why? I saw that you added this file recently on jaxws-ri-rearch
> and the next build has got integrated into wsit.
>
> This is the sample message that was sent/recieved. I ran this against
> Microsoft endpoint.
>
> =======================================================
>
> ---[HTTP request]---
> SOAPAction: http://xmlsoap.org/echoBinaryAsString
> Content-Type:
> multipart/related;type="application/xop+xml";boundary="uuid:af0ad1cd-23cf-40f8-83c9-977198f4e541";start-info="text/xml"
>
> Accept: text/xml, multipart/related, text/html, image/gif, image/jpeg,
> *; q=.2, */*; q=.2
> --uuid:af0ad1cd-23cf-40f8-83c9-977198f4e541
> Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
> Content-Transfer-Encoding: binary
>
> <?xml version="1.0" ?><S:Envelope
> xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><EchoBinaryAsString
> xmlns:ns3="http://schemas.microsoft.com/2003/10/Serialization/"
> xmlns:ns2="http://schemas.microsoft.com/2003/10/Serialization/Arrays"
> xmlns="http://xmlsoap.org/Ping"><array><Include
> xmlns="http://www.w3.org/2004/08/xop/include"
> href="cid:d0bcba9f-3b26-4e32-90b6-e132684edaf6_at_example.jaxws.sun.com"/></array></EchoBinaryAsString></S:Body></S:Envelope>
>
> --uuid:af0ad1cd-23cf-40f8-83c9-977198f4e541
> Content-Type: application/octet-stream
> Content-Id: <d0bcba9f-3b26-4e32-90b6-e132684edaf6_at_example.jaxws.sun.com>
> Content-Transfer-Encoding: binary
>
> H e l l o W o r l d ! H e l l o W o r l d ! H e l l o W o r l d !
> H e l l o W o r l d ! H e l l o W o r l d ! H e l l o W o r l d !
> H e l l o W o r l d ! H e l l o W o r l d ! H e l l o W o r l d !
> H e l l o W o r l d ! H e l l o W o r l d ! H e l l o W o r l d !
> H e l l o W o r l d ! H e l l o W o r l d ! H e l l o W o r l d !
> H e l l o W o r l d ! H e l l o W o r l d ! H e l l o W o r l d !
> H e l l o W o r l d ! H e l l o W o r l d ! H e l l o W o r l d !
> H e l l o W o r l d ! H e l l o W o r l d ! H e l l o W o r l d !
> H e l l o W o r l d ! H e l l o W o r l d ! H e l l o W o r l d !
> H e l l o W o r l d ! H e l l o W o r l d ! H e l l o W o r l d !
> H e l l o W o r l d ! H e l l o W o r l d !
> --uuid:af0ad1cd-23cf-40f8-83c9-977198f4e541----------------------
> =======================================================
> ---[HTTP response 200]---
> Mime-version: 1.0
> Date: Tue, 22 Aug 2006 07:58:33 GMT
> null: HTTP/1.1 200 OK
> X-powered-by: ASP.NET
> Via: 1.1 S1PS
> Content-length: 1249
> X-aspnet-version: 2.0.50727
> Content-type: multipart/related;
> type="application/xop+xml";start="<http://tempuri.org/0>";boundary="uuid:1ac98664-09db-454a-a7a8-3ba9835c1ce5+id=163";start-info="text/xml"
>
> Server: Microsoft-IIS/5.1
> Cache-control: private
>
> --uuid:1ac98664-09db-454a-a7a8-3ba9835c1ce5+id=163
> Content-ID: <http://tempuri.org/0>
> Content-Transfer-Encoding: 8bit
> Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
>
> <s:Envelope
> xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><EchoBinaryAsStringResponse
> xmlns="http://xmlsoap.org/Ping"><EchoBinaryAsStringResult>H e l l o W
> o r l d ! H e l l o W o r l d ! H e l l o W o r l d ! H e l l o W
> o r l d ! H e l l o W o r l d ! H e l l o W o r l d ! H e l l o W
> o r l d ! H e l l o W o r l d ! H e l l o W o r l d ! H e l l o W
> o r l d ! H e l l o W o r l d ! H e l l o W o r l d ! H e l l o W
> o r l d ! H e l l o W o r l d ! H e l l o W o r l d ! H e l l o W
> o r l d ! H e l l o W o r l d ! H e l l o W o r l d ! H e l l o W
> o r l d ! H e l l o W o r l d ! H e l l o W o r l d ! H e l l o W
> o r l d ! H e l l o W o r l d ! H e l l o W o r l d ! H e l l o W
> o r l d ! H e l l o W o r l d ! H e l l o W o r l d ! H e l l o W
> o r l d ! H e l l o W o r l d ! H e l l o W o r l d ! H e l l o W
> o r l d ! H e l l o W o r l d
> !</EchoBinaryAsStringResult></EchoBinaryAsStringResponse></s:Body></s:Envelope>
>
> --uuid:1ac98664-09db-454a-a7a8-3ba9835c1ce5+id=163--
> --------------------
> =======================================================
>

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109