Passing NSString argument to SOAP WS yields "Illegal processing instruction target ("xml")"

Go To StackoverFlow.com

1

I am invoking the WS using SudzC generated code:

[service createPendingSalesOrders:self action:@selector(handler:) arg0: 
 @"<?xml version='1.0'"
 " encoding='utf-8'?>"
 "<root>test</root>"];

The soap request is:

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope   
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:com="http://com/">
      <soapenv:Body>
           <com:createPendingSalesOrders>
                <arg0>"<?xml version='1.0' encoding='utf-8'?><root>test</root>"
                </arg0>          
           </com:createPendingSalesOrders>
      </soapenv:Body>
 </soapenv:Envelope>

I am receiving:

[com.ctc.wstx.exc.WstxParsingException: Illegal processing instruction target ("xml"); xml (case insensitive) is reserved by the specs.

from my WS running on glassfish.

The WS works with other XML strings that seem to contain the same PI.

Thanks for any insight, Dane

2012-04-04 19:27
by Danedo
please look at this also http://stackoverflow.com/questions/15448791/how-can-i-access-this-message-in-fault-sequence-in-wso2-es - Faisal 2013-03-18 08:14


0

If you insist on wrapping xml into xml, put the contents into CDATA section, so the parser would process it as a string.

2012-04-06 12:38
by pdudits
Ads