简体   繁体   中英

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

I am very new to WCF. I want to send a SOAP request to a webservice and receive response from the same. The WSDL is: http://content.domain.com/ContentService?wsdl . I have added this wsdl to ServiceReference. What's next ?

SOAP request I need to build should be look like-

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

There will be a xml response to this request which I need to parse and get the values from it. How can I achieve this in c#?

Read the following article

//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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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