Answer the question
In order to leave comments, you need to log in
SOAP, PHP, how to make a request?
Hello. Didn't work with SOAP. I read the theory, roughly understood what was happening. Help make a request.
wsdl:
<xsd:element name="ZfmCrmLoyMshInf">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="IsCrd" type="tns:ZstCrdCrmLoyMshInfIn" minOccurs="0"/>
<xsd:element name="IsStore" type="tns:ZstStore" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="ZfmCrmLoyMshInfResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="EsCrd" type="tns:ZstCrdCrmLoyMshInfOut"/>
<xsd:element name="EsDynAttr" type="tns:ZstDynAttr"/>
<xsd:element name="EsLp" type="tns:ZstLp"/>
<xsd:element name="EsMemb" type="tns:ZstMemb"/>
<xsd:element name="EsMsh" type="tns:ZstMshCrmLoyMshInfOut"/>
<xsd:element name="EtCampList" type="tns:ZttChar24"/>
<xsd:element name="EtErrorList" type="tns:ZttErrorList"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="ZfmCrmLoyMshInf">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="IsCrd" type="tns:ZstCrdCrmLoyMshInfIn" minOccurs="0"/>
<xsd:element name="IsStore" type="tns:ZstStore" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="ZfmCrmLoyMshInfResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="EsCrd" type="tns:ZstCrdCrmLoyMshInfOut"/>
<xsd:element name="EsDynAttr" type="tns:ZstDynAttr"/>
<xsd:element name="EsLp" type="tns:ZstLp"/>
<xsd:element name="EsMemb" type="tns:ZstMemb"/>
<xsd:element name="EsMsh" type="tns:ZstMshCrmLoyMshInfOut"/>
<xsd:element name="EtCampList" type="tns:ZttChar24"/>
<xsd:element name="EtErrorList" type="tns:ZttErrorList"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<wsdl:operation name="ZfmCrmLoyMshInf">
<wsdl:input message="tns:ZfmCrmLoyMshInf"/>
<wsdl:output message="tns:ZfmCrmLoyMshInfResponse"/>
</wsdl:operation>
<wsdl:message name="ZfmCrmLoyMshInf">
<wsdl:part name="parameters" element="tns:ZfmCrmLoyMshInf"/>
</wsdl:message>
<wsdl:message name="ZfmCrmLoyMshInfResponse">
<wsdl:part name="parameter" element="tns:ZfmCrmLoyMshInfResponse"/>
</wsdl:message>
<soapenv:Body>
<urn:ZfmCrmLoyMshInf>
<!--Optional:-->
<IsCrd>
<ExtId>1120000000001530</ExtId>
</IsCrd>
<!--Optional:-->
<IsStore>
<Id>0003</Id>
</IsStore>
</urn:ZfmCrmLoyMshInf>
</soapenv:Body>
</soapenv:Envelope>
<soap-env:Header/>
<soap-env:Body>
<n0:ZfmCrmLoyMshInfResponse xmlns:n0="urn:sap-com:soap:functions:mc-style">
<EsCrd>
<ExtId>1120000000001530</ExtId>
<Status>Активно</Status>
<Estat>E0003</Estat>
<CardValidFrom>2013-11-07</CardValidFrom>
<CardValidTo>9999-12-31</CardValidTo>
</EsCrd>
<EsDynAttr>
<Zsumofpurch>0</Zsumofpurch>
</EsDynAttr>
<EsLp>
<Id>Zaratustra</Id>
<Name>Программа</Name>
<LoyType>B</LoyType>
</EsLp>
<EsMemb>
<Id>3000023950</Id>
<Birthdt>2013-02-29</Birthdt>
</EsMemb>
<EsMsh>
<Guid>ACFanIPNHtOR9rGVA2en1Q==</Guid>
<Status>Активно</Status>
<Estat>E0002</Estat>
<Tier>Базовый</Tier>
<Etier>GBT0_BASE</Etier>
<Balance>4000.0</Balance>
<EmemsType>STDMEM</EmemsType>
<MemsType>Участие в программе</MemsType>
</EsMsh>
<EtCampList/>
<EtErrorList>
<item>
<RType>S</RType>
<RId>ZCRM_LOY_MSH_INF</RId>
<RNum>000</RNum>
<RMessage>Информация успешно получена</RMessage>
</item>
</EtErrorList>
</n0:ZfmCrmLoyMshInfResponse>
</soap-env:Body>
</soap-env:Envelope>
...
$request = $client->ZfmCrmLoyMshInf(1120000000001530, 0002);
echo $request->ZfmCrmLoyMshInfResponse->EsCrd;
...
Answer the question
In order to leave comments, you need to log in
ini_set('soap.wsdl_cache_enabled', '0');
ini_set('soap.wsdl_cache_ttl', '0');
try {
$client = new SoapClient("адрес wsdl", array('trace' => true));
$params = array(массив параметров);
$request = $client->Register($params); // делаем запрос, здесь Register это название функции в wsdl сервисе
$itog = $request->Result; // получаем запрос и присваиваем его переменной itog. Result это название поля которое отдаст wsdl
}
catch (SoapFault $exception)
{
echo $exception->getMessage(); // ошибка если не ок
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question