>백엔드 개발 >PHP 튜토리얼 >PHP가 비누 인터페이스를 호출하면 오류가 발생합니다.

PHP가 비누 인터페이스를 호출하면 오류가 발생합니다.

WBOY
WBOY원래의
2016-10-11 14:23:281141검색

<code>SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://27.148.153.106:9090/mpserver/services/CykProcService' : Extra content at the end of the document in /Users/haua/Desktop/zuji_web/www/quan.189go.cn/test2.php:47 Stack trace: #0 /Users/haua/Desktop/zuji_web/www/quan.189go.cn/test2.php
</code>

위 내용은 오류 보고입니다

<code>$client = new SoapClient("http://27.148.153.106:9090/mpserver/services/CykProcService");
print_r($client->__getFunctions());
</code>

위가 제 코드이고, 다음이 wsdl입니다

<code><?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://client.webservice.mpserver.ptnetwork.com" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://client.webservice.mpserver.ptnetwork.com" xmlns:intf="http://client.webservice.mpserver.ptnetwork.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)-->

   <wsdl:message name="doProcResponse">

      <wsdl:part name="doProcReturn" type="xsd:int"/>

   </wsdl:message>

   <wsdl:message name="doProcRequest">

      <wsdl:part name="seq" type="xsd:string"/>

      <wsdl:part name="userId" type="xsd:string"/>

      <wsdl:part name="type" type="xsd:int"/>

      <wsdl:part name="sign" type="xsd:string"/>

   </wsdl:message>

   <wsdl:portType name="CykProcService">

      <wsdl:operation name="doProc" parameterOrder="seq userId type sign">

         <wsdl:input message="impl:doProcRequest" name="doProcRequest"/>

         <wsdl:output message="impl:doProcResponse" name="doProcResponse"/>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="CykProcServiceSoapBinding" type="impl:CykProcService">

      <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>

      <wsdl:operation name="doProc">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="doProcRequest">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://client.webservice.mpserver.ptnetwork.com" use="encoded"/>

         </wsdl:input>

         <wsdl:output name="doProcResponse">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://client.webservice.mpserver.ptnetwork.com" use="encoded"/>

         </wsdl:output>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="CykProcServiceService">

      <wsdl:port binding="impl:CykProcServiceSoapBinding" name="CykProcService">

         <wsdlsoap:address location="http://27.148.153.106:9090/mpserver/services/CykProcService"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>
</code>

마지막으로 http 인터페이스를 호출했을 때 헤더도 설정했습니다(아래 코드 참조). 이 비누를 설정하는 방법을 모르겠습니다.

<code>$ch = curl_init();
curl_setopt ( $ch, CURLOPT_HTTPHEADER, array (//不知道为什么一定要这个他们才能接收到post数据
    'content-type: text/html'
));</code>

답글 내용:

<code>SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://27.148.153.106:9090/mpserver/services/CykProcService' : Extra content at the end of the document in /Users/haua/Desktop/zuji_web/www/quan.189go.cn/test2.php:47 Stack trace: #0 /Users/haua/Desktop/zuji_web/www/quan.189go.cn/test2.php
</code>

위 내용은 오류 보고입니다

<code>$client = new SoapClient("http://27.148.153.106:9090/mpserver/services/CykProcService");
print_r($client->__getFunctions());
</code>

위가 제 코드이고, 다음이 wsdl입니다

<code><?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://client.webservice.mpserver.ptnetwork.com" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://client.webservice.mpserver.ptnetwork.com" xmlns:intf="http://client.webservice.mpserver.ptnetwork.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)-->

   <wsdl:message name="doProcResponse">

      <wsdl:part name="doProcReturn" type="xsd:int"/>

   </wsdl:message>

   <wsdl:message name="doProcRequest">

      <wsdl:part name="seq" type="xsd:string"/>

      <wsdl:part name="userId" type="xsd:string"/>

      <wsdl:part name="type" type="xsd:int"/>

      <wsdl:part name="sign" type="xsd:string"/>

   </wsdl:message>

   <wsdl:portType name="CykProcService">

      <wsdl:operation name="doProc" parameterOrder="seq userId type sign">

         <wsdl:input message="impl:doProcRequest" name="doProcRequest"/>

         <wsdl:output message="impl:doProcResponse" name="doProcResponse"/>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="CykProcServiceSoapBinding" type="impl:CykProcService">

      <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>

      <wsdl:operation name="doProc">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="doProcRequest">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://client.webservice.mpserver.ptnetwork.com" use="encoded"/>

         </wsdl:input>

         <wsdl:output name="doProcResponse">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://client.webservice.mpserver.ptnetwork.com" use="encoded"/>

         </wsdl:output>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="CykProcServiceService">

      <wsdl:port binding="impl:CykProcServiceSoapBinding" name="CykProcService">

         <wsdlsoap:address location="http://27.148.153.106:9090/mpserver/services/CykProcService"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>
</code>

마지막으로 http 인터페이스를 호출했을 때 헤더도 설정했습니다(아래 코드 참조). 이 비누를 설정하는 방법을 모르겠습니다.

<code>$ch = curl_init();
curl_setopt ( $ch, CURLOPT_HTTPHEADER, array (//不知道为什么一定要这个他们才能接收到post数据
    'content-type: text/html'
));</code>
성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.