You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Benson Margulies <bi...@gmail.com> on 2008/01/15 13:56:57 UTC

more specific MtoM puzzle

I'm watching some of the fun in the MimePartInputStream. This seems to
be only finding one body. That is, the first time it's asked to read for
an attachment, as opposed to the main content, it gets to EOF. Anybody
see why it wouldn't stop at my first boundary?


INFO: Inbound Message
----------------------------
Encoding: UTF-8
Headers: {MessageType=[CALL], Content-Length=[937],
Host=[localhost:8808], User-Agent=[Java/1.5.0_13],
connection=[keep-alive], SOAPAction=[,], Pragma=[no-cache],
content-type=[Multipart/Related; start-info="text/xml";
type="application/xop+xml";
boundary="_bOuNDaRy_ee03eb38-ce97-4fa7-baa7-f145f95c5dbc"],
Cache-Control=[no-cache], Accept=[text/html, image/gif, image/jpeg, *;
q=.2, */*; q=.2]}
Messages: 
Message:

Payload: --_bOuNDaRy_ee03eb38-ce97-4fa7-baa7-f145f95c5dbc
Content-Type: application/xop+xml; type="text/xml"; charset=utf-8

<?xml version="1.0" encoding="UTF-8"?><soap-env:Envelope
xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap-env:Body
xmlns:jns0='uri:org.apache.cxf.javascript.testns'
xmlns:jns1='uri:org.apache.cxf.javascript.fortest' ><jns1:theArg
xmlns:jns0='uri:org.apache.cxf.javascript.testns'
><jns0:notXml10><xop:Include
xmlns:xop="http://www.w3.org/2004/08/xop/include"
href="cid:0bb2a0f5-f3e8-4422-8c0d-150fe5c3c8e3" /></jns0:notXml10><jns0:ordinary>disorganized&lt;organized</jns0:ordinary></jns1:theArg></soap-env:Body></soap-env:Envelope>

--_bOuNDaRy_ee03eb38-ce97-4fa7-baa7-f145f95c5dbc
Content-Type: text/plain; charset="utf-8";
Content-ID: <0bb2a0f5-f3e8-4422-8c0d-150fe5c3c8e3>
<html></html>

--------------------------------------


Re: more specific MtoM puzzle

Posted by Benson Margulies <bi...@gmail.com>.
Dan,

I got it to work. There were not enough newlines.

However, I got really confused about mime types and schema types. I
discovered that CXF insists on delivering base64 to a string even when
there is an XmlMimeType clueing it in that I really just want the text
from the attachment. So the following doesn't work, and I had to switch
to using a DataHandler. 


@XmlType(namespace = "uri:org.apache.cxf.javascript.testns")
public class MtoMParameterBeanNoDataHandler {
    private String ordinary;
    private String notXml10;
    
    public String getOrdinary() {
        return ordinary;
    }
    public void setOrdinary(String ordinary) {
        this.ordinary = ordinary;
    }
    
    @XmlMimeType("text/plain")
    @XmlSchemaType(name = "base64Binary")
    public String getNotXml10() {
        return notXml10;
    }
    public void setNotXml10(String notXml10) {
        this.notXml10 = notXml10;
    }
}



Re: more specific MtoM puzzle

Posted by Daniel Kulp <dk...@apache.org>.
Benson,

At what point is it hitting the EOF?  Has it found the boundary and is 
trying to read the headers?   Or is the InputStream then returned have 
no bytes?

One thing I see is:
--_bOuNDaRy_ee03eb38-ce97-4fa7-baa7-f145f95c5dbc
Content-Type: text/plain; charset="utf-8";
Content-ID: <0bb2a0f5-f3e8-4422-8c0d-150fe5c3c8e3>
<html> </html>

I think there is supposed to be a blank line between the headers 
(Content-ID) and the actual content.   Thus, the call to 
new InternetHeaders(stream)
may be consuming everything as it doesn't know where the headers stop.

Not really sure though.  
Dan



On Tuesday 15 January 2008, Benson Margulies wrote:
> I'm watching some of the fun in the MimePartInputStream. This seems to
> be only finding one body. That is, the first time it's asked to read
> for an attachment, as opposed to the main content, it gets to EOF.
> Anybody see why it wouldn't stop at my first boundary?
>
>
> INFO: Inbound Message
> ----------------------------
> Encoding: UTF-8
> Headers: {MessageType=[CALL], Content-Length=[937],
> Host=[localhost:8808], User-Agent=[Java/1.5.0_13],
> connection=[keep-alive], SOAPAction=[,], Pragma=[no-cache],
> content-type=[Multipart/Related; start-info="text/xml";
> type="application/xop+xml";
> boundary="_bOuNDaRy_ee03eb38-ce97-4fa7-baa7-f145f95c5dbc"],
> Cache-Control=[no-cache], Accept=[text/html, image/gif, image/jpeg, *;
> q=.2, */*; q=.2]}
> Messages:
> Message:
>
> Payload: --_bOuNDaRy_ee03eb38-ce97-4fa7-baa7-f145f95c5dbc
> Content-Type: application/xop+xml; type="text/xml"; charset=utf-8
>
> <?xml version="1.0" encoding="UTF-8"?><soap-env:Envelope
> xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap-env:Body
> xmlns:jns0='uri:org.apache.cxf.javascript.testns'
> xmlns:jns1='uri:org.apache.cxf.javascript.fortest' ><jns1:theArg
> xmlns:jns0='uri:org.apache.cxf.javascript.testns'
>
> ><jns0:notXml10><xop:Include
>
> xmlns:xop="http://www.w3.org/2004/08/xop/include"
> href="cid:0bb2a0f5-f3e8-4422-8c0d-150fe5c3c8e3"
> /></jns0:notXml10><jns0:ordinary>disorganized&lt;organized</jns0:ordin
>ary></jns1:theArg></soap-env:Body></soap-env:Envelope>
>
> --_bOuNDaRy_ee03eb38-ce97-4fa7-baa7-f145f95c5dbc
> Content-Type: text/plain; charset="utf-8";
> Content-ID: <0bb2a0f5-f3e8-4422-8c0d-150fe5c3c8e3>
> <html></html>
>
> --------------------------------------



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog