Search code examples
soaptalend

Talend tSoap based on working SoapUI query - "One or more errors are present in parameters."


I have a working SOAP-request in SoapUI:

enter image description here

In the wsdl I have the following information about the function:

<operation name="Pers_List">
<soap:operation soapAction="urn:server#Pers_ListMin" style="rpc"/>
<input>
<soap:body use="encoded" namespace="urn:server" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="urn:server" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>

I did want to call it in Talend using the tSOAP component: enter image description here

    "
<soapenv:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:urn=\"urn:server\">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:Pers_ListMin soapenv:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">
         <Period xsi:type=\"dsk:Period\" xmlns:dsk=\"DSK_SOAP_API\">
            <StartDate xsi:type=\"xsd:string\">2021-04-27</StartDate>
            <EndDate xsi:type=\"xsd:string\">2021-04-27</EndDate>
         </Period>
      </urn:Pers_ListMin>
   </soapenv:Body>
</soapenv:Envelope>
"

When I execute I get this error-message:

[statistics] connected
|<ns1:Pers_ListMinResponse xmlns:ns1="urn:server"><return type="tns:ListPersMin_Response"><Response type="tns:Response"><ResponseCode type="xsd:int">503</ResponseCode><ResponseMessage type="xsd:string">One or more errors are present in parameters.</ResponseMessage><ExecutionTime type="xsd:int">0</ExecutionTime></Response><Pers arrayType="tns:PersMin[0]" type="SOAP-ENC:Array" /></return></ns1:Pers_ListMinResponse>|
[statistics] disconnected

I do get the same response when I insert the authentication data in the soap-message:

    <Auth xsi:type=\"dsk:Auth\" xmlns:dsk=\"DSK_SOAP_API\">
        <!--You may enter the following 2 items in any order-->
        <Login xsi:type=\"xsd:string\">SOAP</Login>
        <Password xsi:type=\"xsd:string\">x</Password>
     </Auth>

As I am very new to SOAP it might be that I do miss a trivial error. I do have the same issue when selecting SOAP 1.1 or 1.2.


A suggested by @Bogdan, I did add TcpMon for debugging:

My Post from SoapUI looks as follow:

POST /soap/DSK_WS.php HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "urn:server#Pers_List"
Content-Length: 954
Host: 192.168.119.46:8888
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.5 (Java/12.0.1)

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:server">   
   <soapenv:Header/>   
   <soapenv:Body>      
      <urn:Pers_List soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">         
         <Auth xsi:type="dsk:Auth" xmlns:dsk="DSK_SOAP_API">            
            <!--You may enter the following 2 items in any order-->            
               <Login xsi:type="xsd:string">SOAP</Login>            
               <Password xsi:type="xsd:string">x</Password>         
            </Auth>         
            <Period xsi:type="dsk:Period" xmlns:dsk="DSK_SOAP_API">            
               <!--You may enter the following 2 items in any order-->            
                  <StartDate xsi:type="xsd:string">2021-04-27</StartDate>            
                  <EndDate xsi:type="xsd:string">2021-04-27</EndDate>         
               </Period>      
            </urn:Pers_List>   
         </soapenv:Body>
      </soapenv:Envelope>

The Post via tSOAP:

POST /soap/DSK_WS.php HTTP/1.1
Accept: application/soap+xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
SOAPAction: urn:server#Pers_List
Content-Type: application/soap+xml; charset=utf-8
Cache-Control: no-cache
Pragma: no-cache
User-Agent: Java/1.8.0_161
Host: 192.168.119.46:8888
Connection: keep-alive
Content-Length: 966

  <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:server">     
   <soapenv:Header/>     
   <soapenv:Body>        
      <urn:Pers_List soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">           
         <Auth xsi:type="dsk:Auth" xmlns:dsk="DSK_SOAP_API">              
            <!--You may enter the following 2 items in any order-->              
               <Login xsi:type="xsd:string">SOAP</Login>              
               <Password xsi:type="xsd:string">x</Password>           
            </Auth>           
            <Period xsi:type="dsk:Period" xmlns:dsk="DSK_SOAP_API">              
               <!--You may enter the following 2 items in any order-->              
                  <StartDate xsi:type="xsd:string">2021-04-27</StartDate>              
                  <EndDate xsi:type="xsd:string">2021-04-27</EndDate>           
               </Period>          
            </urn:Pers_List>     
         </soapenv:Body>  
      </soapenv:Envelope> 

The only differences I see are the following:

Accept-Encoding: gzip,deflate
=>
Accept: application/soap+xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2

Content-Type: text/xml;charset=UTF-8
=>
Content-Type: application/soap+xml; charset=utf-8

<No cache>
=>
Cache-Control: no-cache

Note: I did try with Pers_ListMin and Pers_List, both give the same result.


Solution

  • Thx @Bogdan for recommanding me to use TCPMon.

    I did add the requests from TCPMon to my question above.

    I found out that with SoapUI send the following:

    POST /soap/DSK_WS.php HTTP/1.1
    Accept-Encoding: gzip,deflate
    Content-Type: text/xml;charset=UTF-8
    SOAPAction: "urn:server#Pers_List"
    

    Talend with tSOAP and SOAP-version 1.2:

    POST /soap/DSK_WS.php HTTP/1.1
    Accept: application/soap+xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    SOAPAction: "urn:server#Pers_List"
    Content-Type: application/soap+xml; charset=utf-8
    

    Talend with tSOAP and SOAP-version 1.1:

    POST /soap/DSK_WS.php HTTP/1.1
    Accept: text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    SOAPAction: "urn:server#Pers_List"
    Content-Type: text/xml; charset=utf-8
    

    So the problem here was the SOAP-version. Even so with version 1.1 I get other Exceptions which made me think I would have been completely wrong with this.