One of the common questions I usually get asked is how to determine what value goes in where in the Remote Data Query node. Instead of getting into the technical details of the web service or the wsdl, I’ll share a quick technique which will aid you with what you need to know. My tool of choice is usually SOAP UI which is probably bit too heavy for most users so feel free to use any light weight alternative which can give you similar results.
If you would like to use SOAP UI, then you can get it here. Grab the standalone version so that you have everything you need in one package.
Once you have downloaded and extracted the zip archive, launch the application and create a new project.Type in the location of the wsdl file and the project name will get automatically populated. Leave the ‘Create Requests’ option enabled.
Click the ‘OK’ button and the requests for all the web methods available to us will get created. In our example, lets chose the method ‘GetCityWeatherByZIP’ which takes in the ZIP code as the input. Do a quick test to ensure everything is working by putting in your ZIP code and hit the green arrow to execute. Your Request/Response window will look similar to below:
Now, to get the data that is of interest to us, click on the ‘Raw’ tab and you will be presented with the following:
We need to know the location of the web service, the action and xml request that we have to send.
The location is determined by looking at the POST header i.e http://wsf.cdyne.com/WeatherWS/weather.asmx
The Action is : http://ws.cdyne.com/WeatherWS/GetCityWeatherByZIP as shown in the SOAPAction header.
And the xml input is :
<!--?xml version="1.0" encoding="utf-8"?--> <!--Optional:--> 55416
One thing you will notice is the string
<!--?xml version="1.0" encoding="utf-8"?-->
is missing in your request that got created. We need to add that in our XML input so that CIC can determine what encoding to use in the request. Let’s walk through another example. This time, web services build on the java platform:
The WSDL for our web service is http://soaptest.parasoft.com/calculator.wsdl.It is a simple service which will perform some basic math functions. As above, we create a new project and this time we chose to use the ‘Add’ method.
Our raw data for the request is as follows:
POST http://ws1.parasoft.com/glue/calculator HTTP/1.1 Accept-Encoding: gzip,deflate Content-Type: text/xml;charset=UTF-8 SOAPAction: "add" User-Agent: Jakarta Commons-HttpClient/3.1 Host: ws1.parasoft.com Content-Length: 302
Location is simple, we get that from the POST but what about the action, well, our action will be just ‘add’. There is no need to put the full URL for the action.
To finish this post off, here are some tips when using the Remote Data Query node in Attendant
- The response we receive has to be a simple type. If we get for example, multiple cities returned and each city has the weather details within it, then attendant will not be able to bind that data.
- Assign the URL to an attribute that can be placed at the beginning of your profile. This way, you can easily switch between your prod and dev web service instead of going through each RDQ node and making the change there.
- Always test your web service using a tool like SOAP UI first to ensure that you understand what your input and output response will look like. Armed with this info, you will be able to troubleshoot with ease and also determine if the issue is CIC related or with something with the web service.
- Make good use of the ‘logging’ node to log the attribute values returned from web service. It’s much easier to look at the properties of the call and follow the call log then look at the IP logs to determine what’s happening.
- Use the string filter ‘SOAPHTTPRequest()’ in the IP Logs to get a clearer picture of what we are sending and receiving to and from the web service.