Is it unusual for a web service call to have an "out" parameter? -


Is this unusual for the "out" parameter for a web service call? If so, why?

I am using the C # web service and the web site user will also be the C # app.

If you are referring to the parameter at the C # level in the ASP.Net Web service, then I It does not seem absolutely unusual. Your external parameter will only become the child element of the reaction element. Here is a small web service that has a web method in which the parameters are:

  [WebService (namespace = "http://begen.name/xml/namespace/2009/10/samplewebservicev1") ] Public class sample WebServiceV1: WebService {[WebMethod] Public Zero WebMethodWithOutParameters (String outParam1, String OutParam2 out) {OutParam1 = "Hello"; Outamparam 2 = "Web!"; }}  

With the above web method, SOAP requests look like this:

  POST / sample WebServiceV1.asmx HTTP / 1.1 host: Local Host Content -type: text / xml; Charset = utf-8 Content-Length: SOAPAction Length: "http://begen.name/xml/namespace/2009/10/samplewebservicev1/WebMethodWithOutParameters"  & Lt; / Soap: body & gt; & Lt; / Soap: Envelope & gt;  

And the response looks like this:

  HTTP / 1.1 200 OK content-type: text / xml; Charset = utf-8 Content-Length: Length & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; 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/"> & Lt; Soaps: Body & gt; & Lt; WebMethodWithOutParametersResponse xmlns = "http://begen.name/xml/namespace/2009/10/samplewebservicev1" & gt; & Lt; OutParam1 & gt; Hello & lt; / OutParam1 & gt; & Lt; OutParam2 & gt; Web & lt; / OutParam2 & gt; & Lt; / WebMethodWithOutParametersResponse & gt; & Lt; / Soap: body & gt; & Lt; / Soap: Envelope & gt;  

Note: This does not invalidate other answers to this question, because they were considering it at all web service levels, not the C # level.


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -