Hello, I am using Apache Axis C++ 1.6 on the server side and recently I tried 
using Apache CXF 2.0.4 as the client. I got into the problem with CXF not being 
able to parse out correctly my server's response, I tracked the issue to be due 
to the namespace prefix mechanism Axis uses. For an example my server returns 
following SOAP response (body shown here):
 
<ns1:loginOutputData xmlns:ns1="http://incognito.com/sipprovisioning/ 
<https://webmail.incognito.com/exchweb/bin/redir.asp?URL=https://webmail.incognito.com/exchweb/bin/redir.asp?URL=http://incognito.com/sipprovisioning/>
 ">
<returnErrorCode>13<returnErrorCode>
<authToken>
<ns1:item>10</ns1:item>
<authToken>
</ns1:loginOutputData>
 
which CXF client doesn't parse out properly - it issues no exceptions, however 
the values are not correct, e.g. returnErrorCode is 0, and authToken is null. 
Once I sent back hard-coded response like below:
 
<ns1:loginOutputData xmlns:ns1="http://incognito.com/sipprovisioning/ 
<https://webmail.incognito.com/exchweb/bin/redir.asp?URL=https://webmail.incognito.com/exchweb/bin/redir.asp?URL=http://incognito.com/sipprovisioning/>
 ">
<ns1:returnErrorCode>13</ns1:returnErrorCode>
<ns1:authToken>
<ns1:item>10</ns1:item>
</ns1:authToken>
</ns1:loginOutputData>
 
client was happy and it displayed correct values. Now, I am not that 
knowledgeable when it comes to XML and SOAP, but I would like to know if my 
server is doing the correct thing, or is there a way in the code to turn on 
namespace prefixing for each XML element in the response? It does seem a bit 
strange that ns1 prefix is not used on returnErrorCode and authToken but it is 
used on item within authToken. I browsed through auto-generated web service 
code (built using WSDL2WS tool) and noticed that simple element types are not 
serialized with prefixes. On the client side I use Java 1.6, which comes in SE 
with XML/SOAP packages that Apache CXF uses. Of course, all is nice and dandy 
when using Apache Axis Java client.
 
Thanks in advance,

Sasha

Reply via email to