tSOAP issue

Highlighted
Six Stars

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.


Accepted Solutions
Community Manager

Re: tSOAP issue

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.

Six Stars

Re: tSOAP issue

Here are the two files...


All Replies
Community Manager

Re: tSOAP issue

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? 

Six Stars

Re: tSOAP issue

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

 

Community Manager

Re: tSOAP issue

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.

Six Stars

Re: tSOAP issue

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

Community Manager

Re: tSOAP issue

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"
Six Stars

Re: tSOAP issue

Greetings,

 

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

Thanks Ray

Six Stars

Re: tSOAP issue

Here are the two files...

Six Stars

Re: tSOAP issue

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

Two Stars

Re: tSOAP issue

@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>

Six Stars

Re: tSOAP issue

Here you go...

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Talend Studio Improvements for API Services

Taken a look at the Talend Studio improvements for API Services

Watch Now

Data Integration Success Stories

Take a look at some Data Integration success stories

Read