0

如何在 SOAP xml Web 服务中传递字符串。我的字符串包含 HTML 格式。当我点击提交 xml 给我输出,但我无法检索数据。我得到了完美的响应,而不是字符串(不是 HTML)。我的代码是,

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>";

谢谢你的帮助。

4

2 回答 2

6

您需要将 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>]]>";
于 2013-10-16T10:35:31.297 回答
0

您可以在客户端将字符串编码为base64,然后在服务器端对其进行解码。这样您就不必担心报价。

于 2016-08-25T11:08:45.973 回答