Moving from NuSOAP to PHP5 SOAP

后端 未结 3 1201
一整个雨季
一整个雨季 2021-01-13 00:35

I have been working on a script with PHP4 that relies on NuSOAP. Now, I\'m trying to move this to PHP5, and use the buildin support for SOAP there.

$wsdlPath         


        
相关标签:
3条回答
  • 2021-01-13 01:15

    Make sure NuSoap and PHPv5-SOAP are running on the same server. If I'm not totally wrong, both libraries uses the same class-name. Maybe it will work better if you make sure none NuSopa-files are included? And also verify that the SOAP-library are loaded:

    if(!extension_loaded('soap')){
      dl('soap.so'); // Actually a deprecated method. See "notes" at http://no.php.net/dl
    }
    

    I guess the version-field you refer to is defined as "SOAP 1.1" or similiar?

    Best wishes :)

    Btw: what are you working on? Exchange of delays from the pilot to the airport? Or perhaps a webservice which will decrease the waiting-time on luggage delivery at Osl? :p

    0 讨论(0)
  • 2021-01-13 01:27

    Without testing it, I have two suggestions:

    First, put your error_reporting to the highest possible (before creating the SoapClient):

    error_reporting( E_ALL );
    

    If there's something wrong with the authentication on the server's side, PHP will throw warnings. In most of the cases, it will tell you, what has gone wrong.

    Second: I don't know if you can specifiy the 'location' option together with an URL to a wsdl. Theoretically, the wsdl tells your client, where the endpoint of the operations is, so you don't have to bother.

    0 讨论(0)
  • 2021-01-13 01:37

    We had very similar problems with PHP5 built-in SOAP client trying to consume a .NET-based Web-service. Also WSDL parsing failed reporting invalid schema. Putting the schema definitions into a single local file didn't help.

    We gave up trying and switched to NuSOAP, which did work.

    However, NuSOAP is far from perfect also. Right now I get into out-of memory situation during the parsing of 1MB+ responses. Erasing all the nasty debug code helped a little, but not radically.

    Thus, looks like there's no 100% interoperable/functional SOAP client implementation in PHP at the moment.

    0 讨论(0)
提交回复
热议问题