簡體   English   中英

如何將XML作為字符串發送到Soap Action?

[英]How to send XML as String to Soap Action?

我有肥皂動作

<?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>
<From_Iphone xmlns="http://tempuri.org/">
<MessageText>string</MessageText>
<user_id>int</user_id>
<patientID>int</patientID>
<ReplyToMsgId>int</ReplyToMsgId>
<UserContacts>string</UserContacts>
</From_Iphone>
</soap:Body>
</soap:Envelope>

在此我想發送

 MessageText =@"Testing";
patientID= 10;
user_id= 20;
ReplyToMsgId=1;
UserContacts = @"< Contacts > < Contact >< id > 5 < /id > < name > Kiran< /name > < gr_id >11 < /gr_id> < /Contact> < Contact>< id>8< /id> < name>najeer< /name>< gr_id>25< /gr_id>< /Contact>< /Contacts>";

我將UserContacts作為字符串傳遞,但是我無法訪問服務器。 請給我一個將XML作為String傳遞的解決方案。謝謝。

您必須為此使用標簽。 在標簽中,您必須放入您的xmlstring。 之間的字符串將不會被解析。 我認為您的問題將得到解決。

http://www.w3schools.com/xml/xml_cdata.asp

休假上面的鏈接,它將幫助您

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM