Answer the question
In order to leave comments, you need to log in
How to connect to SOAP?
Unable to retrieve data from SOAP.
There is a server with WSDL, to which I connect via PHP to get information, but apparently I messed up somewhere in the request. What is wrong, please help!
PHP request:
ini_set('soap.wsdl_cache_enabled', '0');
ini_set('soap.wsdl_cache_ttl', '0');
set_include_path(get_include_path()
.PATH_SEPARATOR.'classes'
.PATH_SEPARATOR.'objects');
function __autoload($class_name){
include $class_name.'.class.php';
}
class ULQuery{
public $Inn;
public $Name;
public $Ogrn;
}
class parameters{
public $ULQuery;
}
// создаем объект для отправки на сервер
$req = new parameters();
$req->ULQuery = new ULQuery();
$req->ULQuery->Inn = '';
$req->ULQuery->Name = '';
$req->ULQuery->Ogrn = '1020201012974';
$client = new SoapClient("http://10.10.59.214/EgrulService.svc?wsdl", array("trace" => true, 'soap_version' => SOAP_1_1));
$header = array();
var_dump($client->CreateStatement());
?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" name="EgrulService" targetNamespace="http://tempuri.org/">
<wsdl:types>
<xsd:schema targetNamespace="http://tempuri.org/Imports">
<xsd:import schemaLocation="http://10.10.59.214/EgrulService.svc?xsd=xsd0" namespace="http://tempuri.org/"/>
<xsd:import schemaLocation="http://10.10.59.214/EgrulService.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
<xsd:import schemaLocation="http://10.10.59.214/EgrulService.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/Mirea.Egrul.WebServices"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="IEgrulService_CreateStatement_InputMessage">
<wsdl:part name="parameters" element="tns:CreateStatement"/>
</wsdl:message>
<wsdl:message name="IEgrulService_CreateStatement_OutputMessage">
<wsdl:part name="parameters" element="tns:CreateStatementResponse"/>
</wsdl:message>
<wsdl:portType name="IEgrulService">
<wsdl:operation name="CreateStatement">
<wsdl:input wsaw:Action="http://tempuri.org/IEgrulService/CreateStatement" message="tns:IEgrulService_CreateStatement_InputMessage"/>
<wsdl:output wsaw:Action="http://tempuri.org/IEgrulService/CreateStatementResponse" message="tns:IEgrulService_CreateStatement_OutputMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BasicHttpBinding_IEgrulService" type="tns:IEgrulService">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="CreateStatement">
<soap:operation soapAction="http://tempuri.org/IEgrulService/CreateStatement" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="EgrulService">
<wsdl:port name="BasicHttpBinding_IEgrulService" binding="tns:BasicHttpBinding_IEgrulService">
<soap:address location="http://10.10.59.214/EgrulService.svc"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.datacontract.org/2004/07/Mirea.Egrul.WebServices" elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/Mirea.Egrul.WebServices">
<xs:complexType name="ULQuery">
<xs:sequence>
<xs:element minOccurs="0" name="Inn" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="Name" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="Ogrn" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="ULQuery" nillable="true" type="tns:ULQuery"/>
<xs:complexType name="StatementInfo">
<xs:sequence>
<xs:element minOccurs="0" name="ErrorMessage" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="IsSuccess" type="xs:boolean"/>
<xs:element minOccurs="0" name="StatementUrl" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="StatementInfo" nillable="true" type="tns:StatementInfo"/>
</xs:schema>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question