PRB: The Proxy Class Has the First "out" Parameter of a Web Service Method That Returns "void" as a Return Value When You Add a Web Reference (322624)
The information in this article applies to:
- Microsoft Web Services (included with the .NET Framework 1.1)
- Microsoft Web Services (included with the .NET Framework) 1.0
This article was previously published under Q322624 SYMPTOMSYou can create a Web service that contains a Web service
method that has at least one out parameter and that returns void. When you add a Web reference to this Web service, Microsoft
Visual Studio .NET creates a proxy class with the first out parameter of the Web service method as a return
value.CAUSEWhen you add a Web reference to a Web service, Visual Studio
.NET internally runs the Web Services Discovery Tool (Disco.exe) to generate
the corresponding Web Services Description Language (WSDL) code. Next, Visual
Studio .NET internally runs the Web Services Description Language Tool
(Wsdl.exe) to create a proxy class.
WSDL does not
differentiate between a return value for a Web service method and an out parameter for a Web service method. Therefore, when Disco.exe
generates the WSDL code for a Web service method that has a return value, the
code has a WebMethodNameResponse element that contains a child element. The child element that
the WebMethodNameResponse element contains corresponds to the return value. Similarly, when
Disco.exe generates WSDL code for a Web service method that has an out parameter, the code has a WebMethodNameResponse element that contains a child element. The child element that
the WebMethodNameResponse element contains corresponds to the out parameter. This behavior occurs regardless of whether the Web
service method has a return value.
Note WebMethodName is a placeholder for the
name of your Web service method. For example, if the name of your Web service
method is MyWebMethod, the WSDL code that Disco.exe generates
has a MyWebMethodResponse element.
When Wsdl.exe creates the proxy class that
corresponds to your Web service method, Wsdl.exe assumes that the first child
element corresponds to the Web service method's return value. Therefore,
when you add a Web reference to a Web service that contains a Web service
method and the Web service method has at least one out parameter and returns void,
the problem described in the "Symptoms" section of this article
occurs.
Note The WSDL code that Disco.exe generates may also have WebMethodNameResponse elements that contain child elements. The child elements that the WebMethodNameResponse elements contain may correspond to ref parameters. However, because WSDL differentiates between out parameters and ref parameters, Disco.exe generates additional code for ref parameters. Therefore, the problem discussed in this article does
not apply to ref parameters.STATUS This
behavior is by design.REFERENCESFor more information, visit the following Microsoft Web
sites:
Modification Type: | Major | Last Reviewed: | 9/29/2003 |
---|
Keywords: | kbXML kbIDEProject kbDiscovery kbMiscTools kbProxyDev kbWebServices kbClient kbProgramming kbprb KB322624 kbAudDeveloper |
---|
|