基于工作 SoapUI 查询的 Talend tSoap - "One or more errors are present in parameters."

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

我在 SoapUI 中有一个有效的 SOAP 请求:

在 wsdl 中,我有关于函数的以下信息:

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

我确实想在 Talend 中使用 tSOAP 组件调用它:

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

当我执行时,我收到此错误消息:

[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

当我在 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>

由于我是 SOAP 的新手,所以我可能确实遗漏了一个小错误。 我在选择 SOAP 1.1 或 1.2 时遇到了同样的问题。


根据@Bogdan 的建议,我确实添加了 TcpMon 进行调试:

我来自 SoapUI 的 Post 如下所示:

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>

Post 通过 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> 

我看到的唯一区别如下:

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

注意:我确实尝试了 Pers_ListMin 和 Pers_List,两者给出了相同的结果。

谢谢@Bogdan 推荐我使用 TCPMon。

我确实将来自 TCPMon 的请求添加到我上面的问题中。

我发现使用 SoapUI 发送以下内容:

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 与 tSOAP 和 SOAP 版本 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 与 tSOAP 和 SOAP 版本 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

所以这里的问题是 SOAP 版本。即便如此,对于 1.1 版,我还是遇到了其他异常,这让我觉得我完全错了。