You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Thomas Sauzedde <th...@gmail.com> on 2009/04/17 12:11:06 UTC
MTOM and boundary header / names (related to https://issues.apache.org/jira/browse/CXF-606
?!?)
Hi everybody,
I'm writing a CXF client for a .NET SOAP server and I'm in front of the
following issue.
I need to use MTOM but the server goes mad with my MTOM requests.
I'm only writing the client, the server is a remote one and I can only
try to find a workaround on the client side :-(
>From my experiments, the server is really unhappy with the way CXF names
the boundaries.
In CXF request headers, the boundaries are like this :
Content-Type: <snip> boundary="----=_Part_0_33140442.1239893010990"; <snip>
>From CXF source code, the prefix is hardcoded and not something
configurable :-(
-
http://svn.apache.org/repos/asf/cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
-
http://svn.apache.org/repos/asf/cxf/trunk/rt/core/src/main/java/org/apache/cxf/attachment/AttachmentSerializer.java
I'm not a SOAP neither MTOM expert, but for sure I need the following to
make my client compatible with the server (tested with JMeter requests)
- to remove the quotes (") around the boundary name in the Content-Type
- remove the equal (=) in the boundary name
Tu cut a long story short I need this :
Content-Type: <snip> boundary=----_Part_0_33140442.1239893010990; <snip>
I can of course pach my CXF installation, but I would like to stick with
"official" releases ...
Does someone has any advices ?
I'm thinking about an out interceptor but I'm not sure this is really
the best way to do this ...
Regards
--
Tom
Re: MTOM and boundary header / names (related to https://issues.apache.org/jira/browse/CXF-606
?!?)
Posted by Thomas Sauzedde <th...@gmail.com>.
Daniel Kulp a écrit :
> Probably. Cannot really think of another way to do it.
>
> I'm really surprised that the quoted stuff is an issue. More likely, it's
> the ---- at the start. It's possible that the change to uuid that I did on
> friday will fix your issue anyway.
>
> I checked Metro and metro also quotes the boundary. That's why I'm quite
> surprised if that really is the issue.
>
> Dan
>
As I wrote I did some tests with JMeter.
I've got a provided client that works out of the box with MTOM requests.
What I did was to compare the HTTP(S) output of this client with the
output of my CXF client.
Then I diffed these outputs and empirically tried to manually change
each different fields.
My conclusions were :
- No = in the boudary name
- No quote around the boundary name in the header (Content-Type)
- Need an extra CR/LF after the attachment itself
I retried this morning, and a quoted boundary name is definitively an
issue (in my case) but a "----" prefix is not !
Currently, the kind of content-type I'm using is like the following :
Content-Type: multipart/related; type="application/xop+xml";
boundary=----_Part_0_11829808.1239973034339;
start="<ro...@cxf.apache.org>";
start-info="application/soap+xml"; action="<snipsnip>"
I googled and according to http://www.faqs.org/rfcs/rfc2046.html chapter
5.1.1 (sorry no anchor), this is definitively a server side bug (about
quoted boundary )!
Thanks a lot for your comments
--
Tom
Re: MTOM and boundary header / names (related to https://issues.apache.org/jira/browse/CXF-606 ?!?)
Posted by Daniel Kulp <dk...@apache.org>.
On Mon April 20 2009 5:45:33 am Thomas Sauzedde wrote:
> Daniel Kulp a écrit :
> > On Fri April 17 2009 6:11:06 am Thomas Sauzedde wrote:
> >> Hi everybody,
> >>
> >> I'm writing a CXF client for a .NET SOAP server and I'm in front of the
> >> following issue.
> >> I need to use MTOM but the server goes mad with my MTOM requests.
> >
> > Hmm.... what version of .NET? We've tested this several times before
> > without any issues.
>
> I'm sorry but I don't have the answer ...
> Because of a kind of NDA, I must be quite vague but this is a SOAP based
> IM service and we are hosting a client gateway.
> The server is out of our control :-(
>
> If you know something to do on the client side that can help to
> determine this, I can try ....
>
> What I have done last week is my own AttachmentOutInterceptor that call
> a customized AttachmentUtil and AttachmentSerializer.
> This interceptor register itself as a replacement for the "official"
> AttachmentOutInterceptor ...(id = AttachmentOutInterceptor.class.getName())
>
> Like this, it is working, but could you tell me if this is this the best
> way to do ?
Probably. Cannot really think of another way to do it.
I'm really surprised that the quoted stuff is an issue. More likely, it's
the ---- at the start. It's possible that the change to uuid that I did on
friday will fix your issue anyway.
I checked Metro and metro also quotes the boundary. That's why I'm quite
surprised if that really is the issue.
Dan
>
> > That said, I really don't like our boundary format. The = in there
> > really does suck and definitely would cause issues. Having it start
> > with --- also is not good. I've poked around a bit and I'm testing a
> > change to make it a uuid. It would still be quoted (as per spec, that
> > should be there), but it would look more like:
> >
> > boundary="uuid:e9c5f300-b0ed-4a72-b2b0-9a738e26e0a7"
> >
> > I'll get that committed to trunk shortly.
> >
> > Dan
>
> I'm going to see if a bug request could be opened for the quoted
> boundary name on the server side, but IMHO this is going to be rejected :-(
>
> Thanks
>
> --
> Tom
--
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog
Re: MTOM and boundary header / names (related to https://issues.apache.org/jira/browse/CXF-606
?!?)
Posted by Thomas Sauzedde <th...@gmail.com>.
Daniel Kulp a écrit :
> On Fri April 17 2009 6:11:06 am Thomas Sauzedde wrote:
>
>> Hi everybody,
>>
>> I'm writing a CXF client for a .NET SOAP server and I'm in front of the
>> following issue.
>> I need to use MTOM but the server goes mad with my MTOM requests.
>>
>
> Hmm.... what version of .NET? We've tested this several times before without
> any issues.
>
I'm sorry but I don't have the answer ...
Because of a kind of NDA, I must be quite vague but this is a SOAP based
IM service and we are hosting a client gateway.
The server is out of our control :-(
If you know something to do on the client side that can help to
determine this, I can try ....
What I have done last week is my own AttachmentOutInterceptor that call
a customized AttachmentUtil and AttachmentSerializer.
This interceptor register itself as a replacement for the "official"
AttachmentOutInterceptor ...(id = AttachmentOutInterceptor.class.getName())
Like this, it is working, but could you tell me if this is this the best
way to do ?
> That said, I really don't like our boundary format. The = in there really
> does suck and definitely would cause issues. Having it start with --- also
> is not good. I've poked around a bit and I'm testing a change to make it a
> uuid. It would still be quoted (as per spec, that should be there), but it
> would look more like:
>
> boundary="uuid:e9c5f300-b0ed-4a72-b2b0-9a738e26e0a7"
>
> I'll get that committed to trunk shortly.
>
> Dan
>
I'm going to see if a bug request could be opened for the quoted
boundary name on the server side, but IMHO this is going to be rejected :-(
Thanks
--
Tom
Re: MTOM and boundary header / names (related to https://issues.apache.org/jira/browse/CXF-606 ?!?)
Posted by Daniel Kulp <dk...@apache.org>.
On Fri April 17 2009 6:11:06 am Thomas Sauzedde wrote:
> Hi everybody,
>
> I'm writing a CXF client for a .NET SOAP server and I'm in front of the
> following issue.
> I need to use MTOM but the server goes mad with my MTOM requests.
Hmm.... what version of .NET? We've tested this several times before without
any issues.
That said, I really don't like our boundary format. The = in there really
does suck and definitely would cause issues. Having it start with --- also
is not good. I've poked around a bit and I'm testing a change to make it a
uuid. It would still be quoted (as per spec, that should be there), but it
would look more like:
boundary="uuid:e9c5f300-b0ed-4a72-b2b0-9a738e26e0a7"
I'll get that committed to trunk shortly.
Dan
>
> I'm only writing the client, the server is a remote one and I can only
> try to find a workaround on the client side :-(
>
> From my experiments, the server is really unhappy with the way CXF names
> the boundaries.
>
> In CXF request headers, the boundaries are like this :
> Content-Type: <snip> boundary="----=_Part_0_33140442.1239893010990"; <snip>
>
> From CXF source code, the prefix is hardcoded and not something
> configurable :-(
> -
> http://svn.apache.org/repos/asf/cxf/trunk/rt/core/src/main/java/org/apache/
>cxf/attachment/AttachmentUtil.java -
> http://svn.apache.org/repos/asf/cxf/trunk/rt/core/src/main/java/org/apache/
>cxf/attachment/AttachmentSerializer.java
>
> I'm not a SOAP neither MTOM expert, but for sure I need the following to
> make my client compatible with the server (tested with JMeter requests)
> - to remove the quotes (") around the boundary name in the Content-Type
> - remove the equal (=) in the boundary name
>
> Tu cut a long story short I need this :
>
> Content-Type: <snip> boundary=----_Part_0_33140442.1239893010990; <snip>
>
> I can of course pach my CXF installation, but I would like to stick with
> "official" releases ...
>
> Does someone has any advices ?
>
> I'm thinking about an out interceptor but I'm not sure this is really
> the best way to do this ...
>
> Regards
>
> --
> Tom
--
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog