WebService取不到数据
客户端他们发送过来的数据是这样的:
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:http="http://schemas.xmlsoap.org/soap/http">
<soapenv:Header/>
<soapenv:Body>
<http:post>
<!--Optional:-->
<data>aaaaaaaaaaaaaaa</data>
</http:post>
</soapenv:Body>
</soapenv:Envelope>
我在服务端代码是这么些的:
[WebService(Namespace = "http://schemas.xmlsoap.org/soap/http")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
public class WebService : System.Web.Services.WebService
{
[WebMethod]
public String post(String data)
{
××××××
}
}
但是,我每次取到的 "data" 都是null
客户端的数据我改不了,我只能改服务端代码,不知道应该怎么写?