Adding a service reference to a WSDL file - HxGN EAM - 12.0 - Customization & Programming - Hexagon

HxGN EAM Web Services Toolkit Programmer Help

Search by Category
Customization & Programming
HxGN EAM Version

Adding a service referenceTo use a web service, the .NET project must add a service reference to the appropriate WSDL file. This section illustrates how to add a service reference in Visual Studio.

If it is required to transmit cookies to the server, it may be necessary to add a Web Reference instead of a Service Reference. Transmitting cookies is essential when the EAM server is hosted by HxGN, or when the server contains more than one JVM.

  1. Create a new project or open an existing project in Visual Studio.

  2. Choose Project | Add Service Reference. The system displays the Add Service Reference form.

  3. Address - Enter the full name of the WSDL file, including the path. This entry can either be a URL or a path to a file. to a WSDL file

    Since WSDL files reference the Schema files using relative paths, both folders must reside in a common parent folder, i.e., if the WSDL files reside in c:\WSToolKit\wsdl, then the schemas must reside in c:\WSToolkit\schemas.

  4. Click Go, and then wait while Visual Studio reads the WSDL file. Once it has finished reading the file, the system displays a list of the available methods on the Add Service Reference form.

  5. Namespace - Enter a namespace. This name will be the namespace of the web service, so each web service added should have a unique name.

    To match the sample applications and the documentation for the samples, HxGN recommends that the namespace start with WebServices and end with the function number of the WSDL. The function number includes the four digits preceded by MP in the name of the WSDL. For example, if adding MP0023_AddWorkOrder_001.wsdl, the namespace would be WebServices.MP0023.

  6. Click OK. Visual Studio creates the appropriate code and adds references to any required schema (.xsd) files.

  7. The project should now show a Service References section in the Visual Studio Solutions Explorer. It will also add a project reference to System.Web.Services namespace if it is not already there. The generated code will be in the Reference.vb file. To view the new objects added to the project, open the Class View tab.