Fixing a little bug contained by the generated PHP code of the SOAP request

  08 January 2014       This post has 0 comment       By Mikaël DELSOL

We just fixed an issue reported by a user.

The case

When you send a request using the web interface, you can set the authentication login and password:

Set the authentication login and password - WSDL to php

After you sent the request, you can download the PHP code that allows you to make the request on your own environment.  Lately, you would have got this type of PHP code:

$wsdl = array(); $wsdl[BingServiceSearch::WSDL_URL] = ''; $wsdl[BingServiceSearch::WSDL_LOGIN] = 'MY_LOGIN'; $wsdl[BingServiceSearch::WSDL_PASSWORD] = 'MY_PASSWORD';

But the BingServiceSearch::WSDL_PASSWORD did not exist, until now, because we named it BingServiceSearch::WSDL_PASSWD by default in the generated class BingWsdlClass from which the BingServiceSearch inherits.

The fix

We made two fixes:

  • We added two more explicit constants to the generated WsdlClass:
    • WSDL_PASSWORD: used to set the authentication password (as the password SoapClient option)
    • WSDL_EXCEPTIONS: used to set the value of the exceptions SoapClient options
  • We took care of the compatibility for the already generated packages that do not have this new constant in the WsdlClass class as we'll now always use the WSDL_PASSWORD constant. If the constant does not exist, you'll have the old one meaning WSDL_PASSWD that will make it work well too.


This fix is now published and the PHP code for the request should not failed anymore.