使用Java的SOAP请求

时间:2010-05-25 20:39:13

标签: 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,它对我有用。现在,当我发送请求时,我得到以下错误:

REQUEST:

<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 个答案:

答案 0 :(得分:0)

听起来服务期望请求被编码为UTF-16。验证您的请求并尝试在请求属性中设置编码。如果做不到这一点,请使用原始输入和输出编辑您的问题。