有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

使用Java的SOAP请求

我一直试图通过soapui发送请求,但始终收到以下错误消息:

 <soap:Body>
     <soap:Fault>
         <faultcode>soap:Client</faultcode>
         <faultstring>Failed to process SOAP request. SOAP body not in UTF-16.</faultstring>
         <detail>
             <wsdl_ops:error>
                 Failed to process SOAP request. SOAP body not in UTF-16.
             </wsdl_ops:error>
         </detail>
     </soap:Fault>
 </soap:Body>

以前有人遇到过同样的问题吗

更新:

我把编码改成了UTF-16,它对我很有效。现在,当我发送请求时,会出现以下错误:

请求:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="http://www.broadsign.com/wsdl_ops">
   <soapenv:Header/>
   <soapenv:Body>
      <ns1:request not_modified_since="1970-01-01T00:00:00" token="0" requestid="1" version="4" name="category_mgr_list">
         <category domain_id="1719213" />
      </ns1:request>
   </soapenv:Body>
</soapenv:Envelope>

答复:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl_ops="http://www.broadsign.com/wsdl_ops">
   <soap:Body>
      <soap:Fault>
         <faultcode>soap:Client</faultcode>
         <faultstring>Invalid request.</faultstring>
         <detail>
            <wsdl_ops:error>Invalid request.</wsdl_ops:error>
         </detail>
      </soap:Fault>
   </soap:Body>
</soap:Envelope>

我错过了什么(


共 (1) 个答案

  1. # 1 楼答案

    听起来服务希望请求编码为UTF-16。验证您的请求,并尝试在请求属性中设置编码。否则,请使用原始输入和输出编辑您的问题