You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Michael Matczynski <mj...@alum.mit.edu> on 2007/06/27 19:56:05 UTC

WS-I Compliance / SOAP Messages

I have a test environment where a CXF client communicates with a CXF server,
both generated from a wsdl using the wsdl2java utility.  With a direct
connection the client is able to  function properly, but when I insert a
WS-I monitor between the client and server, messages sent from the client
appear to be stopped by the WS-I monitor on their way to the server.

Using tcpmon, I've discovered suspicious text (a few extra characters,
perhaps a checksum?) that appears before and after every request sent by the
client.  I've loaded up the wsdl in SOAP UI and am able to successfully
communicate with the server.  Here is a comparison of the two outgoing
requests:

=== Request message produced from a client using CXF's wsdl2java ===

POST /FileCrawlerService HTTP/1.1
Content-Type: text/xml; charset=UTF-8
SOAPAction: ""
Cache-Control: no-cache
Pragma: no-cache
User-Agent: Java/1.5.0_11
Host: localhost:12000
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Transfer-Encoding: chunked

f6
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:startCrawl
xmlns:ns2=" http://endeca.com/itl/file
"><crawlId><id>test</id></crawlId><crawlMode>FULL_CRAWL</crawlMode></ns2:startCrawl></soap:Body></soap:Envelope>
0

=== Same request sent from SOAP UI ====

POST /FileCrawlerService HTTP/1.1
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
User-Agent: Jakarta Commons-HttpClient/3.0.1
Host: localhost:12000
Content-Length: 381

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:file=" http://endeca.com/itl/file">
   <soapenv:Header/>
   <soapenv:Body>
      <file:startCrawl>
         <crawlId>
            <id>foobar</id>
         </crawlId>
         <!--Optional:-->
         <crawlMode>?</crawlMode>
      </file:startCrawl>
   </soapenv:Body>
</soapenv:Envelope>

=== ===

Any idea what could be going on?  Has CXF been tested for WS-I compliance?

Thanks!
Mike

-- 
Michael Matczynski
e: mjm@alum.mit.edu
c: 617-388-4606
w: www.zingtech.com
w: www.catchwine.com

Re: WS-I Compliance / SOAP Messages

Posted by Sergey Beryozkin <se...@iona.com>.
Hi

Just curious, is it really a bug or just another WS-I monitor limitation ?

I thought it works like this : if "charset" is set on the Content-Type then it takes precedence over
the value in the xml declaration in the body, if that exists; If no "charset" is set then the value in the xml declaration, if 
present, is used. Otherwise the default xml encoding is assumed...

Cheers, Sergey


----- Original Message ----- 
From: "Daniel Kulp" <dk...@apache.org>
To: <cx...@incubator.apache.org>
Sent: Thursday, June 28, 2007 10:12 PM
Subject: Re: WS-I Compliance / SOAP Messages


>
> I got this.   The HTTPConduit does set it properly.   The HTTPDestination
> does not.   I should have a fix committed to SVN in an hour or so.
>
> Thanks for the bug report!
>
> Dan
>
>
> On Thursday 28 June 2007 16:56, Michael Matczynski wrote:
>> Thanks for the suggestions!  Turning off chunking in the client fixed
>> this WS-I conformance issue, but exposed another one...
>>
>> It looks like the Content-Type HTTP header is not being set properly
>> on messages sent from the server.  Apparently the "charset" value must
>> be set when the "Content-Type" property is specified.
>>
>> Example server header:
>>
>> HTTP/1.1 200 OK
>> Content-Type: text/xml (should also have charset=UTF-8)
>> SOAPAction: ""
>> Content-Length: 174
>> Server: Jetty(6.1.3)
>>
>> Is there a way to make "Content-Type" equal to "text/xml;
>> charset=UTF-8" programmatically using the API
>> (JaxWsServerFactoryBean)?
>>
>> Thanks!
>> Mike
>>
>> On 6/27/07, Sergey Beryozkin <se...@iona.com> wrote:
>> > Thanks, seems like the HTTP layer can be tuned a lot :-)
>> >
>> > Cheers, Sergey
>> >
>> > > -----Original Message-----
>> > > From: Sergey Beryozkin [mailto:sergey.beryozkin@iona.com]
>> > > Sent: 27 June 2007 19:05
>> > > To: cxf-user@incubator.apache.org
>> > > Subject: Re: WS-I Compliance / SOAP Messages
>> > >
>> > > Looks like the WS-I monitor can not deal with
>> > >
>> > > > Transfer-Encoding: chunked
>> >
>> > Yep, I think you're right Sergey.
>> >
>> > > I'm wondering, is it possible to configure CXF not to use
>> > > chunked mode ?
>> >
>> > Yep again, see my last mail on this thread.
>> >
>> > > Cheers, Sergey
>> >
>> > ----------------------------
>> > IONA Technologies PLC (registered in Ireland)
>> > Registered Number: 171387
>> > Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
>> > Ireland
>> >
>> > ----------------------------
>> > IONA Technologies PLC (registered in Ireland)
>> > Registered Number: 171387
>> > Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
>> > Ireland
>
> -- 
> J. Daniel Kulp
> Principal Engineer
> IONA
> P: 781-902-8727    C: 508-380-7194
> daniel.kulp@iona.com
> http://www.dankulp.com/blog 

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Re: WS-I Compliance / SOAP Messages

Posted by Daniel Kulp <dk...@apache.org>.
I got this.   The HTTPConduit does set it properly.   The HTTPDestination 
does not.   I should have a fix committed to SVN in an hour or so.

Thanks for the bug report!

Dan


On Thursday 28 June 2007 16:56, Michael Matczynski wrote:
> Thanks for the suggestions!  Turning off chunking in the client fixed
> this WS-I conformance issue, but exposed another one...
>
> It looks like the Content-Type HTTP header is not being set properly
> on messages sent from the server.  Apparently the "charset" value must
> be set when the "Content-Type" property is specified.
>
> Example server header:
>
> HTTP/1.1 200 OK
> Content-Type: text/xml (should also have charset=UTF-8)
> SOAPAction: ""
> Content-Length: 174
> Server: Jetty(6.1.3)
>
> Is there a way to make "Content-Type" equal to "text/xml;
> charset=UTF-8" programmatically using the API
> (JaxWsServerFactoryBean)?
>
> Thanks!
> Mike
>
> On 6/27/07, Sergey Beryozkin <se...@iona.com> wrote:
> > Thanks, seems like the HTTP layer can be tuned a lot :-)
> >
> > Cheers, Sergey
> >
> > > -----Original Message-----
> > > From: Sergey Beryozkin [mailto:sergey.beryozkin@iona.com]
> > > Sent: 27 June 2007 19:05
> > > To: cxf-user@incubator.apache.org
> > > Subject: Re: WS-I Compliance / SOAP Messages
> > >
> > > Looks like the WS-I monitor can not deal with
> > >
> > > > Transfer-Encoding: chunked
> >
> > Yep, I think you're right Sergey.
> >
> > > I'm wondering, is it possible to configure CXF not to use
> > > chunked mode ?
> >
> > Yep again, see my last mail on this thread.
> >
> > > Cheers, Sergey
> >
> > ----------------------------
> > IONA Technologies PLC (registered in Ireland)
> > Registered Number: 171387
> > Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
> > Ireland
> >
> > ----------------------------
> > IONA Technologies PLC (registered in Ireland)
> > Registered Number: 171387
> > Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
> > Ireland

-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

Re: WS-I Compliance / SOAP Messages

Posted by Michael Matczynski <mj...@alum.mit.edu>.
Thanks for the suggestions!  Turning off chunking in the client fixed this
WS-I conformance issue, but exposed another one...

It looks like the Content-Type HTTP header is not being set properly on
messages sent from the server.  Apparently the "charset" value must be set
when the "Content-Type" property is specified.

Example server header:

HTTP/1.1 200 OK
Content-Type: text/xml (should also have charset=UTF-8)
SOAPAction: ""
Content-Length: 174
Server: Jetty(6.1.3)

Is there a way to make "Content-Type" equal to "text/xml; charset=UTF-8"
programmatically using the API (JaxWsServerFactoryBean)?

Thanks!
Mike

On 6/27/07, Sergey Beryozkin <se...@iona.com> wrote:
>
> Thanks, seems like the HTTP layer can be tuned a lot :-)
>
> Cheers, Sergey
>
>
>
> > -----Original Message-----
> > From: Sergey Beryozkin [mailto:sergey.beryozkin@iona.com]
> > Sent: 27 June 2007 19:05
> > To: cxf-user@incubator.apache.org
> > Subject: Re: WS-I Compliance / SOAP Messages
> >
> > Looks like the WS-I monitor can not deal with
> >
> > > Transfer-Encoding: chunked
>
>
> Yep, I think you're right Sergey.
>
>
> > I'm wondering, is it possible to configure CXF not to use
> > chunked mode ?
>
>
> Yep again, see my last mail on this thread.
>
>
> > Cheers, Sergey
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
>



-- 
Michael Matczynski
e: mjm@alum.mit.edu
c: 617-388-4606
w: www.zingtech.com
w: www.catchwine.com

Re: WS-I Compliance / SOAP Messages

Posted by Sergey Beryozkin <se...@iona.com>.
Thanks, seems like the HTTP layer can be tuned a lot :-)

Cheers, Sergey



> -----Original Message-----
> From: Sergey Beryozkin [mailto:sergey.beryozkin@iona.com] 
> Sent: 27 June 2007 19:05
> To: cxf-user@incubator.apache.org
> Subject: Re: WS-I Compliance / SOAP Messages
> 
> Looks like the WS-I monitor can not deal with 
> 
> > Transfer-Encoding: chunked


Yep, I think you're right Sergey.

 
> I'm wondering, is it possible to configure CXF not to use 
> chunked mode ?


Yep again, see my last mail on this thread.

 
> Cheers, Sergey

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

RE: WS-I Compliance / SOAP Messages

Posted by "Glynn, Eoghan" <eo...@iona.com>.
 

> -----Original Message-----
> From: Sergey Beryozkin [mailto:sergey.beryozkin@iona.com] 
> Sent: 27 June 2007 19:05
> To: cxf-user@incubator.apache.org
> Subject: Re: WS-I Compliance / SOAP Messages
> 
> Looks like the WS-I monitor can not deal with 
> 
> > Transfer-Encoding: chunked


Yep, I think you're right Sergey.

 
> I'm wondering, is it possible to configure CXF not to use 
> chunked mode ?


Yep again, see my last mail on this thread.

 
> Cheers, Sergey

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Re: WS-I Compliance / SOAP Messages

Posted by Sergey Beryozkin <se...@iona.com>.
Looks like the WS-I monitor can not deal with 

> Transfer-Encoding: chunked

I'm wondering, is it possible to configure CXF not to use chunked mode ?

Cheers, Sergey


----- Original Message ----- 
From: "Michael Matczynski" <mj...@alum.mit.edu>
To: <cx...@incubator.apache.org>
Sent: Wednesday, June 27, 2007 6:56 PM
Subject: WS-I Compliance / SOAP Messages


>I have a test environment where a CXF client communicates with a CXF server,
> both generated from a wsdl using the wsdl2java utility.  With a direct
> connection the client is able to  function properly, but when I insert a
> WS-I monitor between the client and server, messages sent from the client
> appear to be stopped by the WS-I monitor on their way to the server.
> 
> Using tcpmon, I've discovered suspicious text (a few extra characters,
> perhaps a checksum?) that appears before and after every request sent by the
> client.  I've loaded up the wsdl in SOAP UI and am able to successfully
> communicate with the server.  Here is a comparison of the two outgoing
> requests:
> 
> === Request message produced from a client using CXF's wsdl2java ===
> 
> POST /FileCrawlerService HTTP/1.1
> Content-Type: text/xml; charset=UTF-8
> SOAPAction: ""
> Cache-Control: no-cache
> Pragma: no-cache
> User-Agent: Java/1.5.0_11
> Host: localhost:12000
> Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
> Connection: keep-alive
> Transfer-Encoding: chunked
> 
> f6
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:startCrawl
> xmlns:ns2=" http://endeca.com/itl/file
> "><crawlId><id>test</id></crawlId><crawlMode>FULL_CRAWL</crawlMode></ns2:startCrawl></soap:Body></soap:Envelope>
> 0
> 
> === Same request sent from SOAP UI ====
> 
> POST /FileCrawlerService HTTP/1.1
> Content-Type: text/xml;charset=UTF-8
> SOAPAction: ""
> User-Agent: Jakarta Commons-HttpClient/3.0.1
> Host: localhost:12000
> Content-Length: 381
> 
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:file=" http://endeca.com/itl/file">
>   <soapenv:Header/>
>   <soapenv:Body>
>      <file:startCrawl>
>         <crawlId>
>            <id>foobar</id>
>         </crawlId>
>         <!--Optional:-->
>         <crawlMode>?</crawlMode>
>      </file:startCrawl>
>   </soapenv:Body>
> </soapenv:Envelope>
> 
> === ===
> 
> Any idea what could be going on?  Has CXF been tested for WS-I compliance?
> 
> Thanks!
> Mike
> 
> -- 
> Michael Matczynski
> e: mjm@alum.mit.edu
> c: 617-388-4606
> w: www.zingtech.com
> w: www.catchwine.com
>

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

RE: WS-I Compliance / SOAP Messages

Posted by "Glynn, Eoghan" <eo...@iona.com>.
The leading "f6" and trailing "0" that raised your suscipions are the
single chunk length and the last chunk marker respectively.

To turn off HTTP chunking, use a configuration something like:

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 
xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"
 
xsi:schemaLocation="http://cxf.apache.org/transports/http/configuration
http://cxf.apache.org/schemas/configuration/http-conf.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
  <http-conf:conduit
name="{http://apache.org/hello_world_soap_http}SoapPort.http-conduit">
    <http-conf:client AllowChunking="false" />
  </http-conf:conduit>
</beans>

... where "{http://apache.org/hello_world_soap_http}SoapPort" is the
QName of the target port.

Cheers,
Eoghan


> -----Original Message-----
> From: mikem2005@gmail.com [mailto:mikem2005@gmail.com] On 
> Behalf Of Michael Matczynski
> Sent: 27 June 2007 18:56
> To: cxf-user@incubator.apache.org
> Subject: WS-I Compliance / SOAP Messages
> 
> I have a test environment where a CXF client communicates 
> with a CXF server, both generated from a wsdl using the 
> wsdl2java utility.  With a direct connection the client is 
> able to  function properly, but when I insert a WS-I monitor 
> between the client and server, messages sent from the client 
> appear to be stopped by the WS-I monitor on their way to the server.
> 
> Using tcpmon, I've discovered suspicious text (a few extra 
> characters, perhaps a checksum?) that appears before and 
> after every request sent by the client.  I've loaded up the 
> wsdl in SOAP UI and am able to successfully communicate with 
> the server.  Here is a comparison of the two outgoing
> requests:
> 
> === Request message produced from a client using CXF's wsdl2java ===
> 
> POST /FileCrawlerService HTTP/1.1
> Content-Type: text/xml; charset=UTF-8
> SOAPAction: ""
> Cache-Control: no-cache
> Pragma: no-cache
> User-Agent: Java/1.5.0_11
> Host: localhost:12000
> Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
> Connection: keep-alive
> Transfer-Encoding: chunked
> 
> f6
> <soap:Envelope 
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:B
> ody><ns2:startCrawl
> xmlns:ns2=" http://endeca.com/itl/file
> "><crawlId><id>test</id></crawlId><crawlMode>FULL_CRAWL</crawl
> Mode></ns2:startCrawl></soap:Body></soap:Envelope>
> 0
> 
> === Same request sent from SOAP UI ====
> 
> POST /FileCrawlerService HTTP/1.1
> Content-Type: text/xml;charset=UTF-8
> SOAPAction: ""
> User-Agent: Jakarta Commons-HttpClient/3.0.1
> Host: localhost:12000
> Content-Length: 381
> 
> <soapenv:Envelope 
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:file=" http://endeca.com/itl/file">
>    <soapenv:Header/>
>    <soapenv:Body>
>       <file:startCrawl>
>          <crawlId>
>             <id>foobar</id>
>          </crawlId>
>          <!--Optional:-->
>          <crawlMode>?</crawlMode>
>       </file:startCrawl>
>    </soapenv:Body>
> </soapenv:Envelope>
> 
> === ===
> 
> Any idea what could be going on?  Has CXF been tested for 
> WS-I compliance?
> 
> Thanks!
> Mike
> 
> --
> Michael Matczynski
> e: mjm@alum.mit.edu
> c: 617-388-4606
> w: www.zingtech.com
> w: www.catchwine.com
> 

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland