当前位置: 动力学知识库 > 问答 > 编程问答 >

iphone - Post XML String in SOAP message

问题描述:

I want some help friends,

I want to Post XML string in SOAP message in iOS sdk.

Is it possible to do this?

If yes, Please give me some sample code for that. otherwise advice me alternative way to do this.

Please help me to come out from this problem.

Thanks in advance.

Code:

<?xml version="1.0" encoding="utf-8"?>

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

<soap:Body>

<postCourseUsage xmlns="http://tempuri.org/">

<xml><?xml version="1.0"?><CU><ULID>admin</ULID><CID>myOwn</CID><CURS><CUR><CN>Home</CN><USG><CUSG>2</CUSG><SD>12-Jul-2011 12:41:42</SD></USG></CUR></CURS></CU></xml>

</postCourseUsage>

</soap:Body>

</soap:Envelope>

网友答案:

I got my answer.

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<postCourseUsage xmlns="http://tempuri.org/">
<xml>&lt;?xml version="1.0"?&gt;&lt;CU&gt;&lt;ULID&gt;admin&lt;/ULID&gt;&lt;CID&gt;myOwn&lt;/CID&gt;&lt;CURS&gt;&lt;CUR&gt;&lt;CN&gt;Home&lt;/CN&gt;&lt;USG&gt;&lt;CUSG&gt;2&lt;/CUSG&gt;&lt;SD&gt;12-Jul-2011 12:41:42&lt;/SD&gt;&lt;/USG&gt;&lt;/CUR&gt;&lt;/CURS&gt;&lt;/CU&gt;</xml>
</postCourseUsage>
</soap:Body>
</soap:Envelope>

Using this code i can pass xml string as argument in soap message and on the server side it will interprete it as XML.

分享给朋友:
您可能感兴趣的文章:
随机阅读: