Standards for Technology in Automotive Retail
Procedure 5.1. Generating Web Service Class code from STAR WSDL
Retrieve WSDL from Star Schema Repository and extract the StarTransport_2005.wsdl file.
Open Visual Studio 2003 command prompt.
Run wsdl.exe against the extracted WSDL file. By default WSDL generated codes are generated in C# language. You can optionally specify the target language to ‘VB’ (Visual Basic) by using the /language parameter. Make sure to execute this command where you have extracted the STAR WSDL.
wsdl startransport_2005.wsdl /language:VB
Procedure 5.2. Creating the ASP.Net Web Service
Open up the Visual Studio .Net 2003 and create a new ASP.Net Web Service Project.
Rename the Service1.asmx file to StarWebService.asmx.
Copy contents of generated GenericWebService.vb to the code behind of your new web service page.
Rename the Class name to StarWebService
Set the URL in the class constructor to the actual URL of the web service.
Add a WebMethod attribute for each of the STAR WebMethods.
Replace the ProcessMessage function’s code with the following line:
Insert the following function anywhere inside the class code.
Modify the ASMX file to refence the StarWebService Class.
Compile the code and run. You should now have a web service that has all three STAR Methods.
In this section, we will be creating a windows form application that calls the Web Service’s ProcessMessage method.
Procedure 5.3. Creating Web Service Client
Create a new windows application project.
Create a Windows form that has the following layout:
Add a web reference to the star web service you’ve previously created.
Create a function that would process the request BOD.
Recompile the Client Code.
Procedure 5.4. Running the Client and Web Service Code
Run the windows application code and copy any STAR BOD examples from the Repository's example folder to the Input BOD text box.
Click on the Submit button and examine the output BOD and Content IDs in the Diagnostic Textbox.