In this tip, we are going to work with a web service that pulls weather information. To begin with, your server running SSIS must have internet access.
Sample Web Service - Global Weather
- Using your browser, open the http://www.webservicex.net/globalweather.asmx web service and click on the "GetWeather" link.
- Specify the City and the Country and press the "Invoke" button.
- You will be able to see weather information such as wind, temperature and other related information in an XML format.
Setting up SSIS package to call a web service
- Open SSDT or BIDS and create a new SSIS Project.
- Drag and drop the Web Service Task onto the Design pane.
- Double click on the Web Service Task and create a new HTTP connection.
- In the Server URL textbox, specify the web service address: "http://www.webservicex.net/globalweather.asmx?WSDL" and press the Test Connection button.
- Create an empty wsld file. For this example I created a file called mywsld in the "C:\Webservice" folder.
- In the WSDL File property specify the path of the file created in the step 5. Make sure that the OverwriteWSDLFile option is set to true and press the Download WSDL button.
- In the Input tab, specify the City and the Country. In this sample, we used New York and United States. Press OK.
- In the Output tab, in the File properties, select "New Connection".
- Select the "Create file" option in the Usage type.
- In the File textbox, specify the path of the file to store the results of the Web Service and press OK. This is the file where the XML data will be written to when the package is run and the web service is called.
- Run the SSIS project.
- Open the file created in the path specified in step 10 and you can see the XML output that was created from the web service.
No comments:
Post a Comment