PHP-WSDL-复杂类型用法

PHP-WSDL-复杂类型用法,php,web-services,soap,wsdl,webservice-client,Php,Web Services,Soap,Wsdl,Webservice Client,我想用PHP编写一个Soap服务。 我的WSDL如下所示: <?xml version="1.0" encoding="utf-8" ?> <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://myserver.net" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w

我想用PHP编写一个Soap服务。
我的WSDL如下所示:

<?xml version="1.0" encoding="utf-8" ?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://myserver.net"  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="myService" targetNamespace="http://myserver.net">
  <wsdl:types>
    <xsd:element name="getArticleStockInput">
      <xsd:complexType>
        <xsd:sequence>
            <xsd:element minOccurs="1" maxOccurs="1" name="articleid" type="xsd:string"></xsd:element>
        </xsd:sequence>
      </xsd:complexType>
    </xsd:element>
    <xsd:element name="getArticleStockOutput">
      <xsd:complexType>
        <xsd:sequence>
            <xsd:element name="stock" type="xsd:float"></xsd:element>
        </xsd:sequence>
      </xsd:complexType>
    </xsd:element>
  </wsdl:types> 
  <wsdl:message name="getArticleStockRequest">
    <wsdl:part element="tns:getArticleStockInput" name="parameters"/>
  </wsdl:message>
  <wsdl:message name="getArticleStockResponse">
    <wsdl:part element="tns:getArticleStockOutput" name="parameters"/>
  </wsdl:message>
  <wsdl:portType name="myServiceSoap">
    <wsdl:operation name="getArticleStock">
      <wsdl:input message="tns:getArticleStockRequest"/>
      <wsdl:output message="tns:getArticleStockResponse"/>
    </wsdl:operation>   
  </wsdl:portType>  
  <wsdl:binding name="myServiceSoapHttpBinding" type="tns:myServiceSoap">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="getArticleStock">
      <soap:operation soapAction="http://myserver.net/getArticleStock"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="ShopService">
    <wsdl:port binding="tns:myServiceSoapHttpBinding" name="ShopServiceSOAP11prt_HTTP">
      <soap:address location="http://myserver.net/ws.php5"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>
现在我有两个问题。
客户1

=>日志中的服务器输出

stdClass Object
(
    [item] => stdClass Object
        (
            [key] => articleid
            [value] => 150
        )
)
为什么Log/PHP中的输出不显示Soap消息名getArticleStockRequest

如果我这样编写客户机:

ini_set("soap.wsdl_cache_enabled", "0");
$url="http://myserver.net/wsdl.wsdl"; 
$client3 = new SoapClient($url);

$parray = array("articleid" => "150");          
$result = $client3->__soapCall("getArticleStock", $parray);
日志仅包含:

150
在这种情况下,是否可以获取parm name articleid


再见,jogi

这是整个WSDL文件吗?我觉得不太对劲。。。它不应该有一个顶级元素
,包含消息和其他所有内容吗?诚然,我以前从来没有亲手写过一个……它只是wsdl的一部分——我改变了它,把整个wsdl都放到了问题中。我想。。。我在这里可能是错的,本质上是当你调用
$client3->\uuuSOAPCALL(“getArticleStock”,$parray)时会发生什么
是指数组
$parray
中的值作为函数
getArticleStock()
的参数传入(很像
调用用户函数数组('function',$arrayOfParameterValues)
),因此我认为这只是具有任何意义的值,“键”本质上就是参数变量名。好的,谢谢你。但是,处理服务器中的数据的正确方法是什么?Web服务应该由不同的用户使用。
ini_set("soap.wsdl_cache_enabled", "0");
$url="http://myserver.net/wsdl.wsdl"; 
$client3 = new SoapClient($url);

$parray = array("articleid" => "150");          
$result = $client3->__soapCall("getArticleStock", $parray);
150