I've been trying out this module along with developing a .NET webservice. My first attempt went great, but then I made some changes to the webservice and kept getting a "SOAP-ERROR: Encoding: Violation of encoding rules"

Spending a few hours trying to figure this out I finally realized the wsdl the client was using was not refreshing. I would create a very simple helloworld() function and the client would not recognize it. Is the wsdl caching for some reason, and if so, how do I refresh it?? Out of desperation I cleared the site cache, but obviously that didn't work.

Comments

ilo’s picture

Status: Active » Needs review

I'll try to fix this one quickly, but in the mean time here are some suggestions..

If you are using nuSOAP:

edit the sopaclient.module file (in 6.x-1.x-dev this is the code from the line 622):

...
    if ( $use_wsdl ) {        
      // load from cache first
      $cache = new wsdlcache(variable_get('soapclient_wsdlcache_path', variable_get('file_directory_temp', NULL)),      variable_get('soapclient_wsdlcache_lifetime', 60));
      $wsdl = $cache->get($url);

      if ( empty($wsdl) ) {
        // not available, create new one
        $wsdl = new wsdl($endpoint, $proxyhost, $proxyport, $proxyuser, $proxypass);
        $cache->put($wsdl);
      }
      
      $endpoint = $wsdl;
    }
...

you may comment the line "$wsdl = $cache->get($url);" for now, and this would stop using the cached version of the wsdl forever.

--------

If you are using PHP SOAP:

in the 6.x-1.x-dev version it is the line 682:


    try {
      $client = new SoapClient( ($use_wsdl ? $endpoint : NULL), $options );
    }
    catch (Exception $e) {

Replace with..


    try {
      // disable cache for wsdl files.
      ini_set("soap.wsdl_cache_enabled", "0");

      $client = new SoapClient( ($use_wsdl ? $endpoint : NULL), $options );
    }
    catch (Exception $e) {

Try this and lets see if it works for you..

jarchowk’s picture

Great, perfect. Thanks very much for the quick reply.

13rac1’s picture

Status: Needs review » Closed (fixed)

Seems fixed. Closing old issues.