2013-10-16 24 views
0

如何在SOAP xml Web服務中傳遞字符串。我的字符串包含HTML格式。當我點擊提交XML給我輸出,但我無法檢索數據。而不是字符串(不是HTML),我得到了完美的迴應。我的代碼是,如何發送字符串包含HTML到SOAP XML?

string = @"<table class=\"\" style=\"width: 100%;\" cellspacing=\"0\" cellpadding=\"0\">" 
"  <tr>" 
"<td bgcolor=\"#7ea34b\" height=\"88\" style=\"padding-left: 10px; font-weight: bold; font-size: 10pt;color: #ffffff; font-family: Verdana\" align=\"center\">" 
"Book Your New Car @ <a href=\"http://www.test.com/\">www.test.com</a>" 
"or Call 123456789 <br />" 
"<a href=\"http://www.test.com//unsubscribe.aspx?email=" 
"\">Click Here</a>" 
"to Unsubscribe from this List" "</td></tr>" 
"</table> </table>"; 

感謝您的任何幫助。

回答

2

你需要用的HTML中<![CDATA[ ... ]]>所以string看起來是這樣的:

string = @"<![CDATA[<table class=\"\" style=\"width: 100%;\" cellspacing=\"0\" cellpadding=\"0\">" 
"  <tr>" 
"<td bgcolor=\"#7ea34b\" height=\"88\" style=\"padding-left: 10px; font-weight: bold; font-size: 10pt;color: #ffffff; font-family: Verdana\" align=\"center\">" 
"Book Your New Car @ <a href=\"http://www.test.com/\">www.test.com</a>" 
"or Call 1-888-284-4718<br />" 
"<a href=\"http://www.test.com//unsubscribe.aspx?email=" 
"\">Click Here</a>" 
"to Unsubscribe from this List" "</td></tr>" 
"</table> </table>]]>"; 
0

你可以編碼爲Base64客戶端上的字符串,然後它在服務器端進行解碼。這樣你就不用擔心報價。