To
Do this
Create a class that acts as a Web service.
Create an ASP.NET Web service project. You can also add the WebServiceAttribute to the class definition to specify a namespace and description for the service. For example:
[WebServiceAttribute] class MyClass {...};
Add the WebMethod attribute to the member functions that you want your Web service to expose. For example:
[WebMethod] String* GetMyName() {...}
Create a class that acts as a Web service and gives access to the standard ASP.NET objects.
Create a managed C++ class that inherits from System::Web::Services::WebService.
Add a description to a Web service class or a Web method.
Add a Description attribute to the WebServiceAttribute or WebMethod attribute. For example:
[WebServiceAttribute (Description= "My Service")] class MyClass {...};
Provide a unique identifier for your Web service.
Use the Namespace attribute on the WebServiceAttribute for the Web service class to define a unique namespace URL. For example:
[WebServiceAttribute (Namespace= "")] class MyClass {...};
Use a Web service from managed C++ code.
Add a Web reference to the project by choosing Add Web Reference on the Project menu or by right-clicking the project name in Solution Explorer and selecting Add Web Reference.
Debug a Web service.
Build and install a debug version of the project. Place a breakpoint in the code, and then press F5 to execute the code under the debugger. An Internet Explorer window will be displayed for you to interact with the service, and you will be returned to the Visual Studio .NET environment when the breakpoint in the code is hit.
Create a proxy to a Web service when you’re not using Visual Studio .NET.
Use the wsdl.exe tool from the .NET Framework SDK to create a proxy from the WSDL description of the service, and then compile the code into a proxy DLL.