Results 1 to 2 of 2

Thread: Php curl to https soap web service

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2007
    Posts
    912

    Php curl to https soap web service

    Im tring to call a dot net https soap web service with my curl code but im always getting incorrect soap header error.

    Strange thing is in soapUI soap request works fine with

    Username
    Password
    Nonce
    Created timestamp

    What should i do to make it work with curl?

    Shall i share my code here? Or you may give me a hint or http curk headers? Or anything else that might be important for this task?

  2. #2
    New Member
    Join Date
    May 2017
    Posts
    4

    Re: Php curl to https soap web service

    You can try this. This is what I used when I wound up using cURL in .php for a SOAP Web-Service.
    Code:
    $envelope = '<soap:Envelope> .... </soap:Envelope>';
    
    $soap_do = curl_init();
    curl_setopt($soap_do, CURLOPT_URL,            "https://ccws-services.ecollege.com/EnterpriseServices/v2.1/EnterpriseCourse.svc" );
    curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 10);
    curl_setopt($soap_do, CURLOPT_TIMEOUT,        10);
    curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true );
    curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($soap_do, CURLOPT_POST,           true );            
    curl_setopt($soap_do, CURLOPT_POSTFIELDS,     $envelope); 
    curl_setopt($soap_do, CURLOPT_VERBOSE, TRUE); 
    curl_setopt($soap_do, CURLOPT_HTTPHEADER, array("Content-Type: text/xml","SOAPAction: \"/soap/action/query\"", "Content-length: ".strlen($envelope))); 
    
    $result = curl_exec($soap_do);
    I do time out trying to connect to it. Try it on your end and see if it works with your username and password.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width