CAA Web Services Home |
|
Consuming the SORWebServicesImpl CAA Web ServiceGenerating a Shop Order Instance (SOI) with the SORWebServicesImpl CAA Web service |
Use Case |
AbstractThis article describes how to use the various services provided by DNBSORWebServices in Shop Order Release product. The technology used in this use case is based on Microsoft C#. |
This use case is intended to help you make your first steps in developing the client application to consume the various operations of DNBSORWebServices like Generation of Shop Order Instance (SOI), Get the list of Jobs that produces the given product, Update & Retrieve the Release table status. More specifically, you will learn:
This Use case explains the sample client program available in CAASORWS.edu\DNBSORWSCreateSOI.mj\src\IDNBSORWebServicesClient.cs.
[Top]
DNBSORWebServices basically provides five types of operations:
The following topics show you how to send the input details from a C# client to the web services.
Prerequisites:Before you start your web service client project, you MUST have generated the client proxy for the web service.
Setting Up a New Visual Studio Project Open Visual Studio 2005 (Start/All Programs/Microsoft Visual Studio 2005/Microsoft Visual Studio 2005)
Visual Studio initializes a new class that will be your client main.
The following descriptions explains the development of client application with the help of a sample program. Please refer the Program.cs file provided in the sample client.In this article, the flow of the program is explained only for generateSOI. The flow is almost same for all operations.
After entering the input xml, request type and other required details in the UI, and once the "Send Request" button is pressed, the input details are received by the function "requestSender" in the Program.cs file. The class properties like Root URI, Port no. and URL are set in this function.In the URL, service refers to the path of the implementation file with framework and module name where it resides. This should be mentioned as it is.
Then, based on the type of request, the input xml is sent to appropriate function. In this article, we shall consider the generateSOI operation. So, the input will be sent to callSOIgeneration.
Inside "callSOIGeneration", the input is sent to another function called getSOIInput which will parse the xml string for various details it contains, sets them in the SOIInput class and returns the object to "callSOIGeneration". SOIInput class itself refers to many other small classes inside that. Refer the sample code to see how the input details are stored in these classes.
Similar functions are written separately to parse the input of other operations. After setting the input details, an instance of the bindng class (IDNBSORWebServicesBinding) is created, its URL property is to be set, and the name of the web method (generateSOI) is called over the instance passing the object returned by getSOIInput as input parameter.
IDNBSORWebServiceBinding SORProxy = new IDNBSORWebServiceBinding();
SORProxy.Url = _Url;
retVal = SORProxy.generateSOI(soiInput);
where soiInput is the instance of SOIInput[] which contains the input details.
Depending on the operation which you are going to call, the input datatype will vary. For example,
For generateSOI & getSOIGenerationStatus, the input details are to be set in the instance of SOIInput()
For getJobList, the input details are to be set in the instance of JobOIDsInput()
For getReleaseTableStatus & setReleaseTableStatus, the input details are to be set in the instance of ReleaseTableInput()
All the datatypes mentioned above inturn have several userdefined datatypes within it. Please refer the sample C# client to gat a clear idea on how to instantiate and set the input details. The sample client is designed in the assumption that all the input details are given in the xml format through UI. The program will parse that xml and set the values appropriately.
The names of various web methods available in this web service can be obtained from the IDNBSORWebServices.wsdl file.
Please have a look at the wsdl file to know more about the input and output parameters of the web services.
Build and Run the application
After completion of the above task, build the application. You may get errors related to the "System" namespace. To solve this, add the reference through the menu Project->Add References..., select the "System.Web.Services" from the .NET tab.
Once the application is built successfully, an exe will be created in the bin directory of your client project.
This use case has explained how you can consume web services provided by DNBSORWebServices (such as generation of SOI, getting the list of Jobs, updating and retrieving the Release table status) using a C# client.
[Top]
Version: 1 [May 2007] | Document created |
[Top] |
Copyright © 1994-2006, Dassault Systèmes. All rights reserved.