douke1905 2019-05-15 11:39
浏览 47

通过SOAP Api在PHP中进行Gzip压缩

I want to get response from soap in compressed format so that fetching time will be reduce. I get only plain xml response.

I have tried to put http request to 'Accept-Encoding'=>'gzip'. That dont work. I am running PHP 7 and nginx.

$exoport = new SoapClient('www.example.com/Export.asmx?wsdl',array(
       'cache_wsdl' => WSDL_CACHE_NONE,
        'stream_context'=>stream_context_create(
            array('http'=>
              array(
                   'protocol_version'=>'1.0',
                'header' => 'Connection: Close',
                   'compression' => SOAP_COMPRESSION_ACCEPT | 
            SOAP_COMPRESSION_GZIP | SOAP_COMPRESSION_DEFLATE
             )
           )
        )
   ));

I get only xml responses in plain text. Is there any method to get file in compressed format?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥35 平滑拟合曲线该如何生成
    • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
    • ¥15 名为“Product”的列已属于此 DataTable
    • ¥15 安卓adb backup备份应用数据失败
    • ¥15 eclipse运行项目时遇到的问题
    • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
    • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
    • ¥15 自己瞎改改,结果现在又运行不了了
    • ¥15 链式存储应该如何解决
    • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站