pmorelli92/SoapHttpClient

How to specify method name?

Closed this issue · 1 comments

Hi,

I want to call web service which expect following:

POST ... HTTP/1.1
Host: ...
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "..."

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope ...>
  <soap:Body>
    <METHOD_NAME xmlns="...">
      <requestData />
    </METHOD_NAME >
  </soap:Body>
</soap:Envelope>

How to tell SoapHttpClient about METHOD_NAME?

This library is expecting an XML which will end up being wrapped inside the <soap:Body> so that functionality you want to achieve is doable with XElement:

var body = new XElement("methodName", new XElement("requestData"));
Console.Write(body);