1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

SOAP client issue.

Discussion in 'PHP' started by stephan2307, Aug 22, 2018.

  1. #1
    For a client I need to use a SOAP API. Having real problems with it and wondering if someone can help with this.

    They have provided an example soap call that works but I can not get my code to match that example request. Can anyone point me in the right direction?

    Example SOAP request

    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:hyp="http://xxxxxxxxxx">
    Code (markup):
    My code sends the following request

    <?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="xxxxxxx" xmlns:ns2="xxxxxx">
    Code (markup):
    And this is my code
    $opts = array(
                 'http' => array(
                     'user_agent' => 'PHPSoapClient'
                 'ssl' => array(
                    'verify_peer' => false,
                    'verify_peer_name' => false,
                    'allow_self_signed' => true
            $context = stream_context_create($opts);
            $soapClientOptions = array(
              'stream_context' => $context,
              'cache_wsdl' => WSDL_CACHE_NONE,
              'trace' => 1,
              'soap_version' => SOAP_1_2,
            $client = new SoapClient($endpoint, $soapClientOptions);
            $soapAuth = array( 'strUserName' => $username,
                               'strPassword' => $password
            $header     = new SoapHeader($endpoint, 'AuthSoapHeader', $soapAuth, false);
            $result = $client->__soapCall('WS_CreateCard', array( 'WS_CreateCard' => array(
                'WSID' => 'xxxx',
                'IssCode' => 'xxxx'
                  ) , NULL, $header);
    Any idea where I am going wrong?
    stephan2307, Aug 22, 2018 IP
  2. stephan2307

    stephan2307 Well-Known Member

    Likes Received:
    Best Answers:
    Trophy Points:
    Its ok. Thanks.
    rewritten the code and am using curl now.
    stephan2307, Aug 22, 2018 IP