Hello again
After digging even deeper on my side, I have the impression that the
issue is not because of the <?xml header but rather due to the fact that
I'm using a Web Service that's MTOM (which is logical: the WS handles
file download and uploads). Trouble: PHP's SOAP client doesn't support
MTOM (you can google "PHP SOAP MTOM" for details).
So, thank you for the ideas... But unfortunately the problem was
elsewhere :)
Cheers
S. Ali Tokmen
[email protected]
Office: +33 4 76 29 76 19
GSM: +33 66 43 00 555
Bull, Architect of an Open World TM
http://www.bull.com
On 23/06/2010 10:18, Willem Jiang wrote:
Hi,
I just tried the solution of the JAXWS Handler, it only print out the
soap message and doesn't change the output stream which is sent to
client.
After digging a while, I found the StaxOutInterceptor[1] will check
the message context with the key of
"org.apache.cxf.stax.force-start-document" to decide if it will send
the xml declaration.
So you can configure this interceptor[2] into the camel-cxf endponit
or setting the message header when you return the response to the cxf
client.
BTW, the last option only work in Camel 2.4 SNAPSHOT [3].
[1]http://www.docjar.com/html/api/org/apache/cxf/interceptor/StaxOutInterceptor.java.html
[2]https://svn.apache.org/repos/asf/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/WriteXmlDeclarationInterceptor.java
[3]https://issues.apache.org/activemq/browse/CAMEL-2841
Willem
----------------------------------
Apache Camel, Apache CXF committer
Open SOA http://www.fusesource.com
Blog http://willemjiang.blogspot.com
Tiwtter http://twitter.com/willemjiang
William Tam wrote:
There is a way of adding the XML header by using JAXWS handler.
http://stackoverflow.com/questions/1614431/webservicice-with-apache-cxf-and-custom-headers
But, let me see if there is a easier way to it without requiring
handler.
On 06/21/2010 11:50 AM, S. Ali Tokmen wrote:
Hello
I have routes that use CAMEL-CXF. When I call these routes via
SoapUI, JAX-WS, JAX-RPC or even Microsoft C# these work perfectly.
BUT, when I try with PHP (whether NuSOAP or the new SoapClient), I
have a PHP error like:
Error:sendSms: SoapFault exception: [Client] looks like we got no
XML document in [...]
If I look at the HTTP response generated by CAMEL-CXF, its response
looks like:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: multipart/related; type="application/xop+xml";
boundary="uuid:7de96b4c-37f3-4835-9519-7adad8ce8114";
start="<[email protected]>"; start-info="text/xml"
Content-Length: 1235
Date: Mon, 21 Jun 2010 15:32:15 GMT
--uuid:7de96b4c-37f3-4835-9519-7adad8ce8114
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml";
Content-Transfer-Encoding: binary
Content-ID: <[email protected]>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body>[...]</soap:Body></soap:Envelope>
--uuid:7de96b4c-37f3-4835-9519-7adad8ce8114--
As a result, the SOAP content doesn't start with:
<?xml version="1.0" encoding="utf-8"?>
... and I think that's what making PHP fail.
Any ideas on putting the XML header in front of the SOAP response?
Cheers