这越来越荒谬了。我已经在这 3 周试图获得 wsdl 生成的 xml,但我什么也得不到。我正在使用 PHP 来生成请求。这里的服务描述:
<wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://tempuri.org/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<s:element name="GetListaCategorii">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="CodClient" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Parola" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetListaCategoriiResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetListaCategoriiResult" type="tns:ListaCategorii"/>
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="ListaCategorii">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="Nrreg" type="s:int"/>
<s:element minOccurs="0" maxOccurs="1" name="Categorii" type="tns:ArrayOfCategorie"/>
</s:sequence>
</s:complexType>
<s:complexType name="ArrayOfCategorie">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="Categorie" nillable="true" type="tns:Categorie"/>
</s:sequence>
</s:complexType>
<s:complexType name="Categorie">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Categorie" type="s:string"/>
</s:sequence>
</s:complexType>
<s:element name="GetCatalog">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="CodClient" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Parola" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Categorie" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetCatalogResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetCatalogResult" type="tns:Catalog"/>
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="Catalog">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="Nrreg" type="s:int"/>
<s:element minOccurs="0" maxOccurs="1" name="Produse" type="tns:ArrayOfProdus"/>
</s:sequence>
</s:complexType>
<s:complexType name="ArrayOfProdus">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="Produs" nillable="true" type="tns:Produs"/>
</s:sequence>
</s:complexType>
<s:complexType name="Produs">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="CodProdus" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Denumire" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Categorie" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="CodProducator" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Producator" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Pret" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Moneda" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Instoc" type="s:string"/>
</s:sequence>
</s:complexType>
<s:element name="hello">
<s:complexType/>
</s:element>
<s:element name="helloResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="helloResult"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetCatalogTot">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="CodClient" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Parola" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetCatalogTotResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetCatalogTotResult" type="tns:Catalog"/>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="GetListaCategoriiSoapIn">
<wsdl:part name="parameters" element="tns:GetListaCategorii"/>
</wsdl:message>
<wsdl:message name="GetListaCategoriiSoapOut">
<wsdl:part name="parameters" element="tns:GetListaCategoriiResponse"/>
</wsdl:message>
<wsdl:message name="GetCatalogSoapIn">
<wsdl:part name="parameters" element="tns:GetCatalog"/>
</wsdl:message>
<wsdl:message name="GetCatalogSoapOut">
<wsdl:part name="parameters" element="tns:GetCatalogResponse"/>
</wsdl:message>
<wsdl:message name="helloSoapIn">
<wsdl:part name="parameters" element="tns:hello"/>
</wsdl:message>
<wsdl:message name="helloSoapOut">
<wsdl:part name="parameters" element="tns:helloResponse"/>
</wsdl:message>
<wsdl:message name="GetCatalogTotSoapIn">
<wsdl:part name="parameters" element="tns:GetCatalogTot"/>
</wsdl:message>
<wsdl:message name="GetCatalogTotSoapOut">
<wsdl:part name="parameters" element="tns:GetCatalogTotResponse"/>
</wsdl:message>
<wsdl:portType name="ZCatalogDistributionSoap">
<wsdl:operation name="GetListaCategorii">
<wsdl:input message="tns:GetListaCategoriiSoapIn"/>
<wsdl:output message="tns:GetListaCategoriiSoapOut"/>
</wsdl:operation>
<wsdl:operation name="GetCatalog">
<wsdl:input message="tns:GetCatalogSoapIn"/>
<wsdl:output message="tns:GetCatalogSoapOut"/>
</wsdl:operation>
<wsdl:operation name="hello">
<wsdl:input message="tns:helloSoapIn"/>
<wsdl:output message="tns:helloSoapOut"/>
</wsdl:operation>
<wsdl:operation name="GetCatalogTot">
<wsdl:input message="tns:GetCatalogTotSoapIn"/>
<wsdl:output message="tns:GetCatalogTotSoapOut"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ZCatalogDistributionSoap" type="tns:ZCatalogDistributionSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="GetListaCategorii">
<soap:operation soapAction="http://tempuri.org/GetListaCategorii" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetCatalog">
<soap:operation soapAction="http://tempuri.org/GetCatalog" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="hello">
<soap:operation soapAction="http://tempuri.org/hello" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetCatalogTot">
<soap:operation soapAction="http://tempuri.org/GetCatalogTot" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="ZCatalogDistributionSoap12" type="tns:ZCatalogDistributionSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="GetListaCategorii">
<soap12:operation soapAction="http://tempuri.org/GetListaCategorii" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetCatalog">
<soap12:operation soapAction="http://tempuri.org/GetCatalog" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="hello">
<soap12:operation soapAction="http://tempuri.org/hello" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetCatalogTot">
<soap12:operation soapAction="http://tempuri.org/GetCatalogTot" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ZCatalogDistribution">
<wsdl:port name="ZCatalogDistributionSoap" binding="tns:ZCatalogDistributionSoap">
<soap:address location="http://exemple.com/service.asmx"/>
</wsdl:port>
<wsdl:port name="ZCatalogDistributionSoap12" binding="tns:ZCatalogDistributionSoap12">
<soap12:address location="http://exemple.com/service.asmx"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
我正在尝试使用GetListaCategorii
以下代码访问该函数:
<?xml version="1.0" encoding="utf-8"?>
<html>
<body>
<?php $client = new SoapClient("http://exemple.com/service.asmx?WSDL");
$listacateg = $client->GetListaCategorii(array("CodClient" => "my_code","Parola" => "Mypass"));
echo "<p>";
echo $listacateg->GetListaCategoriiResult->Nrreg;
echo "</p>";?>
</body>
</html>
样品请求应该是:
POST /ZCatalogVB/ZCatalogDistribution.asmx HTTP/1.1
Host: exemple.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/GetListaCategorii"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetListaCategorii xmlns="http://tempuri.org/">
<CodClient>string</CodClient>
<Parola>string</Parola>
</GetListaCategorii>
</soap:Body>
</soap:Envelope>
响应应该是
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetListaCategoriiResponse xmlns="http://tempuri.org/">
<GetListaCategoriiResult>
<Nrreg>int</Nrreg>
<Categorii>
<Categorie>
<Categorie>string</Categorie>
</Categorie>
<Categorie>
<Categorie>string</Categorie>
</Categorie>
</Categorii>
</GetListaCategoriiResult>
</GetListaCategoriiResponse>
</soap:Body>
</soap:Envelope>
请帮忙
最新输出
<pre><?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://tempuri.org/">
<SOAP-ENV:Body>
<ns1:GetListaCategorii
><ns1:CodClient>mycode</ns1:CodClient>
<ns1:Parola>mypass</ns1:Parola>
</ns1:GetListaCategorii>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>