- <definitions name="AuthorizationService" targetNamespace="http://service.authorize.XXXX.com/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://service.authorize.XXXX.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <types>
- <xs:schema targetNamespace="http://service.authorize.XXXX.com/" version="1.0" xmlns:tns="http://service.authorize.XXXX.com/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="checkGoodsAuthorization" type="tns:checkGoodsAuthorization" /> 
  <xs:element name="checkGoodsAuthorizationResponse" type="tns:checkGoodsAuthorizationResponse" /> 
  <xs:element name="checkProductAuthorization" type="tns:checkProductAuthorization" /> 
  <xs:element name="checkProductAuthorizationResponse" type="tns:checkProductAuthorizationResponse" /> 
  <xs:element name="checkResourceAuthorization" type="tns:checkResourceAuthorization" /> 
  <xs:element name="checkResourceAuthorizationResponse" type="tns:checkResourceAuthorizationResponse" /> 
  <xs:element name="productAuthorization" type="tns:productAuthorization" /> 
  <xs:element name="productAuthorizationResponse" type="tns:productAuthorizationResponse" /> 
- <xs:complexType name="checkProductAuthorization">
- <xs:sequence>
  <xs:element maxOccurs="unbounded" minOccurs="0" name="authoReq" type="tns:authoReq" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="authoReq">
- <xs:sequence>
  <xs:element minOccurs="0" name="productId" type="xs:string" /> 
  <xs:element minOccurs="0" name="resourceId" type="xs:int" /> 
  <xs:element minOccurs="0" name="serviceCode" type="xs:string" /> 
  <xs:element minOccurs="0" name="userId" type="xs:string" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="checkProductAuthorizationResponse">
- <xs:sequence>
  <xs:element maxOccurs="unbounded" minOccurs="0" name="return" type="tns:authoResultVo" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="authoResultVo">
- <xs:sequence>
  <xs:element minOccurs="0" name="authorizationVo" type="tns:authorizationVo" /> 
  <xs:element minOccurs="0" name="resultVo" type="tns:resultVo" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="authorizationVo">
- <xs:sequence>
  <xs:element minOccurs="0" name="authorityId" type="xs:string" /> 
  <xs:element minOccurs="0" name="availDateTime" type="xs:dateTime" /> 
  <xs:element minOccurs="0" name="beginTime" type="xs:dateTime" /> 
  <xs:element minOccurs="0" name="endTime" type="xs:dateTime" /> 
  <xs:element minOccurs="0" name="invalidationTime" type="xs:dateTime" /> 
  <xs:element minOccurs="0" name="productId" type="xs:string" /> 
  <xs:element name="productNumber" type="xs:int" /> 
  <xs:element minOccurs="0" name="productUnit" type="xs:string" /> 
  <xs:element minOccurs="0" name="userId" type="xs:string" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="resultVo">
- <xs:complexContent>
- <xs:extension base="tns:abstractReturnVo">
  <xs:sequence /> 
  </xs:extension>
  </xs:complexContent>
  </xs:complexType>
- <xs:complexType name="abstractReturnVo">
- <xs:sequence>
  <xs:element minOccurs="0" name="resultCode" type="xs:string" /> 
  <xs:element minOccurs="0" name="resultMessage" type="xs:string" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="productAuthorization">
- <xs:sequence>
  <xs:element maxOccurs="unbounded" minOccurs="0" name="productAuthoReq" type="tns:productAuthoReq" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="productAuthoReq">
- <xs:sequence>
  <xs:element minOccurs="0" name="productId" type="xs:string" /> 
  <xs:element minOccurs="0" name="userId" type="xs:string" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="productAuthorizationResponse">
- <xs:sequence>
  <xs:element minOccurs="0" name="return" type="tns:productAuthoResultVo" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="productAuthoResultVo">
- <xs:complexContent>
- <xs:extension base="tns:abstractReturnVo">
- <xs:sequence>
  <xs:element minOccurs="0" name="authorityId" type="xs:string" /> 
  <xs:element minOccurs="0" name="availDateTime" type="xs:dateTime" /> 
  <xs:element minOccurs="0" name="invalidationTime" type="xs:dateTime" /> 
  </xs:sequence>
  </xs:extension>
  </xs:complexContent>
  </xs:complexType>
- <xs:complexType name="checkGoodsAuthorization">
- <xs:sequence>
  <xs:element maxOccurs="unbounded" minOccurs="0" name="authoReq" type="tns:goodsAuthoReq" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="goodsAuthoReq">
- <xs:sequence>
  <xs:element minOccurs="0" name="goodsId" type="xs:string" /> 
  <xs:element minOccurs="0" name="serviceCode" type="xs:string" /> 
  <xs:element minOccurs="0" name="userId" type="xs:string" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="checkGoodsAuthorizationResponse">
- <xs:sequence>
  <xs:element maxOccurs="unbounded" minOccurs="0" name="return" type="tns:authoResultVo" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="checkResourceAuthorization">
- <xs:sequence>
  <xs:element maxOccurs="unbounded" minOccurs="0" name="authoReq" type="tns:resourceAuthReg" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="resourceAuthReg">
- <xs:sequence>
  <xs:element minOccurs="0" name="goodsId" type="xs:string" /> 
  <xs:element name="needPrice" type="xs:int" /> 
  <xs:element minOccurs="0" name="resourceId" type="xs:string" /> 
  <xs:element minOccurs="0" name="subGoodsId" type="xs:string" /> 
  <xs:element minOccurs="0" name="subResourceId" type="xs:string" /> 
  <xs:element minOccurs="0" name="userId" type="xs:string" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="checkResourceAuthorizationResponse">
- <xs:sequence>
  <xs:element maxOccurs="unbounded" minOccurs="0" name="return" type="tns:resAuthoResultVo" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="resAuthoResultVo">
- <xs:complexContent>
- <xs:extension base="tns:authoResultVo">
- <xs:sequence>
  <xs:element minOccurs="0" name="goodsInfo" type="tns:preferentialPolicy" /> 
  <xs:element minOccurs="0" name="subGoodsInfo" type="tns:preferentialPolicy" /> 
  </xs:sequence>
  </xs:extension>
  </xs:complexContent>
  </xs:complexType>
- <xs:complexType name="preferentialPolicy">
- <xs:sequence>
  <xs:element minOccurs="0" name="dateBegin" type="xs:dateTime" /> 
  <xs:element minOccurs="0" name="dateEnd" type="xs:dateTime" /> 
  <xs:element name="discount" type="xs:float" /> 
  <xs:element name="expenditure" type="xs:float" /> 
  <xs:element minOccurs="0" name="name" type="xs:string" /> 
  <xs:element name="pattern" type="xs:int" /> 
  <xs:element minOccurs="0" name="policyCode" type="xs:string" /> 
  <xs:element name="policyId" type="xs:int" /> 
  <xs:element name="price" type="xs:float" /> 
  <xs:element name="priority" type="xs:int" /> 
  <xs:element name="productOfferingId" type="xs:int" /> 
  <xs:element minOccurs="0" name="timeBegin" type="xs:dateTime" /> 
  <xs:element minOccurs="0" name="timeEnd" type="xs:dateTime" /> 
  <xs:element name="weekBegin" type="xs:int" /> 
  <xs:element name="weekEnd" type="xs:int" /> 
  </xs:sequence>
  </xs:complexType>
  </xs:schema>
  </types>
- <message name="Authorization_productAuthorization">
  <part element="tns:productAuthorization" name="productAuthorization" /> 
  </message>
- <message name="Authorization_checkResourceAuthorization">
  <part element="tns:checkResourceAuthorization" name="checkResourceAuthorization" /> 
  </message>
- <message name="Authorization_checkResourceAuthorizationResponse">
  <part element="tns:checkResourceAuthorizationResponse" name="checkResourceAuthorizationResponse" /> 
  </message>
- <message name="Authorization_checkGoodsAuthorizationResponse">
  <part element="tns:checkGoodsAuthorizationResponse" name="checkGoodsAuthorizationResponse" /> 
  </message>
- <message name="Authorization_productAuthorizationResponse">
  <part element="tns:productAuthorizationResponse" name="productAuthorizationResponse" /> 
  </message>
- <message name="Authorization_checkGoodsAuthorization">
  <part element="tns:checkGoodsAuthorization" name="checkGoodsAuthorization" /> 
  </message>
- <message name="Authorization_checkProductAuthorization">
  <part element="tns:checkProductAuthorization" name="checkProductAuthorization" /> 
  </message>
- <message name="Authorization_checkProductAuthorizationResponse">
  <part element="tns:checkProductAuthorizationResponse" name="checkProductAuthorizationResponse" /> 
  </message>
- <portType name="Authorization">
- <operation name="checkGoodsAuthorization" parameterOrder="checkGoodsAuthorization">
  <input message="tns:Authorization_checkGoodsAuthorization" /> 
  <output message="tns:Authorization_checkGoodsAuthorizationResponse" /> 
  </operation>
- <operation name="checkProductAuthorization" parameterOrder="checkProductAuthorization">
  <input message="tns:Authorization_checkProductAuthorization" /> 
  <output message="tns:Authorization_checkProductAuthorizationResponse" /> 
  </operation>
- <operation name="checkResourceAuthorization" parameterOrder="checkResourceAuthorization">
  <input message="tns:Authorization_checkResourceAuthorization" /> 
  <output message="tns:Authorization_checkResourceAuthorizationResponse" /> 
  </operation>
- <operation name="productAuthorization" parameterOrder="productAuthorization">
  <input message="tns:Authorization_productAuthorization" /> 
  <output message="tns:Authorization_productAuthorizationResponse" /> 
  </operation>
  </portType>
php soap wdsl

解决方案 »

  1.   

    - <binding name="AuthorizationBinding" type="tns:Authorization">
      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> 
    - <operation name="checkGoodsAuthorization">
      <soap:operation soapAction="" /> 
    - <input>
      <soap:body use="literal" /> 
      </input>
    - <output>
      <soap:body use="literal" /> 
      </output>
      </operation>
    - <operation name="checkProductAuthorization">
      <soap:operation soapAction="" /> 
    - <input>
      <soap:body use="literal" /> 
      </input>
    - <output>
      <soap:body use="literal" /> 
      </output>
      </operation>
    - <operation name="checkResourceAuthorization">
      <soap:operation soapAction="" /> 
    - <input>
      <soap:body use="literal" /> 
      </input>
    - <output>
      <soap:body use="literal" /> 
      </output>
      </operation>
    - <operation name="productAuthorization">
      <soap:operation soapAction="" /> 
    - <input>
      <soap:body use="literal" /> 
      </input>
    - <output>
      <soap:body use="literal" /> 
      </output>
      </operation>
      </binding>
    - <service name="AuthorizationService">
    - <port binding="tns:AuthorizationBinding" name="AuthorizationPort">
      <soap:address location="http://JX-AAA2:8087/AAA/AuthorizationService" /> 
      </port>
      </service>
      </definitions>
    上面是打开  ‘http://192.168.10.130:8087/AAA/AuthorizationService?wsdl’ 这个出现的东西
      php 代码
    $productId='111';
    $userId='222';
      $ws     = "http://192.168.10.130:8087/AAA/AuthorizationService?wsdl";//url
    $param = array('productId'=>$productId, 'userId'=>$userId);//参数
    $client = new SoapClient($ws);//对象$aludt=$client->productAuthorization($param);var_dump($aludt);
    运行后返回object(stdClass)#6 (1) {
      ["return"] => object(stdClass)#7 (2) {
        ["resultCode"] => string(4) "1000"
        ["resultMessage"] => string(18) "传入参数为空"
      }
    }看了这个地址
    http://www.vankouteren.eu/blog/2009/03/simple-php-soap-example/
    上面写的意思是先传入参数
    $aludt=$client->productAuthoReq($param);//传参数   运行就会显示   Function ("productAuthoReq") is not a valid method for this service 
    $result=$aludt->productAuthorization->productAuthoReq;//返回数据提示服务端找不到  ‘productAuthoReq’函数  请问如何传入参数啊。搞了好几天了。就是不行。java的可以正常用。我用php就没搞定。愁死我了
    java程序员告诉我说  productAuthorization  这个就是返回数据的服务端函数。他那边直接调用就会返回。服务端就接收参数了。php我没搞定请大侠帮忙。谢谢了
      

  2.   

    SOAP服务器提供的开放函数:
    array(4) {
      [0]=>
      string(105) "checkGoodsAuthorizationResponse checkGoodsAuthorization(checkGoodsAuthorization $checkGoodsAuthorization)"
      [1]=>
      string(113) "checkProductAuthorizationResponse checkProductAuthorization(checkProductAuthorization $checkProductAuthorization)"
      [2]=>
      string(117) "checkResourceAuthorizationResponse checkResourceAuthorization(checkResourceAuthorization $checkResourceAuthorization)"
      [3]=>
      string(93) "productAuthorizationResponse productAuthorization(productAuthorization $productAuthorization)"
    }SOAP服务器提供的Type:
    array(19) {
      [0]=>
      string(56) "struct checkProductAuthorization {
     authoReq authoReq;
    }"
      [1]=>
      string(92) "struct authoReq {
     string productId;
     int resourceId;
     string serviceCode;
     string userId;
    }"
      [2]=>
      string(67) "struct checkProductAuthorizationResponse {
     authoResultVo return;
    }"
      [3]=>
      string(78) "struct authoResultVo {
     authorizationVo authorizationVo;
     resultVo resultVo;
    }"
      [4]=>
      string(216) "struct authorizationVo {
     string authorityId;
     dateTime availDateTime;
     dateTime beginTime;
     dateTime endTime;
     dateTime invalidationTime;
     string productId;
     int productNumber;
     string productUnit;
     string userId;
    }"
      [5]=>
      string(19) "struct resultVo {
    }"
      [6]=>
      string(70) "struct abstractReturnVo {
     string resultCode;
     string resultMessage;
    }"
      [7]=>
      string(65) "struct productAuthorization {
     productAuthoReq productAuthoReq;
    }"
      [8]=>
      string(61) "struct productAuthoReq {
     string productId;
     string userId;
    }"
      [9]=>
      string(69) "struct productAuthorizationResponse {
     productAuthoResultVo return;
    }"
      [10]=>
      string(105) "struct productAuthoResultVo {
     string authorityId;
     dateTime availDateTime;
     dateTime invalidationTime;
    }"
      [11]=>
      string(59) "struct checkGoodsAuthorization {
     goodsAuthoReq authoReq;
    }"
      [12]=>
      string(78) "struct goodsAuthoReq {
     string goodsId;
     string serviceCode;
     string userId;
    }"
      [13]=>
      string(65) "struct checkGoodsAuthorizationResponse {
     authoResultVo return;
    }"
      [14]=>
      string(64) "struct checkResourceAuthorization {
     resourceAuthReg authoReq;
    }"
      [15]=>
      string(138) "struct resourceAuthReg {
     string goodsId;
     int needPrice;
     string resourceId;
     string subGoodsId;
     string subResourceId;
     string userId;
    }"
      [16]=>
      string(71) "struct checkResourceAuthorizationResponse {
     resAuthoResultVo return;
    }"
      [17]=>
      string(92) "struct resAuthoResultVo {
     preferentialPolicy goodsInfo;
     preferentialPolicy subGoodsInfo;
    }"
      [18]=>
      string(292) "struct preferentialPolicy {
     dateTime dateBegin;
     dateTime dateEnd;
     float discount;
     float expenditure;
     string name;
     int pattern;
     string policyCode;
     int policyId;
     float price;
     int priority;
     int productOfferingId;
     dateTime timeBegin;
     dateTime timeEnd;
     int weekBegin;
     int weekEnd;
    }"
    }
      

  3.   

    由  [7]=>
      string(65) "struct productAuthorization {
     productAuthoReq productAuthoReq;
    }"
      [8]=>
      string(61) "struct productAuthoReq {
     string productId;
     string userId;
    }"
    可知:参数应为
    $param['productAuthoReq'] = array('productId'=>$productId, 'userId'=>$userId);//参数
    是一个巢状数组
      

  4.   

    一语道破玄机。问题解决。谢谢
    太感谢 xuzuning 版主。