How can I send SOAP XML via Curl and PHP?

前端 未结 6 441
暖寄归人
暖寄归人 2020-12-01 02:15

This has been bugging me for days; I\'m trying to send a SOAP post via Curl but I just keep getting a \"couldn\'t connect to host\" error, but, I really can\'t see how.

6条回答
  •  青春惊慌失措
    2020-12-01 02:31

    For those finding this from Google, I ran into a similar problem, trying to interact with a .NET SOAP server from PHP, when the ASP method worked fine.

    I used a packet sniffer to see what the ASP client was sending, exactly, and noticed it included cookies after the initial authentication request. So I enabled cookies in my cURL and it worked fine.

    $cookiePath = tempnam('/tmp', 'cookie');
    curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiePath);
    

提交回复
热议问题