Hi,
By default cxf provider(which actually is cxf client) will use chunked
transfer encoding for obtaining higher performance, which means doesn't set
contentlength to the outgoing http header. However, some  server doesn't
support this feature yet (or not by  default use chunked mode). You can
disable chunked mode for cxf provider by add a cxf configuration file, let's
say, namely nochunk.xml which looks 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="{urn:ZSI:examples}EchoServer.http-conduit">
      <http-conf:client AllowChunking="false"/>
  </http-conf:conduit>
</beans>
and add busCfg="nochunk.xml" attribute for your cxf bc provider
configuration.

For more about what the chunked mode means for http transport,please take a
look at [1] for more info
For more about how to configure the http transport used for cxf, please take
a look at [2]
[1]
http://www.nabble.com/Just-what-is-%27AllowChunking%27--td19001650.html#a19046421
[2]
http://cwiki.apache.org/CXF20DOC/client-http-transport-including-ssl-support.html

Regards
Freeman

On Thu, Oct 2, 2008 at 4:10 AM, Russ Chan <[EMAIL PROTECTED]> wrote:

> Greetings all,
>
> We're doing a proof of concept with Servicemix/Fuse (3.3.1.7), but are
> running into a couple of problems.  I'm hoping someone can help.
>
> What we're trying to do is actually quite simple:
>
> file-poller --> camelroute --> cxf-bc:provider soap --> log
>
>
> Everything is working up to the cxf-bc:provider calling out to the soap
> service.
> The payload of the call to the soap service looks correct, but for one
> thing:
>
> The content-length header is missing, which the soap service is (rightly)
> rejecting with a fault.
>
> I've searched through the lists and haven't managed to find anyone else
> with
> a similar problem.
>
> The Camel route looks like this:
>  from ("jbi:service:urn:ZSI:examples:CamelRoute")
>                .pipeline(
>                        "log:BCSIn",
>
>
> //"jbi:endpoint:urn:ZSI:examples:EchoServer:EchoServer?mep=in-out&operation=Echo",
>
> "jbi:endpoint:urn:ZSI:examples:EchoServer:EchoServer?mep=in-out",
>                        "log:BCSOut"
>                );
>
> (Note the commented out line - when I use that one instead, I get an NPE in
> CxfBCProvider...)
>
> The cxfbc: provider endpoint is configured thusly:
> <beans
>       xmlns="http://www.springframework.org/schema/beans";
>       xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance";
>       xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0";
>       xmlns:bs="urn:ZSI:examples"
>       xsi:schemaLocation="http://servicemix.apache.org/cxfse/1.0
> http://servicemix.apache.org/schema/servicemix-cxfse-3.3.1.7-fuse.xsd
>       http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd";>
>
>  <cxfbc:provider
>        service="bs:EchoServer"
>        endpoint="EchoServer"
>        useJBIWrapper="true"
>        wsdl="http://localhost:9999/EchoServer?WSDL";
>        locationURI="http://localhost:9999/EchoServer"; >
>        <cxfbc:inInterceptors>
>            <bean class="org.apache.cxf.interceptor.LoggingInInterceptor" />
>        </cxfbc:inInterceptors>
>        <cxfbc:outInterceptors>
>            <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"
> />
>        </cxfbc:outInterceptors>
>        <cxfbc:inFaultInterceptors>
>            <bean class="org.apache.cxf.interceptor.LoggingInInterceptor" />
>        </cxfbc:inFaultInterceptors>
>        <cxfbc:outFaultInterceptors>
>            <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"
> />
>        </cxfbc:outFaultInterceptors>
>    </cxfbc:provider>
> </beans>
>
>
>
> The soap service is a simple "echo" service provided by a python ZSI
> server.  We have python clients and Java (axis) clients connecting to it
> just fine.
>
> Here's the WSDL:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <definitions
>  xmlns="http://schemas.xmlsoap.org/wsdl/";
>  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
>  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
>  xmlns:http="http://schemas.xmlsoap.org/wsdl/http/";
>  xmlns:xsd="http://www.w3.org/2001/XMLSchema";
>  xmlns:tns="urn:ZSI:examples"
>  targetNamespace="urn:ZSI:examples" >
>  <types>
>  <xsd:schema elementFormDefault="qualified"
> targetNamespace="urn:ZSI:examples">
>      <xsd:element name="Echo">
>        <xsd:complexType>
>          <xsd:sequence>
>            <xsd:element minOccurs="0" maxOccurs="1" name="EchoIn"
> type="xsd:string" />
>          </xsd:sequence>
>        </xsd:complexType>
>      </xsd:element>
>      <xsd:element name="EchoResponse">
>        <xsd:complexType>
>          <xsd:sequence>
>            <xsd:element minOccurs="0" maxOccurs="1" name="EchoResult"
> type="xsd:string" />
>          </xsd:sequence>
>        </xsd:complexType>
>      </xsd:element>
>  </xsd:schema>
>  </types>
>
>  <message name="EchoRequest">
>    <part name="parameters" element="tns:Echo" />
>  </message>
>  <message name="EchoResponse">
>    <part name="parameters" element="tns:EchoResponse"/>
>  </message>
>
>  <portType name="EchoServer">
>    <operation name="Echo">
>      <input message="tns:EchoRequest"/>
>      <output message="tns:EchoResponse"/>
>    </operation>
>  </portType>
>
>  <binding name="EchoServer" type="tns:EchoServer">
>    <soap:binding style="document"
>                  transport="http://schemas.xmlsoap.org/soap/http"/>
>    <operation name="Echo">
>      <soap:operation soapAction="Echo"/>
>        <input>
>          <soap:body use="literal"/>
>        </input>
>        <output>
>          <soap:body use="literal"/>
>        </output>
>    </operation>
>  </binding>
>  <service name="EchoServer">
>    <port name="EchoServer" binding="tns:EchoServer">
>      <soap:address location="http://localhost:7000"/>
>    </port>
>  </service>
> </definitions>
>
>
> Here's the "on the wire" soap going out of the cxf-bc endpoint (no idea
> where the 107 below is coming from):
>
> POST /EchoServer HTTP/1.1
> Content-Type: text/xml; charset=UTF-8
> SOAPAction: "Echo"
> Content-Type: text/xml
> Accept: *
> Cache-Control: no-cache
> Pragma: no-cache
> User-Agent: Java/1.6.0_10-rc
> Host: localhost:9999
> Connection: keep-alive
> Transfer-Encoding: chunked
>
> 107
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/
> "><soap:Body
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
>        <msg:Echo>
>        <msg:EchoIn xsi:type="xsd:string">Test</msg:EchoIn>
>        </msg:Echo>
> </soap:Body></soap:Envelope>
>
>
> And the "on the wire" soap fault:
>
> HTTP/1.0 500 Internal error
> Server: ZSI/1.1 BaseHTTP/0.3 Python/2.4.4
> Date: Wed, 01 Oct 2008 20:10:28 GMT
> Content-type: text/xml; charset="utf-8"
> Content-Length: 722
>
> <SOAP-ENV:Envelope xmlns:SOAP-ENC="
> http://schemas.xmlsoap.org/soap/encoding/";
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:ZSI="
> http://www.zolera.com/schemas/ZSI/"; xmlns:xsd="
> http://www.w3.org/2001/XMLSchema"; xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance
>
> "><SOAP-ENV:Header><ZSI:detail><ZSI:FaultDetail><ZSI:string>exceptions:KeyError
>
> 'content-length'</ZSI:string><ZSI:trace>build/bdist.macosx-10.4-fat/egg/ZSI/ServiceContainer.py:334:do_POST
>
> rfc822.py:390:__getitem__</ZSI:trace></ZSI:FaultDetail></ZSI:detail></SOAP-ENV:Header><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Processing
> Failure</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
>
>
> And... finally - the source file originally picked up by the file-poller
> service:
> <?xml version="1.0" encoding="UTF-8"?>
> <jbi:message xmlns:jbi="http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper";
> xmlns:msg="urn:ZSI:examples"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> name="Echo"
> type="msg:Echo"
> version="1.0">
> <jbi:part>
>        <msg:Echo>
>        <msg:EchoIn xsi:type="xsd:string">Test</msg:EchoIn>
>        </msg:Echo>
> </jbi:part>
> </jbi:message>
>
>
>
> Regards,
> Russ Chan
>

Reply via email to