I
I
Ivan2014-01-16 11:45:50
PHP
Ivan, 2014-01-16 11:45:50

SOAP request in PHP?

Good afternoon! I need to complete a task. Register a new member using the SOAP method.
there is a Wsdl
https://webservices.saveonresorts.com/services/Clu...
the code is as follows:

<?php
     $url = "https://webservices.saveonresorts.com/services/ClubMembership.svc?singleWsdl";
     $client = new SoapClient($url, array('soap_version' => SOAP_1_2, "location" =>        "https://webservices.saveonresorts.com/services/ClubMembership.svc", 'trace' => 1));
     
     $params = array('Email' => '[email protected]', 'LastName' => 'Carter', 'FirstName' => 'Patrick', 'Phone' => '+1111111111');

    print_r($client->__getFunctions());
    echo '<br><br>';
    try { 
        $xml = $client->CreateMembership_Paid($params);
    } catch (SoapFault $fault) { 
        $xml = array(); 
        $xml['faultcode'] = $fault->faultcode;
        $xml['faultstring'] = $fault->faultstring;
    }

    var_dump($xml);
?>

As a result, I get a list of functions, I try to call one of them, but I get an error:
array(2) { ["faultcode"]=> string(8) "s:Sender" ["faultstring"]=> string(143) " The SOAP action specified on the message, '', does not match the HTTP SOAP Action, ' tempuri.org/IClubMembership/CreateMembership_Paid '. " } Googled a
lot but couldn't find anything useful due to this error. Why does this error occur? What am I doing wrong in the code?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vadim Yakovlev, 2014-01-16
@ivan_dyumin

add

$actionHeader = new SoapHeader('http://www.w3.org/2005/08/addressing',
                               'Action',
                               'http://tempuri.org/IClubMembership/CreateMembership_Paid');
$client->__setSoapHeaders($actionHeader);

I
Ivan, 2014-01-16
@ivan_dyumin

Now the message is "The message with To '' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree." I thought that the parameters are not all. No, it's still an error message. Tell me, what can be connected with?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question