Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/239.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在PHP中为没有库的Soap请求生成双击_Php_Soap_Wsdl_Google Dfp - Fatal编程技术网

在PHP中为没有库的Soap请求生成双击

在PHP中为没有库的Soap请求生成双击,php,soap,wsdl,google-dfp,Php,Soap,Wsdl,Google Dfp,我被困在一个无法使用PHPDFP库的环境中开发。我正在使用PHP的SoapClient,但在为SOAP请求正确生成头时遇到了问题。下面是一个例子: <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XM

我被困在一个无法使用PHPDFP库的环境中开发。我正在使用PHP的SoapClient,但在为SOAP请求正确生成头时遇到了问题。下面是一个例子:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
        xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Header>
    <ns1:RequestHeader 
         soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
         soapenv:mustUnderstand="0"
         xmlns:ns1="https://www.google.com/apis/ads/publisher/v201308">
      <ns1:authentication xsi:type="ns1:ClientLogin"  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
         <ns1:token>SuchALongToken</ns1:token>
      </ns1:authentication>
      <ns1:networkCode>123456</ns1:networkCode>
      <ns1:applicationName>DfpApi-Java-2.1.0-dfp_test</ns1:applicationName>
    </ns1:RequestHeader>
  </soapenv:Header>
  <soapenv:Body>
    <getAdUnitsByStatement xmlns="https://www.google.com/apis/ads/publisher/v201308">
      <filterStatement>
        <query>WHERE parentId IS NULL LIMIT 500</query>
      </filterStatement>
    </getAdUnitsByStatement>
  </soapenv:Body>
</soapenv:Envelope>
这让我明白了以下几点:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"  xmlns:ns1="https://www.google.com/apis/ads/publisher/v201308">
   <SOAP-ENV:Header>
      <ns1:RequestHeader>
         <ns1:networkCode>########</ns1:networkCode>
         <ns1:applicationName>Get Companies By Filter</ns1:applicationName>
         <ns1:authentication />
      </ns1:RequestHeader>
   </SOAP-ENV:Header>
   <SOAP-ENV:Body>
      <ns1:getCompaniesByStatement>
         <ns1:filterStatement />
      </ns1:getCompaniesByStatement>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

########
通过筛选获得公司
看起来wsdl拒绝了我的身份验证和filterStatement。我很高兴目前能让认证工作正常。此请求给我一个“解组”错误

任何帮助都将不胜感激

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"  xmlns:ns1="https://www.google.com/apis/ads/publisher/v201308">
   <SOAP-ENV:Header>
      <ns1:RequestHeader>
         <ns1:networkCode>########</ns1:networkCode>
         <ns1:applicationName>Get Companies By Filter</ns1:applicationName>
         <ns1:authentication />
      </ns1:RequestHeader>
   </SOAP-ENV:Header>
   <SOAP-ENV:Body>
      <ns1:getCompaniesByStatement>
         <ns1:filterStatement />
      </ns1:getCompaniesByStatement>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>