首页 文章

IBM和Axis 1.4 Web服务的兼容性

提问于
浏览
0

我正面临着Web服务的问题 .

我有一个Web服务,使用IBM Web服务的堆栈在WebSphere应用程序服务器上部署和运行了很长时间 . 现在我已将它迁移到glassfish v2.1.1到Axis 1.4堆栈 . Web服务的WSDL没有改变以保持客户端的兼容性

有一种具有布尔返回类型的Web服务方法 . 问题是,当我调用我的方法时,soap响应在glassfish中返回不同:

例:

的WebSphere:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Body soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <checkPendingOperationsResponse xmlns="http://operations.appserver.dealer.omnitel.lt">
            <checkPendingOperationsReturn xsi:type="xsd:boolean" xmlns="">0</checkPendingOperationsReturn>
         </checkPendingOperationsResponse>
      </soapenv:Body>
   </soapenv:Envelope>

Glassfish的:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
      <soapenv:Body>  
         <ns1:checkPendingOperationsResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://operations.appserver.dealer.omnitel.lt">   
            <checkPendingOperationsReturn href="#id0"/>  
         </ns1:checkPendingOperationsResponse>  
         <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="soapenc:boolean" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">false</multiRef> 
      </soapenv:Body>
   </soapenv:Envelope>

问题是某些客户端无法处理“false”,“true”值,因为之前返回的值为“1”,“0” .

是否有解决方案或证据证明无法解决?

提前致谢 .

1 回答

  • 0

    好吧,如果你仍想为那些值(对应于true和false)返回1和0,你可以强制返回类,如sais here或创建一个在发送响应之前更改它的拦截器 .

相关问题