通过ReadyAPI发出的SOAP消息错误

时间:2018-11-29 08:30:33

标签: xml web-services soap soapui ready-api

我已经在下面发送了SOAP消息,但是出现错误。我修改了标题,但不确定是否会造成影响:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsse="http://schema.uk.experian.com/wsu" xmlns:wsu="http://schema.uk.experian.com/wsu" xmlns:ns="http://schema.uk.experian.com/eih/2011/03" xmlns:eih="http://schema.uk.experian.com/eih/2011/03/EIHHeader" xmlns:qas="http://schema.uk.experian.com/eih/2011/03/QAS">
   <soapenv:Header/>
   <wsse:Security>
      <wsu:Timestamp wsu:Id="Timestamp-2b27a32b-ca9c-4405-b377-4444f63c8f29">
         <wsu:Created>2018-11-29T16:36:54Z</wsu:Created>
         <wsu:Expires>2018-11-29T16:41:54Z</wsu:Expires>
      </wsu:Timestamp>
      <wsse:BinarySecurityToken ValueType="ExperianWASP" EncodingType="wsse:Base64Binary" wsu:Id="SecurityToken-f64439f9-c12c-4d09-ac3d-fc478ad19775">${TokenServiceSoap LoginWithCertificate-LoginWithCertificate Request#Response#declare namespace ns1='http://www.uk.experian.com/WASP/'; //ns1:LoginWithCertificateResponse[1]/ns1:LoginWithCertificateResult[1]}</wsse:BinarySecurityToken>
   </wsse:Security>
  <soapenv:Header>
   <soapenv:Body>
      <ns:ExecuteQASearch>
         <eih:EIHHeader>
            <eih:ClientUser>Hampshire</eih:ClientUser>
            <eih:ReferenceId>8060be46-1510-4095-b2f3-f4a5a9527dc0</eih:ReferenceId>
         </eih:EIHHeader>
         <qas:QASearch Language="">
            <qas:Country>GBR</qas:Country>
            <qas:Engine Flatten="true" Intensity="" PromptSet="" Threshold="" Timeout="">Singleline</qas:Engine>
            <!--Optional:-->
            <qas:Layout>experian</qas:Layout>
            <qas:Search>LL55 4YF</qas:Search>
         </qas:QASearch>
      </ns:ExecuteQASearch>
   </soapenv:Body>
</soapenv:Envelope>

显示以下错误

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <soap:Fault>
         <faultcode>soap:Server</faultcode>
         <faultstring>freemarker.core.InvalidReferenceException: Expression client_user is undefined on line 10, column 52 in fault-list.xml.</faultstring>
      </soap:Fault>
   </soap:Body>
</soap:Envelope>

2 个答案:

答案 0 :(得分:1)

这里没有太多事情要做,但是我最大的猜测是服务操作使用某种用户身份验证,而您没有提供必要的数据。

这可以以不同的方式实现。您可能需要在标题部分添加信息。您可能需要添加HTTP标头。您可能需要在Soap Request Teststep中的AUTH窗格中选择一个选项。

答案 1 :(得分:1)

您的XML无效。标头标签先关闭,然后再打开。

第2行

 <soapenv:Header/>

应该是

 <soapenv:Header>

第10行

<soapenv:Header>

应该是

</soapenv:Header>

enter image description here