简体   繁体   English

PHP-Java的SOAP帮助

[英]SOAP help for PHP-Java

We are working on building a Web service which the customer can use. 我们正在构建客户可以使用的Web服务。 The Web service works fine when we test it creating a client-program in PHP. 当我们测试使用PHP创建客户端程序时,Web服务可以正常工作。 But when the customer calls the service in Java using our WSDL, it gets 500: Internal server error. 但是,当客户使用我们的WSDL以Java调用服务时,它将得到500:内部服务器错误。

Noticed that, the SOAP envelope we get when testing is different and what we get when customer is testing is different. 注意,测试时得到的SOAP信封不同,而客户进行测试时得到的SOAP信封也不同。 Also our server program logs show, the addfunction() didnt get called when Customer is testing. 我们的服务器程序日志还显示,在客户测试时没有调用addfunction()。 How to solve this. 如何解决这个问题。

The soap envelope we get when testing: 测试时得到的肥皂包层:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:ns1="http://stage.xyz.com/newcode/"><SOAP-ENV:Body><ns1:updateDelivery><ns1:data>9861164345-98611643451391407829-20140219000000-test one-100003767,9861159602-98611596021391408014-20140219000000-test three-
100003769,9861163442-98611634421391407911-20140219000000-test two-100003768</ns1:data></ns1:updateDelivery></SOAP-ENV:Body></SOAP-ENV:Envelope>

The soap envelope received when Customer is testing: 客户测试时收到的肥皂信封:

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><updateDelivery xmlns="http://stage.xyz.com/newcode/"><data>9861164345-98611643451391407829-20140219000000-test one-100003767,9861159602-98611596021391408014-20140219000000-test three-100003769,9861163442-98611634421391407911-20140219000000-test two-100003768</data><hashkey>2604574653</hashkey></updateDelivery></S:Body></S:Envelope>

Will these different envelopes be causing the Internal Server error? 这些不同的信封会引起内部服务器错误吗?

Thanks @Mujahed Syed. 谢谢@Mujahed Syed。 We installed SoapUI and tested. 我们安装了SoapUI并进行了测试。 What we are noticing, the request contains header information along with SOAP envelope. 我们注意到,该请求包含标头信息以及SOAP信封。 IF only the SOAP envelope is passed as Request in SoapUI, the service returns result, else it returns SoapFault. 如果只有SOAP信封作为SoapUI中的Request传递,则该服务返回结果,否则返回SoapFault。 So What we receive as request: 所以我们收到的要求是:

--uuid:6035feb3-d1da-4493-b32b-7146115d0327
Content-Id: <rootpart*6035feb3-d1da-4493-b32b-7146115d0327@example.jaxws.sun.com>
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
Content-Transfer-Encoding: binary

<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><updateDelivery xmlns="http://ourwebsiteurl"><data>9861164345-98611643451391407829-20140219000000-test one-100003767,9861159602-98611596021391408014-20140219000000-test three-100003769,9861163442-98611634421391407911-20140219000000-test two-100003768</data><hashkey>2604574653</hashkey></updateDelivery></S:Body></S:Envelope>
--uuid:6035feb3-d1da-4493-b32b-7146115d0327-- 

This as a request returns 500 Internal Error 这是一个请求,返回500内部错误

<faultcode xsi:type="xsd:string">SOAP-ENV:Client</faultcode>
         <faultactor xsi:type="xsd:string"/>
         <faultstring xsi:type="xsd:string">error in msg parsing:
XML error parsing SOAP payload on line 1: Not well-formed (invalid token)</faultstring>
         <detail xsi:type="xsd:string"/>

If only the Soap Envelope is given as request to SoapUI, it returns 如果仅将Soap Envelope作为请求提供给SoapUI,它将返回

<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
   <SOAP-ENV:Body>
      <ns1:updateDeliveryResponse xmlns:ns1="http://ourwebsiteurl">
         <return xsi:type="xsd:string">100|2604574653|</return>
      </ns1:updateDeliveryResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Can we just receive the SOAP envelope in PHP and make the SoapServer call? 我们可以只接收PHP中的SOAP信封并进行SoapServer调用吗? Or are we going totally wrong in debugging the issue. 还是我们在调试问题上完全错了。 Please give your inputs. 请输入您的意见。 Thanks in advance. 提前致谢。

HTTP 500 error is very general and vague, you have to further investigate this issue. HTTP 500错误非常普遍且含糊,您必须进一步调查此问题。 You can try following steps to investigate the issue: 您可以尝试按照以下步骤调查此问题:

Thanks. 谢谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM