Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
elkhounds
Creator
Creator

tSOAP issue

I need to create a SOAP API in Talend to Host Analytics to call a method via a Web service.

This is my first exposure to SOAP APIs, so please bear with me. Host Analytics is a cloud-based EPM. The SOAP API needs to call a Clear_Data method to simply clear the contents of a table stored on the host. I have contacted their technical support, but so far nothing they suggest has worked.

 

Please see the attached snip.

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

OK, I can see one problem that you definitely have. The tSoap's message field is meant to be a Java String. This makes it really useful if the XML needs to be dynamic. However, when writing a Java String you have certain rules regarding different characters. You are struggling with quotes here ("). An easy way of sorting this problem is to build your XML and use this tool (https://www.freeformatter.com/java-dotnet-escape.html) to escape the troublesome characters. Then, take whatever it returns, paste it into the tSoap's message field and then add a " before the first character and at the very end. This will give you a perfectly formatted Java String representing the XML you wish to use. 

 

Test that and see where it gets you. You may still have an error, but it will be a different one.

View solution in original post

10 Replies
Anonymous
Not applicable

You will need to give us more information. I have looked at the WSDL and what you are sending looks reasonable. However it does look like it should be SOAP 1.2 rather than SOAP 1.1. 

 

Does what you send return anything? If so, what? 

elkhounds
Creator
Creator
Author

Thanks for responding,

 

Attached files show the current tSOAP component configuration (with SOAP 1.2) and the returned error.

I am tasked to create Talend jobs to send SOAP API requests to Host Analytics (cloud based EPM that stores our finance data,etc) for clearing (deleting table data at HA) and loading data (exporting our DW data to HA via Talend). 

 

I worked with HA support and we were able to successfully run the ClearDataWithLogin HA API via Boomrang & Postman tools, using the SOAP message included in the tSOAP component. HA support believes it is not working in Talend because of syntax issues, hence the reason why I have made this request to Talend Community. 

 

Ray

 


Capture44444.PNG
Capture55555.PNG
Anonymous
Not applicable

OK, I can see one problem that you definitely have. The tSoap's message field is meant to be a Java String. This makes it really useful if the XML needs to be dynamic. However, when writing a Java String you have certain rules regarding different characters. You are struggling with quotes here ("). An easy way of sorting this problem is to build your XML and use this tool (https://www.freeformatter.com/java-dotnet-escape.html) to escape the troublesome characters. Then, take whatever it returns, paste it into the tSoap's message field and then add a " before the first character and at the very end. This will give you a perfectly formatted Java String representing the XML you wish to use. 

 

Test that and see where it gets you. You may still have an error, but it will be a different one.

elkhounds
Creator
Creator
Author

Thanks, it worked!

 

And you are also right about getting a different error (or is it an error?):

 

Starting job haTest at 15:33 18/07/2019.

[statistics] connecting to socket on port 4074
[statistics] connected
.------+----+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------.
| tLogRow_6 |
|=-----+----+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------=|
|Header|Body|Fault |
|=-----+----+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------=|
|null |null|<soap:Fault xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>soap:Client</faultcode><faultstring>Server did not recognize the value of HTTP Header SOAPAction: http://www.HostAnalytics.com/API/SOAP/StateFree/Common/2009/03/19/ClearDataWithLogin/&gt;.</faultstr... /></soap:Fault>|
'------+----+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'

[statistics] disconnected
Job haTest ended at 15:33 18/07/2019. [exit code=0]

 

I'm close, but how do you interpret this response? The header and body columns both return null. Is this the problem, perhaps?

 

Thanks Ray

Anonymous
Not applicable

Take a look at your SOAP Action. I missed this before as your other issue was more obvious to me 🙂

 

Your SOAP Action is this in your screenshot....

"http://www.HostAnalytics.com/API/SOAP/StateFree/Common/2009/03/19/ClearDataWithLogin/>"

.....you need to remove the "/>" at the end to leave this....

"http://www.HostAnalytics.com/API/SOAP/StateFree/Common/2009/03/19/ClearDataWithLogin"
elkhounds
Creator
Creator
Author

Greetings,

 

I made the change, but see the attached file for the returned errors.

Thanks Ray


Capturettt.PNG
elkhounds
Creator
Creator
Author

Here are the two files...


Capturett.PNG
Capturettt.PNG
elkhounds
Creator
Creator
Author

I switched from SOAP 1.2 to 1.1 and it succeeded:

 

Starting job haTest at 09:40 19/07/2019.

[statistics] connecting to socket on port 4042
[statistics] connected
.------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----.
| tLogRow_6 |
|=-----+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----=|
|Header|Body |Fault|
|=-----+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----=|
|null |<ClearDataWithLoginResponse xmlns="http://www.HostAnalytics.com/API/SOAP/StateFree/Common/2009/03/19"><ClearDataWithLoginResult><Code /><Success>true</Success><message>Data cleared successfully</message></ClearDataWithLoginResult></ClearDataWithLoginResponse>|null |
'------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----'

[statistics] disconnected
Job haTest ended at 09:40 19/07/2019. [exit code=0]

 

Thanks for your help!

Ray

Anonymous
Not applicable

@elkhounds :

can you please share a screen shot of the talend tSOAP component. I am facing the same issue with host analytics:

 

<faultcode>soap:Client</faultcode><faultstring>Server did not recognize the value of HTTP Header SOAPAction: http://www.HostAnalytics.com/API/SOAP/StateFree/Common/2009/03/19/MapEntity.</faultstring><detail /></soap:Fault>