A
A
Antowas2016-11-04 14:57:07
PHP
Antowas, 2016-11-04 14:57:07

How to send SOAP request via php?

How can I send this SOAP request here https://ws.intime.ua/API/ws/API20/?wsdl and get a response?

<soap:Envelope xmlns:soap='http://www.w3.org/2003/05/soap-envelope' xmlns:api2='http://www.reality.sh/in-time/Api20' xmlns:int='http://inr.intime.ua/in-time/integration20'>
   <soap:Header/>
   <soap:Body>
      <api2:AllCatalog>
         <api2:AllCatalogRequest>
            <int:Auth>
               <int:ID>2019964</int:ID>
               <int:KEY>f0235b7f-a198-11e6-ba41-0050569f7595</int:KEY>
            </int:Auth>
         </api2:AllCatalogRequest>
      </api2:AllCatalog>
   </soap:Body>
</soap:Envelope>

what is the error?
$wsdl   = "https://ws.intime.ua/API/ws/API20/?wsdl"; 
$client = new SoapClient($wsdl, array(  'soap_version' => SOAP_1_1,
                                        'trace' => true,));

    $xml = "<soap:Envelope xmlns:soap='http://www.w3.org/2003/05/soap-envelope' xmlns:api2='http://www.reality.sh/in-time/Api20' xmlns:int='http://inr.intime.ua/in-time/integration20'>
   <soap:Header/>
   <soap:Body>
      <api2:AllCatalog>
         <api2:AllCatalogRequest>
            <int:Auth>
               <int:ID>2019964</int:ID>
               <int:KEY>f0235b7f-a198-11e6-ba41-0050569f7595</int:KEY>
            </int:Auth>
         </api2:AllCatalogRequest>
      </api2:AllCatalog>
   </soap:Body>
</soap:Envelope>";

    $args = array(new SoapVar($xml, XSD_ANYXML));    
    $res  = $client->__soapCall('AllCatalog', $args);
    return $res;

efcce6c87e9546c399de5044a425d97b.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
davidnum95, 2016-11-04
@davidnum95

$client = new SoapClient('https://ws.intime.ua/API/ws/API20/?wsdl', [
            'login' => '',
            'password' => '',
            'exceptions' => 1,
        ]);

        $result = $client->AuthData([
              'ID' => '12345',
              'KEY' => '1234'
        ]);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question