ASMX WebMethod Web Service Parameter Description

This seems like a simple question, but I could not find the answer online through many Google searches. I have a C # web service, and when I visit its ASMX page in a browser, for a particular method, it always has the following:

β€œThe following is an example of a SOA 1.1 request and response. The placeholders shown should be replaced with actual values.

Similarly for SOAP 1.2 and HTTP POST. What I want to know is how I replace the placeholders shown, for example:

<myParameter>string</myParameter> 

Where "string" is a placeholder. And in response:

 <xsd:schema>schema</xsd:schema>xml 

Where "schema" and "xml" are placeholders. I am using another web service in which these placeholders are filled with examples of parameter values ​​and responses, and I would also like to define such examples for my own web methods. I was able to describe the whole method as follows:

 [WebMethod(Description="Does awesome things.")] 

But I did not find such a thing for the individual parameters of the web method.

+6
c # web-services documentation asmx
source share
3 answers

By default, DefaultWsdlHelpGenerator.aspx is called to create the help page. You can install another (or modified) template using the wsdlHelpGenerator Element in the web.config file.

+4
source share

Why do you need this? This page that you see in the browser when you click on your asmx just gives sample requests and reponses. If you want to get data using these examples, replace the placholder values ​​in the request with what you request from the service, and POST to it ...

Edit: I mean, if you really need to replace these placholder values, write the code in your service to determine when someone does GET (implies viewing from the browser), and plays with the answer, changing the placeholder values ​​to everything you need necessary.

0
source share

You cannot do this. If the help page (which is what you are describing) does not have an input field for a specific parameter, then he does not know how to do this.

You should not pay too much attention to these pages in any way. They are leaving with WCF.

In any case, they were never very useful, with the exception of the simplest web services. It was a way to get people to play the web service at the beginning, when there were no tools to help you test the web service. Use soapUI instead .


BTW, also see Microsoft: ASMX web services are β€œLegacy technologies,” so it makes sense to ignore only ASMX pages.

0
source share

All Articles