Disable native Soap class in PHP5 and use nuSoap?

I spent the last week developing code to connect to a web service using the nuSoap library. I just deployed the code for production, but immediately began to get an error that I had not seen before. I traced the problem to a line of code that is trying to instantiate a new soapclient object. It turns out that both libraries have a class called "soapclient", and the one that is created during production is the native Soap library, not the nuSoap library, which I include. How can I disable Soap's internal functionality and stick strictly to nuSoap?

+3
source share
3 answers

With the release of PHP5, there is a class soapclientincluded in the php_soap extension. NuSOAP renamed its class to nusoap_client. If your copy of NuSOAP is up to date, you can use it. This does not disable the php_soap extension, but should allow you to use the NuSOAP class without additional conflicts.

+2
source

Ah, never mind. NuSoap 0.7.3 (which I used) changed the class name to "nusoap_client" specifically to avoid this conflict. They also included a backward compatibility check that smoothed this class with a "soapclient" if the native Soap extension was not loaded, so I did not understand this on my development machine.

: http://code.google.com/p/nusoap-for-php5/issues/detail?id=2

+2

I'm not blaming you, the built-in soap library for PHP is a complete and complete embarrassment, especially when compared to python web services.

One option is to remove the extension at compile time:

This extension is only available if PHP has been configured using --enable-soap.

Another option is to rename soap-client to nuSoap. Notepad ++ search and replace works well, but you really don't need to do this.

0
source

Source: https://habr.com/ru/post/1736380/


All Articles