webMethods Microsoft Package 9.0 | webMethods Package for Microsoft .NET Documentation | webMethods Package for Microsoft .NET Client API Programmer’s Documentation | Invoking a Service using Visual Studio | Generating a C# Client Code in Visual Studio
 
Generating a C# Client Code in Visual Studio
 
List Packages to be Used (Generated Code)
Class Declaration (Generated Code)
Connect to Integration Server (Generated Code)
Populate the Service Inputs (Generated Code)
Invoke the Service and Retrieve the Output (Generated Code)
Disconnect from Integration Server (Generated Code)
Using the webMethods add-in for Microsoft Visual Studio, you can connect to a running Integration Server and generate an object from an integration service. This sample uses the concat service.
*To create a C# file from the concat service
1. Open Visual Studio .NET.
2. Open a new .NET project using the Console Application template.
3. On the Tools menu, click webMethods add-in for Microsoft Visual Studio.
Note:
If this menu item is not visible, make sure you have installed the add-in. For information on installing the add-in, see the webMethods Package for Microsoft .NET Installation and User's Guide .
4. In the webMethods add-in for Microsoft Visual Studio dialog box, provide the following information about the instance of Integration Server to which to connect:
In this field...
Type this...
webMethods Integration Server
Integration Server host name and port in the format host:port.
UserID
Name of a valid user account on this Integration Server.
Password
Password for the user account. Passwords are case-sensitive.
5. Click Connect. The webMethods add-in for Microsoft Visual Studio window is displayed. This window contains a tree view of packages and services on the Integration Server to which you are connected.
Tip:
The add-in opens as a floating window. You can dock the window by dragging it to the Visual Studio .NET toolbar.
6. In the Solution Explorer, select the Project under which you want to create the C# client code. If the Solution Explorer is not already open, in the View menu, click Solution Explorer.
7. In the tree view of packages, go to the WmPublic.pub.string:concat service.
8. Right-click the concat service and, click Generate Code, and then click C# Code.
9. If the Solution Explorer is not already open, in the View menu, click Solution Explorer. The concat.cs file should be visible in the Solution Explorer panel.
10. Add the references by doing the following:
a. In the Solution Explorer panel, right-click the References node, and then click Add Reference.
b. Click Browse tab and go to the default add-in directory for Visual Studio, where the webMethods Add-In for Microsoft Visual Studio is installed.
Typically, the webMethods Add-In for Microsoft Visual Studio is installed in the directory C:\Documents and Settings\All Users\Application Data\Microsoft\MSEnvShared\Addins\
c. Select CGUTIL.dll and wmClientAPI.dll.
d. Click OK. The two DLLs should now appear under the References node in the Solution Explorer panel.
The following sections provide brief descriptions of the sample code as they relate to Generating Microsoft .NET Clients:
* List Packages to be Used (Generated Code)
* Class Declaration (Generated Code)
* Connect to Integration Server (Generated Code)
* Invoke the Service and Retrieve the Output (Generated Code)
* Disconnect from Integration Server (Generated Code)
You can find the complete code sample in Complete Generated Code Sample.