I have been given a WSDL with all the method requests and responses, and all the objects I’ll need to use for creating a few web methods.
I’ve successfully added the WSDL as a “service reference” and I can see the methods and structures and can instantiate them. It all seems to be there. But, I have a problem: the project won’t build after I add the WSDL. Here’s the error message I am getting when Visual Studio tries to compile Reference.cs:
“Error 2 The type name ‘ServiceReference1’ does not exist in the type
‘WSPELab.WSPELab’ C:\Users\JJ\Documents\Visual Studio
2008\Projects\WSPELab\WSPELab\Service
References\ServiceReference1\Reference.cs 21 111 WSPELabSLN
Is it possible that I am receiving this error message because of a namespace error on my part?
Finally, one additional question: With the WSDL added, can I use the structures it contains directly? Or are they just “listings” for me to implement?
A WSDL is a machine-readable file that describes the methods and types exposed by a web service. Many IDEs, including Eclipse and Visual Studio, can import these and create programming language classes that match the definitions given in the WSDL.
For example, importing a WSDL in a Visual Studio C# project will create a
Reference.csfile that contains these definitions. You have to instantiate and call these definitions the same as you do for any classes.Giving any more detail would require showing us the actual WSDL.