Debug SOAP PHP call

I am new to SOAP and am engaged in a web service where, it would seem, no one had contacted PHP before. They have no example code except C #, but I have this. eServices.asmx provides WSDL if this is the right way to say it.

The error I get is "The server did not recognize the value of the SOAPAction: HTTP header," so that a training colon, assuming that the value is not passed, is possible.

My code is as follows:

$URL = "http://nolaflash.example.com/xxxWS/eServices.asmx";

$namespace="http://www.example.com/webservices/";

include("SOAP/Client.php");

$soapclient = new SOAP_Client($URL);

$xml_data = // valid XML is here;

$res = $soapclient->UpdateData('usrname','pass',$xml_data);

but I also tried:

$param = array('usrname','pass',$xml_data);
$res = $soapclient->call('UpdateData',$param, $namespace);

Googling suggests that this error is a namespace problem. The C # code that I have has only one link to the namespace:

[System.Web.Services.WebServiceBindingAttribute(Name="eServicesSoap", Namespace="http://www.example.com/webservices/")]

If I unload the $ soapclient on the screen before calling the function, I see that it received data from eServices.asmx.

, , .NET IDE.

? ?

+5
2

getFunctions getLastRequest . WSDL. WSDL / //. . WSDL , , , ..

, , . XML, . XML-.

, . , XML - , XML XYZ. PHP/Soap

+8

- Fiddler. . , - .net, PHP. ( ) . , . - .

wsdl

POST /b1synccontext.asmx HTTP/1.1
Host: 00.00.00.0
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/QueueEntryGetStatus"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <QueueEntryGetStatus xmlns="http://tempuri.org/">
      <BuffID>int</BuffID>
    </QueueEntryGetStatus>
  </soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <QueueEntryGetStatusResponse xmlns="http://tempuri.org/">
      <QueueEntryGetStatusResult>int</QueueEntryGetStatusResult>
    </QueueEntryGetStatusResponse>
  </soap:Body>
</soap:Envelope>

php

$client = new SoapClient("http://YOURIP/yourservice.asmx?wsdl",array(
                        'exceptions'=>true,
                        'cache_wsdl'=>WSDL_CACHE_NONE,
                        'encoding'=>'utf-8'));
$params = array(
    'BuffID' => 134
    );

try 
    {
        $result = $client->QueueEntryGetStatus($params);
        $status = $result->QueueEntryGetStatusResult;
        /*do something*/ 
    } 
    catch (Exception $e) 
    {
        $e -> getMessage();
        /*do something*/
    }
0

All Articles