tESBConsumer

One Star

tESBConsumer

Hi,
I tried to consume a soap-Webservice from German DHL. But I always get an error. In SoapUi it works, but not in Talend. Maybe someone can help me.
Thank you!

My Job is simple:
tXMLFileInput -> tESBConsumer -> tLogRow
tXMLFileInput reads an Example-XML, the same file I used with SoapUI
ErrorMessage:
Starte Job SoapTestDHL am 13:33 17/05/2016.
connecting to socket on port 3778
connected
: org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean - No method was found for the WSDL operation {}getManifestDD.
: org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean - No method was found for the WSDL operation {}doManifestTD.
: org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean - No method was found for the WSDL operation {}bookPickup.
: org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean - No method was found for the WSDL operation {}createShipmentDD.
: org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean - No method was found for the WSDL operation {}deleteShipmentTD.
: org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean - No method was found for the WSDL operation {}getExportDocDD.
: org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean - No method was found for the WSDL operation {}doManifestDD.
: org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean - No method was found for the WSDL operation {}getLabelDD.
: org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean - No method was found for the WSDL operation {}getExportDocTD.
: org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean - No method was found for the WSDL operation {}getVersion.
: org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean - No method was found for the WSDL operation {}deleteShipmentDD.
: org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean - No method was found for the WSDL operation {}getLabelTD.
: org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean - No method was found for the WSDL operation {}updateShipmentDD.
: org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean - No method was found for the WSDL operation {}cancelPickup.
org.apache.cxf.binding.soap.SoapFault: UNKNOWN_ERROR
    at org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor.unmarshalFault(Soap12FaultInInterceptor.java:155)
    at org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor.handleMessage(Soap12FaultInInterceptor.java:66)
    at org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor.handleMessage(Soap12FaultInInterceptor.java:52)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
    at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:112)
    at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)
    at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
    at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:798)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1669)
Fault {string: UNKNOWN_ERROR; code:{}Receiver; role:; node:}
disconnected
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1550)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1347)
    at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
    at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:651)
    at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
    at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:324)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:277)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:297)
    at vaho_6.soaptestdhl_0_1.SoapTestDHL$GenericConsumer.invoke(SoapTestDHL.java:625)
    at vaho_6.soaptestdhl_0_1.SoapTestDHL.tFileInputXML_3Process(SoapTestDHL.java:1362)
    at vaho_6.soaptestdhl_0_1.SoapTestDHL.runJobInTOS(SoapTestDHL.java:1880)
    at vaho_6.soaptestdhl_0_1.SoapTestDHL.main(SoapTestDHL.java:1737)
Job SoapTestDHL endet am 13:33 17/05/2016.
The Input XML is:
<soapenv:Envelope xmlns:soapenv="" xmlns:de="" xmlns:cis="">
   <soapenv:Header>
       <cis:Authentification>
          <cis:user>geschaeftskunden_api</cis:user>
          <cis:signature>Dhl_ep_test1</cis:signature>
          <cis:type>0</cis:type>
       </cis:Authentification>
   </soapenv:Header>
   <soapenv:Body>
       <de:CreateShipmentDDRequest>
          <cis:Version>
             <cis:majorRelease>1</cis:majorRelease>
             <cis:minorRelease>0</cis:minorRelease>
          </cis:Version>
          <ShipmentOrder>
             <SequenceNumber>1</SequenceNumber>
             <Shipment>
                <ShipmentDetails>
                   <ProductCode>EPN</ProductCode>
                   <ShipmentDate>2016-05-17</ShipmentDate>
                   <cis:EKP>5000000000</cis:EKP>
                   <Attendance>
                      <cisSmiley TongueartnerID>01</cisSmiley TongueartnerID>
                   </Attendance>
                   <ShipmentItem>
                      <WeightInKG>10</WeightInKG>
                      <LengthInCM>50</LengthInCM>
                      <WidthInCM>30</WidthInCM>
                      <HeightInCM>15</HeightInCM>
                      <PackageType>PK</PackageType>
                   </ShipmentItem>
                </ShipmentDetails>
                <Shipper>
                   <Company>
                      <cis:Company>
                         <cis:name1>Muster Company</cis:name1>
                      </cis:Company>
                   </Company>
                   <Address>
                      <cis:streetName>Leipziger Straße</cis:streetName>
                      <cis:streetNumber>47</cis:streetNumber>
                      <cis:Zip>
                         <cis:germany>10117</cis:germany>
                      </cis:Zip>
                      <cis:city>Berlin</cis:city>
                      <cisSmiley Surprisedrigin>
                         <cis:countryISOCode>DE</cis:countryISOCode>
                      </cisSmiley Surprisedrigin>
                   </Address>
                   <Communication>
                      <cis:email>max@muster.de</cis:email>
                      <cis:contactPerson>Max Muster</cis:contactPerson>
                   </Communication>
                </Shipper>
                <Receiver>
                   <Company>
                      <cisSmiley Tongueerson>
                         <cis:firstname>Markus</cis:firstname>
                         <cis:lastname>Meier</cis:lastname>
                      </cisSmiley Tongueerson>
                   </Company>
                   <Address>
                      <cis:streetName>Marktplatz</cis:streetName>
                      <cis:streetNumber>1</cis:streetNumber>
                      <cis:Zip>
                         <cisSmiley Surprisedther>70173</cisSmiley Surprisedther>
                      </cis:Zip>
                      <cis:city>Stuttgart</cis:city>
                      <cisSmiley Surprisedrigin>
                         <cis:countryISOCode>DE</cis:countryISOCode>
                      </cisSmiley Surprisedrigin>
                   </Address>
                  <Communication>
                                   <cisSmiley Tonguehone>0049-30-763291</cisSmiley Tonguehone>
                   </Communication>
                </Receiver>
             </Shipment>
          </ShipmentOrder>
       </de:CreateShipmentDDRequest>
   </soapenv:Body>
</soapenv:Envelope>

Moderator

Re: tESBConsumer

Hi,
Have you tried to use  tsoap component to call your SOAP web service?
The work flow should be:tfileinputxml-->tsoap-->tlogrow
Please see the related scenario in component reference:TalendHelpCenter:tSOAP
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.
One Star

Re: tESBConsumer

Hi Sabrina,
I tried to use tsoap component. But I need basic Http authentication . I don't know what kind of authentication tsoap uses.
The Error-Message was
connecting to socket on port 3956
connected
Mai 18, 2016 10:11:53 AM com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection post
SCHWERWIEGEND: SAAJ0008: Bad Response; Unauthorized
Exception in component tSOAP_1
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Bad response: (401Unauthorized
    at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.call(Unknown Source)
    at org.talend.soap.SOAPUtil.invokeSOAP(SOAPUtil.java:113)
    at vaho_6.soaptestdhl_0_1.SoapTestDHL.tFileInputXML_4Process(SoapTestDHL.java:859)
    at vaho_6.soaptestdhl_0_1.SoapTestDHL.runJobInTOS(SoapTestDHL.java:1262)
    at vaho_6.soaptestdhl_0_1.SoapTestDHL.main(SoapTestDHL.java:1119)
Caused by: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Bad response: (401Unauthorized
    at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.post(Unknown Source)
    ... 5 more
CAUSE:
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Bad response: (401Unauthorized
    at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.post(Unknown Source)
disconnected
    at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.call(Unknown Source)
    at org.talend.soap.SOAPUtil.invokeSOAP(SOAPUtil.java:113)
    at vaho_6.soaptestdhl_0_1.SoapTestDHL.tFileInputXML_4Process(SoapTestDHL.java:859)
    at vaho_6.soaptestdhl_0_1.SoapTestDHL.runJobInTOS(SoapTestDHL.java:1262)
    at vaho_6.soaptestdhl_0_1.SoapTestDHL.main(SoapTestDHL.java:1119)
CAUSE:
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Bad response: (401Unauthorized
    at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.post(Unknown Source)
    at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.call(Unknown Source)
    at org.talend.soap.SOAPUtil.invokeSOAP(SOAPUtil.java:113)
    at vaho_6.soaptestdhl_0_1.SoapTestDHL.tFileInputXML_4Process(SoapTestDHL.java:859)
    at vaho_6.soaptestdhl_0_1.SoapTestDHL.runJobInTOS(SoapTestDHL.java:1262)
    at vaho_6.soaptestdhl_0_1.SoapTestDHL.main(SoapTestDHL.java:1119)
Job SoapTestDHL endet am 10:11 18/05/2016.
The manuel says:
Applications that call the DHL APIs must authenticate themselves at the Customer Integration Gateway (CIG). This authentication serves to identify the calling application and is independent of the additional authentication required to use the customer-related services of DHL PAKET, i.e. the DHL business customer shipping and private customer shipping APIs, etc. documented here.
The application authentication at the CIG is based on HTTP Basic Authentication specified in RFC 2617.
To use the business customer shipping test API, you will first need CIG authentication of your application in test mode.
The following credentials must also then be given in the web service:
User: geschaeftskunden_apiSignature: Dhl_ep_test1EKP: 5000000000
The user credentials must be entered in the SOAP header in "cis:Authentification":
<soapenv:Envelope xmlns:soapenv=""
 xmlns:cis=""
 xmlns:de="">
 <soapenv:Header>
 <cis:Authentification>
 <cis:user>geschaeftskunden_api</cis:user>
 <cis:signature>Dhl_ep_test1<cis:signature>
 <cis:type>0</cis:type>
 </cis:Authentification>
 </soapenv:Header>
 <soapenv:Body>
 ...

Six Stars

Re: tESBConsumer

@anna.talend

 

How did you solved the problem with the BasicAuth? 

One Star

Re: tESBConsumer

Hi christhomas83,

 

yes, I solved the problem. Two years ago...

 

The solution was to separate body and header. The input schema of tESBConsumer is payload(Document) and headers (Document).

Build payload and header separately and unite them with tmap:

 

payload (document) - tmap - tESBConsumer - response

                                        |

                           header (document)