Qlik Community

Ask a Question

FinServ

Announcements
QlikWorld starts MONDAY! last chance to register is now ! REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
lms
Employee
Employee

Call a web service via SOAP, HTTP Get or HTTP Post

I recently needed to illustrate how QlikView can be used to call a web service via SOAP. I could not find anything on community that actually made a SOAP call, so I put together this proof of concept application.

I found a public web service on the web that can be called via a HTTP Get, HTTP Post or SOAP method and built this app to show how each can be done. In each case I have used vbscript and the XMLHTTP object to call the web service and get the XML back (ie. standard AJAX approach). The app fetches stock price data (plus a little more with the SOAP method) on the company that you select from the stock ticker list box. The app shows the data that is submitted and the data that is returned (generally an XML document) by each method. Simply select a stock ticker value from the list box and click on the relevant button to call each macro.

The web service used is http://www.webservicex.net/stockquote.asmx?op=GetQuote. If you navigate to this page in a web browser you will see how the web service documents the options for communicating with the service and the format of the data required to be sent and the fomat that will be received.

Please note that you must set module security to "Allow Any Macro" when prompted on opening the application.

29 Replies
alejo13qv
Contributor III
Contributor III

Hi Lee,

Sorry fo rmisstyping your name.

I appreciate you for sharing this material, I have the need to consume a webservice that post data internally in our company by sending specific requets, prior having logged to it.

I have VBScript code for session create,etc however since I'm not a programmer and it is failing in the qvw by "syntax error" I am stucked in how to determine why it fails.

Could you please guide me?

thanks,

Alejo.

alejo13qv
Contributor III
Contributor III

Hi Lee,

I appreciate you for sharing this material, I have the need to consume a webservice that post data internally in our company by sending specific requets, prior having logged to it.

I have VBScript code for session create,etc however since I'm not a programmer and it is failing in the qvw by "syntax error" I am stucked in how to determine why it fails.

Could you please guide me?

thanks,

Alejo.

lms
Employee
Employee
Author

Sorry Alejo. It would not be possible to debug it without access to your actual web service. I think you will need a programmer internally.

Lee Matthews

varunjain
Creator
Creator

Hi

I have a scenrio where in there is a qlikview attribute SECS_ID which a user would select and according to that input a SOAP web service is called and shows the information accordingly.

I have gone through your doc but bein a webservice/XML illiterate, i am not able to understand which fields are static and dynamic and what all things do I need to ask from the Webservice guy.

Please help!

Thanks!

lms
Employee
Employee
Author

Hi Varun

Ask your Web Service guys for a sample of the XML soap package that needs to be submitted to the web service. That is what you need to build in your QlikView macro.

Another option is, if you navigate to the webservice itself in a browser it will often be self describing. That is, the web service will detail what needs to be submitted and what the response will be. Try this one for example:  http://www.webservicex.net/stockquote.asmx?op=GetQuote Though this might depend on whether the web service developer has set this up (I am not a webservice expert myself).


I hope that helps.

varunjain
Creator
Creator

Thanks a lot Lee...

The webservice guy has given me a link and when i open that in a browser it gives me an XML code like

<?xml version="1.0" encoding="utf-8"
?>  <wsdl:definitions name="FetchSECSCustomerExport1_FetchSECSCustomerHttp_Service" targetNamespace="http://WS.In/FetchSECSCustomer/Binding" xmlns:soapenc="http://xyz/soap/encoding/"

I dont undertsand as in how to use these in the macro?

lms
Employee
Employee
Author

Varun. That is wsdl, which is web service definition language. I am not sure how to use that either. Perhaps ask him for a sample request and response, and send link I sent you as an example.

varunjain
Creator
Creator

Hi Lee,

When I open the link being provided by the webservices team, I get a whole bunch of code(wsdl).

Just wanted to know if the code which opens up when we click on the link is WHAT we need to send to the webservice in qlikview through MAcro?

lms
Employee
Employee
Author

I am sure wsdl is useful in some way, but I am not sure how to interpret it. I have looked up wsdl explanations online in the past but have found the documentation not very enlightening so far.

varunjain
Creator
Creator

There is an existing JAR file which usually invokes the webservice. Is there a way if I can activate that JAr file in qlikview on a clik of a button?