php soap服务器";遗漏;服务器级别的一个参数

php soap服务器";遗漏;服务器级别的一个参数,php,soap,arguments,skip,Php,Soap,Arguments,Skip,我有一个名为createReport()的soap方法,该方法具有以下参数: function createReport($token, $reportType, $time, $content, $title, $analystEmail, $email_template, $pdfUrl, $status, $isActive, $sector, $region, $reportID){ //if the user has a bad token if ( checkToken($toke

我有一个名为createReport()的soap方法,该方法具有以下参数:

function createReport($token, $reportType, $time, $content, $title, $analystEmail, $email_template, $pdfUrl, $status, $isActive, $sector, $region, $reportID){

//if the user has a bad token
if ( checkToken($token) !== 0 ){
    return checkToken($token);
    $return->success = 0;
    $return->information = "Bad Token ".  checkToken( correctPassword() );
    return $return;
}


$return->information = '\nToken: '.$token . "\nReportType " .$reportType . "\nTime: " . $time . "\nContent: " . $content . "\nTitle: " . $title . "\nEmail: " . $analystEmail . "\nTemplate: " . $email_template . "\nPDF: " . $pdfUrl . "\nStatus: " . $status . "\nisActive: " . $isActive . "\nsector: " . $sector . "\nregion: " .$region . "\nreportID: " . $reportID;
return $return;
}
  • 代币
  • 报表类型
  • 时间
  • 内容
  • 头衔
  • 分析邮件
  • 电子邮件模板
  • pdfUrl
  • 地位
  • 活跃的
  • 扇区
  • 区域
  • 报告ID
My WSDL将参数定义为:

 <wsdl:message name="reportRequest">
  <wsdl:part name="token" type="xsd:string"/>
  <wsdl:part name="reportType" type="xsd:int"/>
  <wsdl:part name="time" type="xsd:int"/>
  <wsdl:part name="content" type="xsd:string"/>
  <wsdl:part name="title" type="xsd:string"/>
  <wsdl:part name="analystEmail" type="xsd:string"/>
  <wsdl:part name="email_template" type="xsd:string"/>
  <wsdl:part name="pdfUrl" type="xsd:string"/>
  <wsdl:part name="status" type="xsd:string"/>
  <wsdl:part name="isActive" type="xsd:boolean"/>
  <wsdl:part name="sector" type="xsd:int"/>
  <wsdl:part name="region" type="xsd:int"/>
  <wsdl:part name="reportID" type="xsd:int"/>
</wsdl:message>
当前,server is函数设置为仅返回参数列表:

function createReport($token, $reportType, $time, $content, $title, $analystEmail, $email_template, $pdfUrl, $status, $isActive, $sector, $region, $reportID){

//if the user has a bad token
if ( checkToken($token) !== 0 ){
    return checkToken($token);
    $return->success = 0;
    $return->information = "Bad Token ".  checkToken( correctPassword() );
    return $return;
}


$return->information = '\nToken: '.$token . "\nReportType " .$reportType . "\nTime: " . $time . "\nContent: " . $content . "\nTitle: " . $title . "\nEmail: " . $analystEmail . "\nTemplate: " . $email_template . "\nPDF: " . $pdfUrl . "\nStatus: " . $status . "\nisActive: " . $isActive . "\nsector: " . $sector . "\nregion: " .$region . "\nreportID: " . $reportID;
return $return;
}
生成的SOAP请求:

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:xmethods-delayed-quotes" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <SOAP-ENV:Body>
            <ns1:createReport>
                  <token xsi:type="xsd:string">8f4cf7ae4bd4ab02e591c8b0ab72fe57b4f8ad0c</token>
                  <reportType xsi:type="xsd:int">1</reportType>
                  <time xsi:type="xsd:int">1301385965</time>
                  <content xsi:type="xsd:string">content!</content>
                  <title xsi:type="xsd:string">Company Report</title>
                  <analystEmail xsi:type="xsd:string">support@website.com</analystEmail>
                  <email_template xsi:type="xsd:string">email template!</email_template>
                  <pdfUrl xsi:type="xsd:string">pdf URL</pdfUrl>
                  <status xsi:type="xsd:int">2</status>
                  <isActive xsi:type="xsd:boolean">true</isActive>
                  <sector xsi:type="xsd:int">33</sector>
                  <region xsi:type="xsd:int">-1</region>
                  <reportID xsi:type="xsd:int">1</reportID>
            </ns1:createReport>
      </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

time=“content!”?这是怎么发生的?似乎时间元素正在被跳过或拼接。。。是否有SOAP有效的(特别是客户端)解决方法?

答案是检查var_dump(),然后手动编写正确的SOAP请求和响应。这解决了问题。感谢Matt Gibson的指针。

出于兴趣,如果只传递任意整数(例如,
123
而不是
time()
?)Hrm会发生什么。并且执行
var_dump($client->u getFunctions())告诉你任何你不期望的事情?谢谢,这就解决了问题。@John没问题。出于兴趣,生成的代码丢失/添加了什么?还是参数排序之类的?老实说,我不确定。我只是摆弄它,它现在可以工作了。。。不过,这一定是一些晦涩难懂的事情。
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:xmethods-delayed-quotes" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://wood.example.net/master/api/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <SOAP-ENV:Body>
        <ns1:createReportResponse>
            <response xsi:type="ns2:ReportInfo">
                <information xsi:type="xsd:string">\nToken: 8f4cf7ae4bd4ab02e591c8b0ab72fe57b4f8ad0cReportType 1Time: content!Content: Company ReportTitle: support@website.comEmail: email template!Template: pdf URLPDF: 2Status: 1isActive: 33sector: -1region: 1reportID: </information>
                </response>
            </ns1:createReportResponse>
        </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
Token: 8f4cf7ae4bd4ab02e591c8b0ab72fe57b4f8ad0c
ReportType 1
Time: content!
Content: Company Report
Title: support@website.com
Email: email template!
Template: pdf URL
PDF: 2
Status: 1
isActive: 33
sector: -1
region: 1
reportID: