<legend id='iDVe6'><style id='iDVe6'><dir id='iDVe6'><q id='iDVe6'></q></dir></style></legend>

      <small id='iDVe6'></small><noframes id='iDVe6'>

      <tfoot id='iDVe6'></tfoot>

        • <bdo id='iDVe6'></bdo><ul id='iDVe6'></ul>
      1. <i id='iDVe6'><tr id='iDVe6'><dt id='iDVe6'><q id='iDVe6'><span id='iDVe6'><b id='iDVe6'><form id='iDVe6'><ins id='iDVe6'></ins><ul id='iDVe6'></ul><sub id='iDVe6'></sub></form><legend id='iDVe6'></legend><bdo id='iDVe6'><pre id='iDVe6'><center id='iDVe6'></center></pre></bdo></b><th id='iDVe6'></th></span></q></dt></tr></i><div id='iDVe6'><tfoot id='iDVe6'></tfoot><dl id='iDVe6'><fieldset id='iDVe6'></fieldset></dl></div>

        SoapClient 设置自定义 HTTP Header

        时间:2023-05-22

        <i id='Qa7K9'><tr id='Qa7K9'><dt id='Qa7K9'><q id='Qa7K9'><span id='Qa7K9'><b id='Qa7K9'><form id='Qa7K9'><ins id='Qa7K9'></ins><ul id='Qa7K9'></ul><sub id='Qa7K9'></sub></form><legend id='Qa7K9'></legend><bdo id='Qa7K9'><pre id='Qa7K9'><center id='Qa7K9'></center></pre></bdo></b><th id='Qa7K9'></th></span></q></dt></tr></i><div id='Qa7K9'><tfoot id='Qa7K9'></tfoot><dl id='Qa7K9'><fieldset id='Qa7K9'></fieldset></dl></div>

            <tfoot id='Qa7K9'></tfoot>
          1. <small id='Qa7K9'></small><noframes id='Qa7K9'>

                <bdo id='Qa7K9'></bdo><ul id='Qa7K9'></ul>
                <legend id='Qa7K9'><style id='Qa7K9'><dir id='Qa7K9'><q id='Qa7K9'></q></dir></style></legend>
                  <tbody id='Qa7K9'></tbody>

                • 本文介绍了SoapClient 设置自定义 HTTP Header的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我正在编写一个基于 PHP 的 SOAP 客户端应用程序,该应用程序使用 PHP5 原生的 SOAP 库.我需要发送一个 HTTP cookie 和一个额外的 HTTP 标头作为请求的一部分.cookie部分没问题:

                  I am doing some work writing a PHP-based SOAP client application that uses the SOAP libraries native to PHP5. I need to send a an HTTP cookie and an additional HTTP header as part of the request. The cookie part is no problem:

                  代码:

                  $client = new SoapClient($webServiceURI, array("exceptions" => 0, "trace" => 1, "encoding" => $phpInternalEncoding));
                  $client->__setCookie($kkey, $vvalue);
                  

                  我的问题是 HTTP 标头.我希望会有一个名为

                  My problem is the HTTP header. I was hoping there would have been a function named

                  __setHeader

                  __setHttpHeader

                  在 SOAP 库中.但没有这样的运气.

                  in the SOAP libraries. But no such luck.

                  有其他人处理过这个吗?有解决方法吗?使用不同的 SOAP 库会更容易吗?谢谢.

                  Anyone else dealt with this? Is there a workaround? Would a different SOAP library be easier to work with? Thanks.

                  <子>(我在这里发现了这个悬而未决的问题 http://www.phpfreaks.com/forums/index.php?topic=125387.0,我复制了 b/c 我有同样的问题)

                  (I found this unanswerd question here http://www.phpfreaks.com/forums/index.php?topic=125387.0, I copied it b/c i've the same issue)

                  推荐答案

                  尝试为 soap 客户端设置流上下文:

                  Try setting a stream context for the soap client:

                  $client = new SoapClient($webServiceURI, array(
                      "exceptions" => 0, 
                      "trace" => 1, 
                      "encoding" => $phpInternalEncoding,
                      'stream_context' => stream_context_create(array(
                          'http' => array(
                              'header' => 'SomeCustomHeader: value'
                          ),
                      )),
                  ));
                  

                  这篇关于SoapClient 设置自定义 HTTP Header的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何摆脱“未捕获的 SoapFault 异常:[客户端] 看起 下一篇:解析 SOAP 响应

                  相关文章

                  最新文章

                  <i id='mmLYV'><tr id='mmLYV'><dt id='mmLYV'><q id='mmLYV'><span id='mmLYV'><b id='mmLYV'><form id='mmLYV'><ins id='mmLYV'></ins><ul id='mmLYV'></ul><sub id='mmLYV'></sub></form><legend id='mmLYV'></legend><bdo id='mmLYV'><pre id='mmLYV'><center id='mmLYV'></center></pre></bdo></b><th id='mmLYV'></th></span></q></dt></tr></i><div id='mmLYV'><tfoot id='mmLYV'></tfoot><dl id='mmLYV'><fieldset id='mmLYV'></fieldset></dl></div>

                        <bdo id='mmLYV'></bdo><ul id='mmLYV'></ul>
                    1. <tfoot id='mmLYV'></tfoot>

                      <legend id='mmLYV'><style id='mmLYV'><dir id='mmLYV'><q id='mmLYV'></q></dir></style></legend>

                    2. <small id='mmLYV'></small><noframes id='mmLYV'>