In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how the functions provided by the .asmx processor automatically generate WSDL. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
Automatically generate WSDL
After you have written and deployed WebMethod, the client needs to know exactly what the SOAP message must look like in order to communicate successfully with it. The standard way to provide Web service descriptions is through WSDL (and embedded XSD definitions). To help adapt to this situation, the. asmx processor automatically generates readable document pages and WSDL definitions that accurately reflect the WebMethod interface If you apply many mapping attributes to WebMethod, they are all reflected in the generated document.
If you browse the .asmx file, you will see a human-readable document page as shown in figure 2. This document page is generated by an .aspx page named DefaultWsdlHelpGenerator.aspx (located at C:\ windows\ Microsoft.NET\ Framework\ v1.0.3705\ config). If you open this file, you will find that this is just a standard ASP.NET page that uses .NET reflection to generate documents. This feature allows your documents to always be synchronized with your code. You only need to modify this file to customize the generated document.
You can also avoid generating documents in virtual directories by specifying a different document file in the Web.config file:
< configuration> < system.web> < webServices> < wsdlHelpGenerator href="MyDocumentation.aspx"/> < /webServices>...
If the client makes a GET request to the .asmx endpoint and there is a "? wsdl" in the query string, the .asmx processor generates the WSDL definition instead of a document that can be read manually. Clients can use WSDL definitions to generate proxy classes that automatically learn how to communicate with Web services (for example, using Wsdl.exe in .NET).
Automatically generate WSDL: customize the process
To customize the WSDL generation process, you can write a SoapExtensionReflector class and register it with the WebMethod framework in the Web.config file. Then, when the .asmx processor generates the WSDL definition, it invokes the reflector class and gives you the opportunity to customize the final definition provided to the client. For more information about how to write the SoapExtensionReflector class, see SoapExtensionReflectors in ASP.NET Web Services.
You can also use two different methods to skip the WSDL generation process altogether. * one way is to provide a static WSDL document that can be accessed by the client in the virtual directory, and then disable it by removing the document generator from the Web.config file, as follows:
< configuration> < system.web> < webServices> < protocols> < remove name="Documentation"/> < /protocols>...
Another method that is slightly more automated is to use the [WebServicesBinding] attribute to specify the location of static WSDL documents implemented by the WebMethod class in the virtual directory. You must also use the [SoapDocumentMethod] attribute to specify a name for the WSDL binding for each WebMethod implementation. After doing so, the WSDL automatic generation process imports a static WSDL file and wraps a new service description around it.
Currently, because there are not many WSDL editors available, it is extremely difficult to write WSDL by hand. As a result, automatic document / WSDL generation is a valuable part of the WebMethod framework, and life would be difficult for many developers without it.
On the functions provided by the .asmx processor how to automatically generate WSDL to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.