none
Can't call methods on WCF service from PHP SoapClient RRS feed

  • Question

  • I have a WCF service that has been called from a PHP client - formerly using Web Services Framework for PHP, which is no longer supported.  So I'm trying to convert the PHP code to use PHP Soap instead, and I'm running into problems.

    This part seems to work:

          $params  = array("soap_version"=> SOAP_1_2,
                    "trace"=>1,
                    "exceptions"=>0,
                    );
                    
          $client = new SoapClient("https://[mydomain]/TestSvc/TestSvc.svc?wsdl", $params);
          
          var_dump($client->__getFunctions());

    That displays the methods detailed in the WSDL.  So far so good.  But I get errors when I try to call a method on the client object.

    e.g. (of course the input object has properties set first):

    $response = $client->ValidateLoginReturnPropertyByCustomerContact_GetList($input);

    The response object shows:

    SoapFault Object
    (
        [message:protected] => The SOAP action specified on the message, '', does not match the HTTP SOAP Action, 'http://android-data.com/adaimsvc/IAndroidDataAIMSvc/ValidateLoginReturnPropertyByCustomerContact_GetList'

    [etc.]

    I'm not sure if it matters, but the web service is only bound to ports 443 and 8080 (long story).  It looks to me like the SOAP action isn't being specified properly.  Does anyone have any ideas how to get past this?  Thanks for the help.

    Wednesday, May 29, 2013 10:41 PM

Answers

  • Maybe you can have a look at WCF REST service to see whether you can rewrite your service to REST pattern. Then PHP just uses Http to call the service. It is more easy for the client. 


    Best regards,
    Riquel

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, May 30, 2013 10:10 PM

All replies

  • I noticed that this appears in the IIS logs each time it fails.

    2013-05-30 21:09:51 192.168.1.99 GET /AndroidDataAIMSvc/AndroidDataAIMSvc.svc xsd=xsd0 443 - 64.111.101.108 - 200 0 0 530
    2013-05-30 21:09:51 192.168.1.99 POST /AndroidDataAIMSvc/AndroidDataAIMSvc.svc - 443 - 64.111.101.108 PHP-SOAP/5.3.13 500 0 0 124

    I believe that is saying that a 500 error is occurring when trying to access the service after successfully retrieving the wsdl.  Please let me know if you have any suggestions.

    Thursday, May 30, 2013 9:15 PM
  • Maybe you can have a look at WCF REST service to see whether you can rewrite your service to REST pattern. Then PHP just uses Http to call the service. It is more easy for the client. 


    Best regards,
    Riquel

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, May 30, 2013 10:10 PM