Can not manipulate webservice response

Highlighted
Six Stars

Can not manipulate webservice response

I'm trying to create a SOAP based webservice. I use Talend Open Studio ESB 7.1.1 and SOAP 5.3. I have wsdl below:

<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.talend.org/service/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" name="Test_Webservice_2" targetNamespace="http://www.talend.org/service/">
<script/>
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://www.talend.org/service/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://www.talend.org/service/"> </xsd:schema>
</wsdl:types>
<wsdl:message name="Operation_1Request">
<wsdl:part name="nev" type="xsd:string"> </wsdl:part>
<wsdl:part name="kor" type="xsd:long"> </wsdl:part>
</wsdl:message>
<wsdl:message name="Operation_1Response">
<wsdl:part name="responseText" type="xsd:string"> </wsdl:part>
<wsdl:part name="responseText2" type="xsd:int"> </wsdl:part>
</wsdl:message>
<wsdl:portType name="TWS_PortType">
<wsdl:operation name="Operation_1">
<wsdl:input message="tns:Operation_1Request"> </wsdl:input>
<wsdl:output message="tns:Operation_1Response"> </wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="Test_Webservice_2Binding" type="tns:TWS_PortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="Operation_1">
<soap:operation soapAction="http://www.talend.org/service/Operation_1"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Test_Webservice_2">
<wsdl:port binding="tns:Test_Webservice_2Binding" name="Test_Webservice_2Port">
<soap:address location="http://localhost:8090/services/Test_Webservice_2"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

And here is the basic structure, I made and the Map component binding.
ws_create_res_err.jpgws_create_res_err_2.jpg

the tJava componenet only log some technical data...
When I call this API like this -from SOAP UI-:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header/>
   <soapenv:Body>
      <nev>?</nev>
      <kor>?</kor>
   </soapenv:Body>
</soapenv:Envelope>

I receive this result:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <nev>?</nev>
   </soap:Body>
</soap:Envelope>

This is strange me, 'cause as I write down in the wsdl, I need responseText field in the response instead if <nev></nev>. 
Any idea what did I wrong?
I'm newbie in Talend... Smiley Happy 

 

UPDATE

I have recognised, I need to use tXMLMap instead of tMap component 'cause of this article:
https://help.talend.com/reader/iYcvdknuprDzYycT3WRU8w/EHwWqn8Io8xKgHS09BJD4A

But if I use this componenet, I got this error message:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <soap:Fault>
         <faultcode>soap:Server</faultcode>
         <faultstring>Could not generate the XML stream caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col {unknown-source}]: [2,0].</faultstring>
      </soap:Fault>
   </soap:Body>
</soap:Envelope>

The input and the output parameters are the same. Here is the connection:

ws_create_res_err_3.jpg

Any idea?


Accepted Solutions
Moderator

Re: Can not manipulate webservice response

Hello,

This error indicates the tXMLMap setup within job is not correct. 

Ensure to verify following steps Once the job is designed with producer and consumer :

1. Right click on Services -> xxxxxx and select "Import WSDL Schemas". 
2. Open tXMLMap map editor. In the row1 input table right-click on the payload and select "Import from repository". From the "Metadata" popup that opens, select Metadata -> File xml ->xxxx -> service -> xxxx -> xxxxx -> metadata
3. In the output table delete the current value of the Expression field.
4. Redo the mapping between the input and output table.

Let us know if it is OK with you.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

All Replies
Moderator

Re: Can not manipulate webservice response

Hello,

This error indicates the tXMLMap setup within job is not correct. 

Ensure to verify following steps Once the job is designed with producer and consumer :

1. Right click on Services -> xxxxxx and select "Import WSDL Schemas". 
2. Open tXMLMap map editor. In the row1 input table right-click on the payload and select "Import from repository". From the "Metadata" popup that opens, select Metadata -> File xml ->xxxx -> service -> xxxx -> xxxxx -> metadata
3. In the output table delete the current value of the Expression field.
4. Redo the mapping between the input and output table.

Let us know if it is OK with you.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: Can not manipulate webservice response

Hey Sabrina,

yes, this solved my issue, thank you!

Best regards,

Viktor

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 API Designer – Technical Overview

Take a look at this technical overview video of Talend API Designer

Watch Now

Getting Started with APIs

Find out how to get started with APIs

Read