Guten Tag,
ich muss ein WSDL API System in PHP nutzen da bräuchte ich hilfe:
PHP
Name: logincheck
Binding: pinsdownloadwsdlBinding
Endpoint: http://****.de/wsdemo/testenv/testpin/pintrans.php
SoapAction: urn:pinsdownloadwsdl#logincheck
Style: rpc
Input:
use: encoded
namespace: urn:pinsdownloadwsdl
encodingStyle: http://schemas.xmlsoap.org/soap/encoding/
message: logincheckRequest
parts:
logincredentials: tns:LoginDetailsIn
Output:
use: encoded
namespace: urn:pinsdownloadwsdl
encodingStyle: http://schemas.xmlsoap.org/soap/encoding/
message: logincheckResponse
parts:
return: tns:LoginDetailsOut
Namespace: urn:pinsdownloadwsdl
Transport: http://schemas.xmlsoap.org/soap/http
Documentation: Check user login details
Alles anzeigen
Hier die WSDL
XML
<?xml version="1.0" encoding="windows-1252"?>
<definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:pinsdownloadwsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:pinsdownloadwsdl">
<types>
<xsd:schema targetNamespace="urn:pinsdownloadwsdl">
<xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<xsd:import namespace="http://schemas.xmlsoap.org/wsdl/"/>
<xsd:complexType name="LoginDetailsIn">
<xsd:all>
<xsd:element name="username" type="xsd:string"/>
<xsd:element name="password" type="xsd:string"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="LoginDetailsOut">
<xsd:all>
<xsd:element name="error" type="" errorcode="http://www.w3.org/2001/XMLSchema:int" errorstring="http://www.w3.org/2001/XMLSchema:string"/>
<xsd:element name="login" type="" isloggedin="http://www.w3.org/2001/XMLSchema:boolean"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="CreditDetailsOut">
<xsd:all>
<xsd:element name="error" type="" errorcode="http://www.w3.org/2001/XMLSchema:int" errorstring="http://www.w3.org/2001/XMLSchema:string"/>
<xsd:element name="amount" type="" creditamount="http://www.w3.org/2001/XMLSchema:double"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="CardDetailsOut">
<xsd:all>
<xsd:element name="error" type="" errorcode="http://www.w3.org/2001/XMLSchema:int" errorstring="http://www.w3.org/2001/XMLSchema:string"/>
<xsd:element name="cardslist" type="" cardid="http://www.w3.org/2001/XMLSchema:int" cardname="http://www.w3.org/2001/XMLSchema:string" rate="http://www.w3.org/2001/XMLSchema:double" pprice="http://www.w3.org/2001/XMLSchema:double"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="PinDetailsIn">
<xsd:all>
<xsd:element name="username" type="xsd:string"/>
<xsd:element name="password" type="xsd:string"/>
<xsd:element name="cardid" type="xsd:int"/>
<xsd:element name="quantity" type="xsd:int"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="PinDetailsOut">
<xsd:all>
<xsd:element name="error" type="" errorcode="http://www.w3.org/2001/XMLSchema:int" errorstring="http://www.w3.org/2001/XMLSchema:string"/>
<xsd:element name="pinslist" type="" cardid="http://www.w3.org/2001/XMLSchema:int" batchnumber="http://www.w3.org/2001/XMLSchema:string" pinnumber="http://www.w3.org/2001/XMLSchema:string" expirydate="http://www.w3.org/2001/XMLSchema:date" purchaseprice="http://www.w3.org/2001/XMLSchema:double" transactionid="http://www.w3.org/2001/XMLSchema:int"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="OrderDetailsOut">
<xsd:all>
<xsd:element name="error" type="" errorcode="http://www.w3.org/2001/XMLSchema:int" errorstring="http://www.w3.org/2001/XMLSchema:string"/>
<xsd:element name="pinslist" type="" cardid="http://www.w3.org/2001/XMLSchema:int" batchnumber="http://www.w3.org/2001/XMLSchema:string" pinnumber="http://www.w3.org/2001/XMLSchema:string" expirydate="http://www.w3.org/2001/XMLSchema:date" purchaseprice="http://www.w3.org/2001/XMLSchema:double" transactionid="http://www.w3.org/2001/XMLSchema:int"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="TransactionsDetailsIn">
<xsd:all>
<xsd:element name="username" type="xsd:string"/>
<xsd:element name="password" type="xsd:string"/>
<xsd:element name="transactionsID" type="xsd:int"/>
</xsd:all>
</xsd:complexType>
</xsd:schema>
</types>
<message name="logincheckRequest">
<part name="logincredentials" type="tns:LoginDetailsIn"/></message>
<message name="logincheckResponse">
<part name="return" type="tns:LoginDetailsOut"/></message>
<message name="creditcheckRequest">
<part name="logincredentials" type="tns:LoginDetailsIn"/></message>
<message name="creditcheckResponse">
<part name="return" type="tns:CreditDetailsOut"/></message>
<message name="getcardslistRequest">
<part name="logincredentials" type="tns:LoginDetailsIn"/></message>
<message name="getcardslistResponse">
<part name="return" type="tns:CardDetailsOut"/></message>
<message name="requestpinRequest">
<part name="pincredentials" type="tns:PinDetailsIn"/></message>
<message name="requestpinResponse">
<part name="return" type="tns:PinDetailsOut"/></message>
<message name="retrivearchiveRequest">
<part name="pincredentials" type="tns:TransactionsDetailsIn"/></message>
<message name="retrivearchiveResponse">
<part name="return" type="tns:OrderDetailsOut"/></message>
<portType name="pinsdownloadwsdlPortType">
<operation name="logincheck">
<documentation>Check user login details</documentation>
<input message="tns:logincheckRequest"/>
<output message="tns:logincheckResponse"/>
</operation>
<operation name="creditcheck">
<documentation>Check user available credit</documentation>
<input message="tns:creditcheckRequest"/>
<output message="tns:creditcheckResponse"/>
</operation>
<operation name="getcardslist">
<documentation>Get the List of all available cards</documentation>
<input message="tns:getcardslistRequest"/>
<output message="tns:getcardslistResponse"/>
</operation>
<operation name="requestpin">
<documentation>Get the List of Requested Pins</documentation>
<input message="tns:requestpinRequest"/>
<output message="tns:requestpinResponse"/>
</operation>
<operation name="retrivearchive">
<documentation>Get the details of Transactions made</documentation>
<input message="tns:retrivearchiveRequest"/>
<output message="tns:retrivearchiveResponse"/>
</operation>
</portType>
<binding name="pinsdownloadwsdlBinding" type="tns:pinsdownloadwsdlPortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="logincheck">
<soap:operation soapAction="urn:pinsdownloadwsdl#logincheck" style="rpc"/>
<input><soap:body use="encoded" namespace="urn:pinsdownloadwsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
<output><soap:body use="encoded" namespace="urn:pinsdownloadwsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
</operation>
<operation name="creditcheck">
<soap:operation soapAction="urn:pinsdownloadwsdl#creditcheck" style="rpc"/>
<input><soap:body use="encoded" namespace="urn:pinsdownloadwsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
<output><soap:body use="encoded" namespace="urn:pinsdownloadwsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
</operation>
<operation name="getcardslist">
<soap:operation soapAction="urn:pinsdownloadwsdl#getcardslist" style="rpc"/>
<input><soap:body use="encoded" namespace="urn:pinsdownloadwsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
<output><soap:body use="encoded" namespace="urn:pinsdownloadwsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
</operation>
<operation name="requestpin">
<soap:operation soapAction="urn:pinsdownloadwsdl#requestpin" style="rpc"/>
<input><soap:body use="encoded" namespace="urn:pinsdownloadwsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
<output><soap:body use="encoded" namespace="urn:pinsdownloadwsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
</operation>
<operation name="retrivearchive">
<soap:operation soapAction="urn:pinsdownloadwsdl#retrivearchive" style="rpc"/>
<input><soap:body use="encoded" namespace="urn:pinsdownloadwsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
<output><soap:body use="encoded" namespace="urn:pinsdownloadwsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
</operation>
</binding>
<service name="pinsdownloadwsdl">
<port name="pinsdownloadwsdlPort" binding="tns:pinsdownloadwsdlBinding">
<soap:address location="http://*.de/wsdemo/testenv/testpin/pintrans.php"/>
</port>
</service>
</definitions>
Alles anzeigen
Mein PHP Code lautet:
PHP
<?php
require_once "lib/nusoap.php";
$client = new nusoap_client("http://***.de/wsdemo/testenv/testpin/pintrans.php?wsdl", true);
$error = $client->getError();
if ($error) {
echo "<h2>Constructor error</h2><pre>" . $error . "</pre>";
}
$params = array(
'username' => 'testweb001',
'password' => 'fr12Nk082015'
);
$result = $client->call('logincheck', $params);
if ($client->fault) {
echo "<h2>Fault</h2><pre>";
print_r($result);
echo "</pre>";
} else {
$error = $client->getError();
if ($error) {
echo "<h2>Error</h2><pre>" . $error . "</pre>";
} else {
echo "<h2>Main</h2>";
echo $result;
}
}
// show soap request and response
echo "<h2>Request</h2>";
echo "<pre>" . htmlspecialchars($client->request, ENT_QUOTES) . "</pre>";
echo "<h2>Response</h2>";
echo "<pre>" . htmlspecialchars($client->response, ENT_QUOTES) . "</pre>";
?>
Alles anzeigen
Jedesmal kriege ich als Response folgendes
PHP
<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:pinsdownloadwsdl"><SOAP-ENV:Body><ns1:logincheckResponse xmlns:ns1="urn:pinsdownloadwsdl"><return xsi:type="tns:LoginDetailsOut"><error><errorcode xsi:type="xsd:int">101</errorcode><errorstring xsi:type="xsd:string">Invalid Login Credentials pattern</errorstring></error><login xsi:type="xsd:int">0</login></return></ns1:logincheckResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
Kann mir bitte jemand behilflich sein