Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SoapServer, fault on handle() - Procedure not set

So the error is:

PHP Fatal error: Procedure 'sup:set_availability' not present in XMLSoapServer.php

I am receiving this error on my development environment (MAMP).

This is caused by an invalid XML string, in wich the 'sup' namespace isn't defined:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<SOAP-ENV:Envelope xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema" 
    xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/" 
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Body>
        <sup:set_availability>
            <SetAvailability>
                ...
            </SetAvailability>
        </sup:set_availability>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

(It's an external request, so I can't just go and correct the source - well I can, but atleast not on a short notice.)

The problem is that I got 2 servers that are processing the same request. Without the error. So my quest is to find out why :)

Some details:

  • Server 1: php 5.3.2
  • Server 2: php 5.4
  • Development: php 5.4

Things I have checked so far:

  • the code is the same svn-checkout
  • no hidden dev or production only setting
  • apache config's are the same
  • wsdl caching is disabled, cached wsdl are cleared
  • php.ini settings are the same, with an exception for libxml2:

Server 1 has version 2.6.26 server 2 has version 2.7.7 - on which the request works like a charm My dev environment has lixml2 version 2.8.0 - and does throw the fatal error.

My guess is (or was) that libxml2 is causing the errors - but I can't find any resource on this topic - neither was I succesfull to downgrade my local libxml2 version to 2.6 or 2.7.

So... any thoughts on this?

like image 359
Rob Gordijn Avatar asked Apr 30 '14 20:04

Rob Gordijn


3 Answers

I don't know what the problem is ... but since the native PHP SoapClient always seemed a bit "opaque" to me, I like to use the Dklab_SoapClient library.

It uses Curl to retrieve Soap data and it is much more flexible than the native PHP class. Plus you can even extends it to add your own functionnaly if you need too :) I am guessing it would solve your problem.

However, if you dont want to use an external library, I don't have a clue what might cause this ...

like image 179
Lovau Avatar answered Nov 13 '22 09:11

Lovau


I think missing variable in passed to soap client.Check with with soap client working or not

like image 42
Kamal Avatar answered Nov 13 '22 11:11

Kamal


I'll suggest a different angle for fixing this problem.

Instead of breaking your XML parser you could modify the request before giving it to your XML parser. Add the sup namespace to the request if it isn't present. Preferably push this change to production and update/fix your production XML parsers.

Once the external source gets their software working remove this hack.

like image 23
Mikael Lindlöf Avatar answered Nov 13 '22 09:11

Mikael Lindlöf