[WebService(Namespace = "http://adventureworksSystem.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
public Service () {
//如果使用设计的组件,请取消注释以下行
//InitializeComponent();
}
[WebMethod]
public string GetProducts(string MaxAmount)
{
return MaxAmount + "abcd";
}
}
这是webserver 数据挖掘研究院
<?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>
<GetProducts xmlns="http://adventureworksSystem.com/">
<MaxAmount> gggg </MaxAmount>
</GetProducts>
</soap:Body>
</soap:Envelope>
这是发送部分
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 数据挖掘实验室
<soap:Body>
<GetProductsResponse xmlns="http://adventureworksSystem.com/">
<GetProductsResult> abcd </GetProductsResult>
</GetProductsResponse>
</soap:Body>
</soap:Envelope>
这是接收到的部分
小弟刚学,请大牛指点,谢谢
post过去之后,soap接口返回什么,先确定是发送格式问题,还是接收的问题
可以试试把发送的XML换成SOAP 1.2的格式返回的就是
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body> 数据挖掘交友
<GetProductsResponse xmlns="http://adventureworksSystem.com/">
<GetProductsResult> abcd </GetProductsResult>
</GetProductsResponse>
</soap:Body>
</soap:Envelope>
如果返回的是下面这个就对了
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetProductsResponse xmlns="http://adventureworksSystem.com/">
<GetProductsResult> ggggabcd </GetProductsResult>
</GetProductsResponse>
</soap:Body>
</soap:Envelope>
所以因该是接收的问题吧Create By Any-Extract(WL-AE)