2016-08-03 10 views
0

Hallo habe ich die Brache Seifephp Seife Client-Verbindung

SOAP 1.1 



POST /ServicePeletalk.asmx HTTP/1.1 
Host: 82.80.225.186 
Content-Type: text/xml; charset=utf-8 
Content-Length: length 
SOAPAction: "http://peletop.co.il/GetProducts" 

<?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> 
    <GetProducts xmlns="http://peletop.co.il/"> 
     <query> 
     <TerminalNum>string</TerminalNum> 
     <ProviderID>int</ProviderID> 
     <CardType>All or Virtual or Manual or BillPayment</CardType> 
     <Language>Hebrew or Arabic or English</Language> 
     <LoadPictures>boolean</LoadPictures> 
     </query> 
    </GetProducts> 
    </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> 
     <GetProductsResponse xmlns="http://peletop.co.il/"> 
      <GetProductsResult> 
      <Products> 
       <clsProduct> 
       <ProductIdenfity>string</ProductIdenfity> 
       <ProductName>string</ProductName> 
       <Description>string</Description> 
       <Picture>base64Binary</Picture> 
       <Price>double</Price> 
       <MaxPrice>double</MaxPrice> 
       <CardType>All or Virtual or Manual or BillPayment</CardType> 
       <DetailsLink>string</DetailsLink> 
       </clsProduct> 
       <clsProduct> 
       <ProductIdenfity>string</ProductIdenfity> 
       <ProductName>string</ProductName> 
       <Description>string</Description> 
       <Picture>base64Binary</Picture> 
       <Price>double</Price> 
       <MaxPrice>double</MaxPrice> 
       <CardType>All or Virtual or Manual or BillPayment</CardType> 
       <DetailsLink>string</DetailsLink> 
       </clsProduct> 
      </Products> 
      </GetProductsResult> 
     </GetProductsResponse> 
     </soap:Body> 
    </soap:Envelope> 

SOAP 1.2

Das folgende ist ein Beispiel SOAP 1.2 Anforderung und Antwort. Die gezeigten Platzhalter müssen durch tatsächliche Werte ersetzt werden.

POST /ServicePeletalk.asmx HTTP/1.1 
Host: 82.80.225.186 
Content-Type: application/soap+xml; charset=utf-8 
Content-Length: length 

    <?xml version="1.0" encoding="utf-8"?> 
    <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> 
     <soap12:Body> 
     <GetProducts xmlns="http://peletop.co.il/"> 
      <query> 
      <TerminalNum>string</TerminalNum> 
      <ProviderID>int</ProviderID> 
      <CardType>All or Virtual or Manual or BillPayment</CardType> 
      <Language>Hebrew or Arabic or English</Language> 
      <LoadPictures>boolean</LoadPictures> 
      </query> 
     </GetProducts> 
     </soap12:Body> 
    </soap12:Envelope> 

HTTP/1.1 200 OK 
Content-Type: application/soap+xml; charset=utf-8 
Content-Length: length 

    <?xml version="1.0" encoding="utf-8"?> 
    <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> 
     <soap12:Body> 
     <GetProductsResponse xmlns="http://peletop.co.il/"> 
      <GetProductsResult> 
      <Products> 
       <clsProduct> 
       <ProductIdenfity>string</ProductIdenfity> 
       <ProductName>string</ProductName> 
       <Description>string</Description> 
       <Picture>base64Binary</Picture> 
       <Price>double</Price> 
       <MaxPrice>double</MaxPrice> 
       <CardType>All or Virtual or Manual or BillPayment</CardType> 
       <DetailsLink>string</DetailsLink> 
       </clsProduct> 
       <clsProduct> 
       <ProductIdenfity>string</ProductIdenfity> 
       <ProductName>string</ProductName> 
       <Description>string</Description> 
       <Picture>base64Binary</Picture> 
       <Price>double</Price> 
       <MaxPrice>double</MaxPrice> 
       <CardType>All or Virtual or Manual or BillPayment</CardType> 
       <DetailsLink>string</DetailsLink> 
       </clsProduct> 
      </Products> 
      </GetProductsResult> 
     </GetProductsResponse> 
     </soap12:Body> 
    </soap12:Envelope> 

wie schreibe ich es in PHP ???

versuchte ich

<? 
    // Maximum error reporting 
    error_reporting(E_ALL); 
    ini_set('error_reporting', E_ALL); 
    ini_set('display_errors', 1); 

    $wsdl = 'http://82.80.225.186:8000/ServicePeletalk.asmx?WSDL'; 

    $trace = true; 
    $exceptions = true; 
    $client = new SoapClient($wsdl, array('trace' => $trace, 'exceptions' => $exceptions)); 


    $xml_array['TerminalNum'] = 5089 ; 
    $xml_array['UserType'] = 'SiteUser'; 
    $xml_array['Language'] = 'English'; 
    $xml_array['ConnectionOrDeviceID'] = '879d62-EA47-4520-8A29-EB5981A62DD8'; 

    try 
    { 
     $client = new SoapClient($wsdl, array('trace' => $trace, 'exceptions' => $exceptions)); 
     $response = $client->GetSellerProviders($xml_array); 
    } 
    catch (Exception $e) 
    { 
     echo "Error!"; 
     echo $e -> getMessage(); 
     echo 'Last response: '. $client->__getLastResponse(); 
    } 

?> 

es funktioniert nicht

helfen bitte

Antwort

0

Für einen ersten Blick scheint es, dass, basierend auf dem XML-Dateien, Sie haben $client->GetProducts anrufen statt $client->GetSellerProviders , weil in Ihren XML-Dateien ein Element mit dem Namen GetProducts enthalten ist.

Wenn dies war ein Tippfehler und Sie wirklich $client->GetProducts rufen dann $xml_array Struktur überprüfen, wie diese

$xml_array['query']['TerminalNum'] = 5089 ; 
$xml_array['query']['UserType'] = 'SiteUser'; 
$xml_array['query']['Language'] = 'English'; 
$xml_array['query']['ConnectionOrDeviceID'] = '879d62-EA47-4520-8A29-EB5981A62DD8'; 

umfassen query Element zu sein, wie in XML-Anforderung Probe gezeigt.

UPDATE von Kommentaren

Ich sehe, dass die Anfrage xml hat die folgenden Elemente

<TerminalNum>string</TerminalNum> 
<ProviderID>int</ProviderID> 
<CardType>All or Virtual or Manual or BillPayment</CardType> 
<Language>Hebrew or Arabic or English</Language> 
<LoadPictures>boolean</LoadPictures> 

So ist die $xml_array Variable ein Array mit den Namen dieser Elemente wie haben sollte:

$xml_array['query']['TerminalNum'] = 5089 ; 
$xml_array['query']['ProviderID'] = 'SiteUser'; 
$xml_array['query']['CardType'] = 'som card type'; 
$xml_array['query']['Language'] = 'English'; 
$xml_array['query']['LoadPictures'] = 'true'; 
+0

Hallo, ich habe versucht, aber es funktioniert nicht – YossefB

+0

Ich bekomme einen Fehler von dem Server, den ich bin Senden eines Nullwerts – YossefB

+0

Ich habe einige Änderungen an meiner Antwort vorgenommen. Bitte versuchen Sie diese Array-Struktur. Versuchen Sie es auch mit und ohne 'query' Element, um zu sehen, ob es funktioniert – Whiteulver