开发者

Accepting SOAP input as parameter in webservice

I have a webservice method which needs to accept SOAP as input parameter. I've worked webservices between .NET clients but I've never worked using raw SOAP so I don't know what to do. The format of the input like this:

<?xml version="1.0" encoding="utf-8"?>
<S:Envelope xmlns:S = "http://schemas.xmlsoap.org/soap/envelope/">
    <S:Body>
        <ns2:RemoteService xmlns:ns2 = "some.ns.url">
            <RemoteServiceInput>
                <param1>123</param1>
                <param2>Asd Qwe</param2>
                <param3 xsi:nil = "true" xmln开发者_如何学JAVAs:xsi = "http://www.w3.org/2001/XMLSchema-instance"/>
            </RemoteServiceInput>
        </ns2:RemoteService >
    </S:Body>
</S:Envelope>

How should my method input be to accept this SOAP as parameter?

I'm using ASP.NET web services not WCF.


You can create a WebMethod that accepts an XElement as parameter (SOAP at the end of the day is XML):

[WebMethod]
public mySoapMethod(XElement soapMessage)
{
    //here you can parse your soap message
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜