A
A
AlexSer2020-05-26 10:19:50
PHP
AlexSer, 2020-05-26 10:19:50

How to write a request for SOAP WSDL?

Request example:
url: https://nsi.rosminzdrav.ru/wsdl/SOAP-server.v2.php...
Request example for the getRefbook method

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:service">    <soapenv:Header/>    
<soapenv:Body>       
<urn:getRefbook>         
 <userKey>1111f0cf-b111-1d11-a111-1cee1111d111</userKey>          
<refbookCode>1.2.643.5.1.13.2.1.1.194</refbookCode>          
<version>1.0</version> 
 </urn:getRefbook>   
 </soapenv:Body> 
</soapenv:Envelope>


My code:
public  function  actionIndex(){
            $client = new SoapClient("https://nsi.rosminzdrav.ru/wsdl/SOAP-server.v2.php?wsdl");
           var_dump($client->getRefbook());
        }

But there is no result

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2020-05-26
@AlexSer

We look at the description of getRefbook:

<operation name="getRefbook">
  <documentation>
    Возвращает полную указанную версию справочника, если это возможно
  </documentation>
  <input message="typens:getRefbook"> </input>
  <output message="typens:getRefbookResponse"> </output>
</operation>

We see that the set of parameters described in types:getRefbook is accepted as input. Looking for it:
<message name="getRefbook">
  <part name="userKey" type="xsd:string"> </part>
  <part name="refbookCode" type="xsd:string"> </part>
  <part name="version" type="xsd:string"> </part>
</message>

That is, you need to pass three string parameters. Judging by the names, this is a user key, a directory identifier, and, I assume, an api version.
$client->getRefbook([
  'userKey' => '1111f0cf-b111-1d11-a111-1cee1111d111',
  'refbookCode' => '1.2.643.5.1.13.2.1.1.194',
  'version' => '1.0'
]);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question