繁体   English   中英

如何借助WSDL创建和发送SOAP请求并接收SOAP响应?

[英]How to create and send a SOAP request with the help of WSDL and receive SOAP response?

我是WCF的新手。 我想将SOAP请求发送到Web服务,并从Web服务接收响应。 WSDL是: http : //content.domain.com/ContentService?wsdl 我已将此wsdl添加到ServiceReference。 下一步是什么 ?

我需要构建的SOAP请求应该看起来像-

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"xmlns:con="http://content.domain.com" xmlns:api="http://api.content.domain.com">
<soapenv:Header />
<soapenv:Body>
<con:get1>
<con:in0>
<api:AID>89575</api:AID>
<api:clientLoginID>abc</api:clientLoginID>
<api:domain>en</api:domain>
</con:in0>
</con:get1>
</soapenv:Body>
</soapenv:Envelope>

我需要解析该请求的xml响应并从中获取值。 如何在C#中实现呢?

阅读以下文章

//Step 1: Create an instance of the WCF proxy.
CalculatorClient client = new CalculatorClient();

// Step 2: Call the service operations.
// Call the Add service operation.
double value1 = 100.00D;
double value2 = 15.99D;
double result = client.Add(value1, value2);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM