ws-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Janardhanan, Suresh B" <>
Subject RE: Axis client - adding CDATA XML string to request
Date Tue, 24 Jan 2012 15:07:44 GMT

Thank you very much for your suggestion. Yes, if I pass just the XML without the CDATA Begin
and End Tag the .Net web service comes back with a valid response.

I am not sure why that's the case. The reason the .Net web service has CDATA Begin and End
tag wrapped around the XML is to treat it as a string value, even if It is not a well-formed
XML. I am working on testing this solution against all the WSDL Operations and check if works

Thanks again for your direction.



I generated my web services client using Apache Axis v2.1.6.1. The .Net target web service
has the following in its WSDL -

<wsdl:part name="sXmlParameters" type="s:string" />

I am expected to set the following string for sXmlParameters.

When it is sent through Apache Axis client, the XML characters <, > are getting converted
[main] DEBUG httpclient.wire.content  - >> "<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope

Is there any way to send the XML string as is?

I also tried changing the WSDL type, which resulted in an Exception.

This is what I changed in the WSDL - changed sXmlParameters type=s:string to xmlStingType
as shown below.
            <xsd:schema xmlns:xsd=""
                  <xsd:complexType name="xmlStringType">
                              <xsd:any xmlns:xsd=""/>
<wsdl:part name="sXmlParameters" type="tns:xmlStringType" />

Code Snippet:
XmlStringType xmlStrType = new XmlStringType();
      OMElement element = AXIOMUtil.stringToOM(xmlParameters);

Stack Trace:
Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected
character 'C' (code 67) (CDATA not allowed in prolog/epilog)
at [row,col {unknown-source}]: [1,3]
  Stack Trace:

Any help is much appreciated.


View raw message