“Error Fetching http body” with php SoapClient

后端 未结 2 901
离开以前
离开以前 2021-01-21 02:10

I have some trouble submitting user data to a server by using Soap. All i get is:
Error Fetching http body, No Content-Length, connection closed or chunked data

相关标签:
2条回答
  • 2021-01-21 02:36

    try PHP 5.3 with

    $client = new SoapClient("< some url  >", 
        array(
            'trace' => 1,
            'stream_context' => stream_context_create(
                array(
                    'http' => array(
                        'protocol_version' => 1.0,
                    ),
                )
            ),
        )
    );
    
    0 讨论(0)
  • 2021-01-21 02:40

    With PHP 5.4.4, it didn't work without Transfer-Encoding: chunked :

    $client = new SoapClient("< some url  >", 
        array(
            'trace' => 1,
            'stream_context' => stream_context_create(
                array(
                    'http' => array(
                        'protocol_version' => 1.0,
                        'header' => "Transfer-Encoding: chunked\r\n",
                    ),
                )
            ),
        )
    );
    
    0 讨论(0)
提交回复
热议问题