Zu den Aufzeichnungen der tutorials.de-Live-Workshops
Like Tree1Danke
  • 1 Beitrag von Gainwar
ERLEDIGT
JA
ANTWORTEN
14
ZUGRIFFE
737
EMPFEHLEN
  • An Twitter übertragen
  • An Facebook übertragen
AUF DIESES THEMA
ANTWORTEN
  1. #1
    Sasser Sasser ist offline Mitglied Brillant
    Registriert seit
    Mar 2008
    Beiträge
    966
    Guten Abend!

    Ich möchte gern das folgende SOAP-Beispiel so umbauen, sodass keine SOAP-Klasse notwendig ist. Daher meine Frage; Welche Möglichkeiten gibt es noch mit der API zu kommunizieren? Funktioniert dies auch per CURL und dann SIMPLE_XML_LOAD? Ich wäre sehr über einen kleinen Lösungsansatz erfreut.

    PHP-Code:
    define ("WSDL_LOGON""https://api.affili.net/V2.0/Logon.svc?wsdl");
    define ("WSDL_PROD",  "https://api.affili.net/V2.0/ProductServices.svc?wsdl");

    $Username   "username";
    $Password   "password";
     
    $SOAP_LOGON = new SoapClient(WSDL_LOGON);
    $Token      $SOAP_LOGON->Logon(array(
                  
    'Username'  => $Username,
                  
    'Password'  => $Password,
                  
    'WebServiceType' => 'Product'
                  
    ));

    $SOAP_REQUEST = new SoapClient(WSDL_PROD);
    $req $SOAP_REQUEST->GetShopList(array(
                 
    'CredentialToken' => $Token
                 
    ));
     
    print_r($req); 
     

  2. #2
    Sasser Sasser ist offline Mitglied Brillant
    Registriert seit
    Mar 2008
    Beiträge
    966
    Da nur SOAP funktioniert, werde ich wohl nicht um SOAP herum kommen.

    Gibt es fertige SOAP - Klassen, welche mal einbinden kann ohne PHP gleich neu kompilieren zu müssen, sodass mir die SOAP-Klasse zur Verfügung steht?

    Nach langem Suchen, konnte ich keine passende Klasse finden...
     

  3. #3
    Sasser Sasser ist offline Mitglied Brillant
    Registriert seit
    Mar 2008
    Beiträge
    966
    Ich habe nun einmal per simplexml_load_file die Parameter zu übergeben und dann den Rückgabewert auszugeben, jedoch scheint das nicht ganz zu funktionieren... Was mache ich falsch?

    PHP-Code:
    $res simplexml_load_file "https://api.affili.net/V2.0/Logon.svc?wsdl" "&Username=" $Username "&Password=" $Password "&WebServiceType=Product" );
    print_r $res ); 
     

  4. #4
    Sasser Sasser ist offline Mitglied Brillant
    Registriert seit
    Mar 2008
    Beiträge
    966
    Eindlich habe ich einen kleinen Teilerfolg. Ich habe nun einen SOAP-Request per Curl abgesetzt:

    PHP-Code:
    $WSDL_URL = "https://api.affili.net/V2.0/Logon.svc?wsdl";

    $requestXmlBody = '<?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>
        <Logon xmlns="https://api.affili.net/V2.0/Logon.svc?wsdl">
          <Username>' . $Username . '</Username>
          <Password>' . $Password . '</Password>
          <WebServiceType>Product</WebServiceType>
        </Logon>
      </soap:Body>
    </soap:Envelope>';

    $connection = curl_init ();
    curl_setopt ( $connection, CURLOPT_URL, $WSDL_URL );
    curl_setopt ( $connection, CURLOPT_SSL_VERIFYPEER, "0" );
    curl_setopt ( $connection, CURLOPT_SSL_VERIFYHOST, "0" );
    curl_setopt ( $connection, CURLOPT_HTTPHEADER, array ( "Content-Type: text/xml; charset=utf-8" ) );
    curl_setopt ( $connection, CURLOPT_POST, true );
    curl_setopt ( $connection, CURLOPT_POSTFIELDS, $requestXmlBody );
    curl_setopt ( $connection, CURLOPT_RETURNTRANSFER, true );
    $response = curl_exec ( $connection );
    curl_close ( $connection );

    print_r ( $response );
    Eine Antwort sieht folgendermaßen aus, wenn ich die Schnittstelle im Browser aufrufe:

    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    
    <wsdl:definitions name="Authentication" targetNamespace="http://affilinet.framework.webservices/Svc">
    −
    <wsp:Policy wsu:Id="DefaultEndpointLogon_policy">
    −
    <wsp:ExactlyOne>
    −
    <wsp:All>
    −
    <sp:TransportBinding>
    −
    <wsp:Policy>
    −
    <sp:TransportToken>
    −
    <wsp:Policy>
    <sp:HttpsToken RequireClientCertificate="false"/>
    </wsp:Policy>
    </sp:TransportToken>
    −
    <sp:AlgorithmSuite>
    −
    <wsp:Policy>
    <sp:Basic256/>
    </wsp:Policy>
    </sp:AlgorithmSuite>
    −
    <sp:Layout>
    −
    <wsp:Policy>
    <sp:Strict/>
    </wsp:Policy>
    </sp:Layout>
    </wsp:Policy>
    </sp:TransportBinding>
    </wsp:All>
    </wsp:ExactlyOne>
    </wsp:Policy>
    −
    <wsdl:types>
    −
    <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/">
    <xs:element name="anyType" nillable="true" type="xs:anyType"/>
    <xs:element name="anyURI" nillable="true" type="xs:anyURI"/>
    <xs:element name="base64Binary" nillable="true" type="xs:base64Binary"/>
    <xs:element name="boolean" nillable="true" type="xs:boolean"/>
    <xs:element name="byte" nillable="true" type="xs:byte"/>
    <xs:element name="dateTime" nillable="true" type="xs:dateTime"/>
    <xs:element name="decimal" nillable="true" type="xs:decimal"/>
    <xs:element name="double" nillable="true" type="xs:double"/>
    <xs:element name="float" nillable="true" type="xs:float"/>
    <xs:element name="int" nillable="true" type="xs:int"/>
    <xs:element name="long" nillable="true" type="xs:long"/>
    <xs:element name="QName" nillable="true" type="xs:QName"/>
    <xs:element name="short" nillable="true" type="xs:short"/>
    <xs:element name="string" nillable="true" type="xs:string"/>
    <xs:element name="unsignedByte" nillable="true" type="xs:unsignedByte"/>
    <xs:element name="unsignedInt" nillable="true" type="xs:unsignedInt"/>
    <xs:element name="unsignedLong" nillable="true" type="xs:unsignedLong"/>
    <xs:element name="unsignedShort" nillable="true" type="xs:unsignedShort"/>
    <xs:element name="char" nillable="true" type="tns:char"/>
    −
    <xs:simpleType name="char">
    <xs:restriction base="xs:int"/>
    </xs:simpleType>
    <xs:element name="duration" nillable="true" type="tns:duration"/>
    −
    <xs:simpleType name="duration">
    −
    <xs:restriction base="xs:duration">
    <xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?"/>
    <xs:minInclusive value="-P10675199DT2H48M5.4775808S"/>
    <xs:maxInclusive value="P10675199DT2H48M5.4775807S"/>
    </xs:restriction>
    </xs:simpleType>
    <xs:element name="guid" nillable="true" type="tns:guid"/>
    −
    <xs:simpleType name="guid">
    −
    <xs:restriction base="xs:string">
    <xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}"/>
    </xs:restriction>
    </xs:simpleType>
    <xs:attribute name="FactoryType" type="xs:QName"/>
    <xs:attribute name="Id" type="xs:ID"/>
    <xs:attribute name="Ref" type="xs:IDREF"/>
    </xs:schema>
    −
    <xsd:schema elementFormDefault="qualified" targetNamespace="http://affilinet.framework.webservices/types">
    −
    <xsd:complexType name="Logon">
    −
    <xsd:sequence>
    <xsd:element minOccurs="0" name="Username" nillable="true" type="xsd:string"/>
    <xsd:element minOccurs="0" name="Password" nillable="true" type="xsd:string"/>
    <xsd:element name="WebServiceType" type="tns:WebServiceTypes"/>
    <xsd:element minOccurs="0" name="DeveloperSettings" nillable="true" type="tns:TokenDeveloperDetails"/>
    <xsd:element minOccurs="0" name="ApplicationSettings" nillable="true" type="tns:TokenApplicationDetails"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="Logon" nillable="true" type="tns:Logon"/>
    −
    <xsd:simpleType name="WebServiceTypes">
    −
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="Product"/>
    <xsd:enumeration value="Publisher"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:element name="WebServiceTypes" nillable="true" type="tns:WebServiceTypes"/>
    −
    <xsd:complexType name="TokenDeveloperDetails">
    −
    <xsd:sequence>
    <xsd:element minOccurs="0" name="SandboxPublisherID" nillable="true" type="xsd:int"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="TokenDeveloperDetails" nillable="true" type="tns:TokenDeveloperDetails"/>
    −
    <xsd:complexType name="TokenApplicationDetails">
    −
    <xsd:sequence>
    <xsd:element minOccurs="0" name="ApplicationID" nillable="true" type="xsd:int"/>
    <xsd:element minOccurs="0" name="DeveloperID" nillable="true" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="TokenApplicationDetails" nillable="true" type="tns:TokenApplicationDetails"/>
    −
    <xsd:complexType name="affilinetWebserviceFault">
    −
    <xsd:sequence>
    <xsd:element minOccurs="0" name="ErrorMessages" nillable="true" type="q1:ArrayOfKeyValueOfstringstring"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="affilinetWebserviceFault" nillable="true" type="tns:affilinetWebserviceFault"/>
    </xsd:schema>
    −
    <xsd:schema elementFormDefault="qualified" targetNamespace="http://affilinet.framework.webservices/Svc">
    <xsd:element name="LogonRequestMsg" nillable="true" type="q2:Logon"/>
    <xsd:element name="CredentialToken" nillable="true" type="xsd:string"/>
    <xsd:element name="ExpirationDate" type="xsd:dateTime"/>
    </xsd:schema>
    −
    <xsd:schema elementFormDefault="qualified" targetNamespace="http://www.microsoft.com/practices/EnterpriseLibrary/2007/01/wcf/validation">
    −
    <xsd:complexType name="ValidationFault">
    −
    <xsd:sequence>
    <xsd:element minOccurs="0" name="Details" nillable="true" type="q3:ArrayOfValidationDetail"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="ValidationFault" nillable="true" type="tns:ValidationFault"/>
    </xsd:schema>
    −
    <xsd:schema elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WCF">
    −
    <xsd:complexType name="ArrayOfValidationDetail">
    −
    <xsd:sequence>
    <xsd:element minOccurs="0" maxOccurs="unbounded" name="ValidationDetail" nillable="true" type="tns:ValidationDetail"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="ArrayOfValidationDetail" nillable="true" type="tns:ArrayOfValidationDetail"/>
    −
    <xsd:complexType name="ValidationDetail">
    −
    <xsd:sequence>
    <xsd:element minOccurs="0" name="Key" nillable="true" type="xsd:string"/>
    <xsd:element minOccurs="0" name="Message" nillable="true" type="xsd:string"/>
    <xsd:element minOccurs="0" name="Tag" nillable="true" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="ValidationDetail" nillable="true" type="tns:ValidationDetail"/>
    </xsd:schema>
    −
    <xsd:schema elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    −
    <xsd:complexType name="ArrayOfKeyValueOfstringstring">
    −
    <xsd:annotation>
    −
    <xsd:appinfo>
    <IsDictionary>true</IsDictionary>
    </xsd:appinfo>
    </xsd:annotation>
    −
    <xsd:sequence>
    −
    <xsd:element minOccurs="0" maxOccurs="unbounded" name="KeyValueOfstringstring">
    −
    <xsd:complexType>
    −
    <xsd:sequence>
    <xsd:element name="Key" nillable="true" type="xsd:string"/>
    <xsd:element name="Value" nillable="true" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="ArrayOfKeyValueOfstringstring" nillable="true" type="tns:ArrayOfKeyValueOfstringstring"/>
    </xsd:schema>
    </wsdl:types>
    −
    <wsdl:message name="LogonRequest">
    <wsdl:part name="LogonRequestMsg" element="tns:LogonRequestMsg"/>
    </wsdl:message>
    −
    <wsdl:message name="LogonResponse">
    <wsdl:part name="CredentialToken" element="tns:CredentialToken"/>
    </wsdl:message>
    −
    <wsdl:message name="AuthenticationContract_Logon_ValidationFaultFault_FaultMessage">
    <wsdl:part name="detail" element="q4:ValidationFault"/>
    </wsdl:message>
    −
    <wsdl:message name="AuthenticationContract_Logon_affilinetWebserviceFaultFault_FaultMessage">
    <wsdl:part name="detail" element="q5:affilinetWebserviceFault"/>
    </wsdl:message>
    −
    <wsdl:message name="GetIdentifierExpirationRequest">
    <wsdl:part name="CredentialToken" element="tns:CredentialToken"/>
    </wsdl:message>
    −
    <wsdl:message name="GetIdentifierExpirationResponse">
    <wsdl:part name="ExpirationDate" element="tns:ExpirationDate"/>
    </wsdl:message>
    −
    <wsdl:message name="AuthenticationContract_GetIdentifierExpiration_ValidationFaultFault_FaultMessage">
    <wsdl:part name="detail" element="q6:ValidationFault"/>
    </wsdl:message>
    −
    <wsdl:message name="AuthenticationContract_GetIdentifierExpiration_affilinetWebserviceFaultFault_FaultMessage">
    <wsdl:part name="detail" element="q7:affilinetWebserviceFault"/>
    </wsdl:message>
    −
    <wsdl:portType name="AuthenticationContract">
    −
    <wsdl:operation name="Logon">
    <wsdl:input wsaw:Action="http://affilinet.framework.webservices/Svc/ServiceContract1/Logon" name="LogonRequest" message="tns:LogonRequest"/>
    <wsdl:output wsaw:Action="http://affilinet.framework.webservices/Svc/AuthenticationContract/LogonResponse" name="LogonResponse" message="tns:LogonResponse"/>
    <wsdl:fault wsaw:Action="http://affilinet.framework.webservices/Svc/AuthenticationContract/LogonValidationFaultFault" name="ValidationFaultFault" message="tns:AuthenticationContract_Logon_ValidationFaultFault_FaultMessage"/>
    <wsdl:fault wsaw:Action="http://affilinet.framework.webservices/Svc/AuthenticationContract/LogonaffilinetWebserviceFaultFault" name="affilinetWebserviceFaultFault" message="tns:AuthenticationContract_Logon_affilinetWebserviceFaultFault_FaultMessage"/>
    </wsdl:operation>
    −
    <wsdl:operation name="GetIdentifierExpiration">
    <wsdl:input wsaw:Action="http://affilinet.framework.webservices/Svc/AuthenticationContract/GetIdentifierExpiration" name="GetIdentifierExpirationRequest" message="tns:GetIdentifierExpirationRequest"/>
    <wsdl:output wsaw:Action="http://affilinet.framework.webservices/Svc/AuthenticationContract/GetIdentifierExpirationResponse" name="GetIdentifierExpirationResponse" message="tns:GetIdentifierExpirationResponse"/>
    <wsdl:fault wsaw:Action="http://affilinet.framework.webservices/Svc/AuthenticationContract/GetIdentifierExpirationValidationFaultFault" name="ValidationFaultFault" message="tns:AuthenticationContract_GetIdentifierExpiration_ValidationFaultFault_FaultMessage"/>
    <wsdl:fault wsaw:Action="http://affilinet.framework.webservices/Svc/AuthenticationContract/GetIdentifierExpirationaffilinetWebserviceFaultFault" name="affilinetWebserviceFaultFault" message="tns:AuthenticationContract_GetIdentifierExpiration_affilinetWebserviceFaultFault_FaultMessage"/>
    </wsdl:operation>
    </wsdl:portType>
    −
    <wsdl:binding name="DefaultEndpointLogon" type="tns:AuthenticationContract">
    <wsp:PolicyReference URI="#DefaultEndpointLogon_policy"/>
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
    −
    <wsdl:operation name="Logon">
    <soap:operation soapAction="http://affilinet.framework.webservices/Svc/ServiceContract1/Logon" style="document"/>
    −
    <wsdl:input name="LogonRequest">
    <soap:body use="literal"/>
    </wsdl:input>
    −
    <wsdl:output name="LogonResponse">
    <soap:body use="literal"/>
    </wsdl:output>
    −
    <wsdl:fault name="ValidationFaultFault">
    <soap:fault name="ValidationFaultFault" use="literal"/>
    </wsdl:fault>
    −
    <wsdl:fault name="affilinetWebserviceFaultFault">
    <soap:fault name="affilinetWebserviceFaultFault" use="literal"/>
    </wsdl:fault>
    </wsdl:operation>
    −
    <wsdl:operation name="GetIdentifierExpiration">
    <soap:operation soapAction="http://affilinet.framework.webservices/Svc/AuthenticationContract/GetIdentifierExpiration" style="document"/>
    −
    <wsdl:input name="GetIdentifierExpirationRequest">
    <soap:body use="literal"/>
    </wsdl:input>
    −
    <wsdl:output name="GetIdentifierExpirationResponse">
    <soap:body use="literal"/>
    </wsdl:output>
    −
    <wsdl:fault name="ValidationFaultFault">
    <soap:fault name="ValidationFaultFault" use="literal"/>
    </wsdl:fault>
    −
    <wsdl:fault name="affilinetWebserviceFaultFault">
    <soap:fault name="affilinetWebserviceFaultFault" use="literal"/>
    </wsdl:fault>
    </wsdl:operation>
    </wsdl:binding>
    −
    <wsdl:service name="Authentication">
    −
    <wsdl:port name="DefaultEndpointLogon" binding="tns:DefaultEndpointLogon">
    <soap:address location="https://api.affili.net/V2.0/Logon.svc"/>
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>

    Ich bekomme allerdings den folgenden Error zurück:

    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    
    <s:Envelope>
    <s:Body>
    <s:Fault>
    <faultcode>a:ActionNotSupported</faultcode>
    <faultstring xml:lang="en-US">
    The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver.  Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).
    </faultstring>
    </s:Fault>
    </s:Body>
    </s:Envelope>

    Was mache ich nur ständig falsch? Ich versuche schon den ganzen Tag, einen Erfolg zu erzielen, jedoch immer der selbe Fehler...
    Geändert von Sasser (01.09.10 um 02:08 Uhr)
     

  5. #5
    Avatar von Gainwar
    Gainwar Gainwar ist offline Mitglied Gold
    Registriert seit
    Sep 2005
    Ort
    Augsburg
    Beiträge
    128
    Hi,

    versuch es mal indem du im HTTP-Header noch die SOAPAction setzt. In deinem fall müsste das vermutlich so aussehen:

    PHP-Code:
    curl_setopt $connectionCURLOPT_HTTPHEADER, array ( "Content-Type: text/xml; charset=utf-8""SOAPAction: http://affilinet.framework.webservices/Svc/ServiceContract1/Logon" ) ); 
    Geändert von Gainwar (01.09.10 um 06:19 Uhr)
     
    Manuel Freiholz
    iF.Gainwar

    iF.SVNAdmin (http://www.insanefactory.com/if-svnadmin/)
    Subversion Benutzeradministration mit PASSWD und LDAP Integration.

  6. #6
    Sasser Sasser ist offline Mitglied Brillant
    Registriert seit
    Mar 2008
    Beiträge
    966
    Der Fehler ist nun verschwunden, jedoch erhalte ich nun einen neuen Fehler:

    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    
    <s:Envelope>
    <s:Body>
    <s:Fault>
    <faultcode>s:Client</faultcode>
    <faultstring xml:lang="en-US">
    Object reference not set to an instance of an object.
    </faultstring>
    <detail>
    <affilinetWebserviceFault>
    <ErrorMessages>
    <a:KeyValueOfstringstring>
    <a:Key>10950100</a:Key>
    <a:Value>
    Object reference not set to an instance of an object.
    </a:Value>
    </a:KeyValueOfstringstring>
    </ErrorMessages>
    </affilinetWebserviceFault>
    </detail>
    </s:Fault>
    </s:Body>
    </s:Envelope>
     

  7. #7
    Avatar von Gainwar
    Gainwar Gainwar ist offline Mitglied Gold
    Registriert seit
    Sep 2005
    Ort
    Augsburg
    Beiträge
    128
    Hi,

    gibt es in der Doku vielleicht eine genauere Beschreibung dazu?

    Das Attribut "xmlns" bei Logon kannst du glaub ich weglassen. Ich glaube der Wert ist 'eh nicht richtig.

    Code :
    1
    
    <Logon xmlns="https://api.affili.net/V2.0/Logon.svc?wsdl">
     
    Manuel Freiholz
    iF.Gainwar

    iF.SVNAdmin (http://www.insanefactory.com/if-svnadmin/)
    Subversion Benutzeradministration mit PASSWD und LDAP Integration.

  8. #8
    Sasser Sasser ist offline Mitglied Brillant
    Registriert seit
    Mar 2008
    Beiträge
    966
    Leider gibt es keine Anleitung dazu, sondern nur einen kleinen PHP-Schnipsel:

    PHP-Code:
    $WSDL_URL "https://api.affili.net/V2.0/Logon.svc?wsdl";
    $SOAP_LOGON = new SoapClient $WSDL_URL );
    $request $SOAP_LOGON->Logon ( array ( "Username"  => $Username"Password"  => $Password"WebServiceType" => "Product" ) ); 
    Wenn man die o.g. API aufruft, finde ich einen Teil, welcher mit dem Logon zu tun hat:

    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    
    <xsd:schema elementFormDefault="qualified" targetNamespace="http://affilinet.framework.webservices/types">
    <xsd:complexType name="Logon">
    <xsd:sequence>
    <xsd:element minOccurs="0" name="Username" nillable="true" type="xsd:string"/>
    <xsd:element minOccurs="0" name="Password" nillable="true" type="xsd:string"/>
    <xsd:element name="WebServiceType" type="tns:WebServiceTypes"/>
    </xsd:sequence>
    </xsd:complexType>
    Geändert von Sasser (01.09.10 um 14:30 Uhr)
     

  9. #9
    Avatar von Gainwar
    Gainwar Gainwar ist offline Mitglied Gold
    Registriert seit
    Sep 2005
    Ort
    Augsburg
    Beiträge
    128
    Jo das ist der Datentyp (ComplexType) der bei einem Logon Request angegeben werden muss, aber das machst du ja bereits.

    Dieser sagt aus das ein "Username(string)", "Password(string)" und ein Wert der Enumeration von "WebServiceType" (Product oder Publisher) gegeben sein muss.

    Wird denn vielleicht eine Beispielapplikation angeboten wo du den Soap-Http-Request mit deinem eigenen vergleichen kannst?

    Wie sieht es den eigentlich mit den Parametern "DeveloperSettings" und "ApplicationSettings" aus? Die hast du bisher ja noch gar nicht angegeben. Die WSD sagt zwar das es nicht unbedingt benötigt wird aber man weis ja nie.
    Geändert von Gainwar (01.09.10 um 15:53 Uhr)
     
    Manuel Freiholz
    iF.Gainwar

    iF.SVNAdmin (http://www.insanefactory.com/if-svnadmin/)
    Subversion Benutzeradministration mit PASSWD und LDAP Integration.

  10. #10
    Sasser Sasser ist offline Mitglied Brillant
    Registriert seit
    Mar 2008
    Beiträge
    966
    Das ist ja mein Problem, dass kein Beispiel vorhanden ist. Man soll einfach die fertige Klasse SOAP nutzen, welche aber nicht bei jedem vorhanden ist...

    Was kann ich nun noch machen, um den Fehler zu finden?

    Mein Code sieht derzeit so aus:

    PHP-Code:
    $WSDL_URL = "https://api.affili.net/V2.0/Logon.svc?wsdl";

    $requestXmlBody = '<?xml version="1.0" encoding="utf-8"?>';
    $requestXmlBody .= '<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/">';
    $requestXmlBody .= "<soap:Body>";
    $requestXmlBody .= "<Logon>";
    $requestXmlBody .= "<Username>" . $Username . "</Username>";
    $requestXmlBody .= "<Password>" . $Password . "</Password>";
    $requestXmlBody .= "<WebServiceType>Product</WebServiceType>";
    $requestXmlBody .= "</Logon>";
    $requestXmlBody .= "</soap:Body>";
    $requestXmlBody .= "</soap:Envelope>";

    $connection = curl_init ();
    curl_setopt ( $connection, CURLOPT_URL, $WSDL_URL );
    curl_setopt ( $connection, CURLOPT_SSL_VERIFYPEER, "0" );
    curl_setopt ( $connection, CURLOPT_SSL_VERIFYHOST, "0" );
    curl_setopt ( $connection, CURLOPT_HTTPHEADER, array ( "Content-Type: text/xml; charset=utf-8", "SOAPAction: http://affilinet.framework.webservices/Svc/ServiceContract1/Logon" ) );
    curl_setopt ( $connection, CURLOPT_POST, true );
    curl_setopt ( $connection, CURLOPT_POSTFIELDS, $requestXmlBody );
    curl_setopt ( $connection, CURLOPT_RETURNTRANSFER, true );
    $responseXmlBody = curl_exec ( $connection );
    curl_close ( $connection );
    Die zusätzlichen optionalen Parameter "DeveloperSettings" und "ApplicationSettings" habe ich auch bereits ausprobiert, ändert jedoch leider nichts an dem Fehler...
    Geändert von Sasser (01.09.10 um 16:04 Uhr)
     

  11. #11
    Avatar von Gainwar
    Gainwar Gainwar ist offline Mitglied Gold
    Registriert seit
    Sep 2005
    Ort
    Augsburg
    Beiträge
    128
    So ich hab jetzt mal geschaut. Da gibt es doch eine Doku-PDF.
    http://developer.affili.net/Portalda...b_Services.pdf

    Da steht eigentlich alles ganz gut beschrieben drin. Hast du dir die schonmal angeschaut?

    [UPDATE]

    Was mir noch gerade aufgefallen ist. Soweit ich das sehe kannst du folgende Variable bei dir noch abändern:
    PHP-Code:
    $WSDL_URL "https://api.affili.net/V2.0/Logon.svc?wsdl"
    PHP-Code:
    $WSDL_URL "https://api.affili.net/V2.0/Logon.svc"
    Geändert von Gainwar (01.09.10 um 16:14 Uhr)
     
    Manuel Freiholz
    iF.Gainwar

    iF.SVNAdmin (http://www.insanefactory.com/if-svnadmin/)
    Subversion Benutzeradministration mit PASSWD und LDAP Integration.

  12. #12
    Sasser Sasser ist offline Mitglied Brillant
    Registriert seit
    Mar 2008
    Beiträge
    966
    Vielen Dank, die habe ich noch nicht gefunden gehabt

    Aber ich nutze doch wie benötigt, Username, Password und WebServiceType. Was mache ich jedoch falsch, sodass ich einen Fehler als Respone erhalte? Es kann doch also nur an dem Aufbau des Requests liegen oder?
    Geändert von Sasser (01.09.10 um 17:49 Uhr)
     

  13. #13
    Avatar von Gainwar
    Gainwar Gainwar ist offline Mitglied Gold
    Registriert seit
    Sep 2005
    Ort
    Augsburg
    Beiträge
    128
    Laut Doku musst du noch die ID's angeben die du dir in deinem Administrationsbereich holen kannst. Irgendwie in dieser Art:

    Code xml:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    
    ...
    <DeveloperSettings>
      <SandboxPublisherID>-deine-id-hier-</SandboxPublisherID>
    </DeveloperSettings>
    <ApplicationSettings>
      <ApplicationID>int-wert</ApplicationID>
      <DeveloperID>string-wert</DeveloperID>
    </ApplicationSettings>
    ...
    Sasser bedankt sich. 
    Manuel Freiholz
    iF.Gainwar

    iF.SVNAdmin (http://www.insanefactory.com/if-svnadmin/)
    Subversion Benutzeradministration mit PASSWD und LDAP Integration.

  14. #14
    Sasser Sasser ist offline Mitglied Brillant
    Registriert seit
    Mar 2008
    Beiträge
    966
    Aber ist das nicht nur für die Testumgebung?

    Unter 1.2 ist der Request für den Livebetrieb beschrieben.

    Demnach müsste doch folgendes reichen:

    Code :
    1
    2
    3
    4
    5
    
    <Logon>
    <Username>User</Username>
    <Password>Password</Password>
    <WebServiceType>Product</WebServiceType>
    </Logon>

    Ich bekomme aber dennoch den Fehler:

    s:Client
    Object reference not set to an instance of an object.
     

  15. #15
    Sasser Sasser ist offline Mitglied Brillant
    Registriert seit
    Mar 2008
    Beiträge
    966
    Nach langem suchen, bin ich auf das Programm SoapUI gestoßen, welches alle verfügbaren Operationen von einer Schnittstelle ausliest und sogar einen Request zusammenbaut. Dieser hat sofort auf Anhieb funktioniert!

    Vielen Dank nochmals!
     

Ähnliche Themen

  1. Badezimmer-Umbau
    Von Hellstorm im Forum Hall of Fame
    Antworten: 6
    Letzter Beitrag: 27.03.10, 21:07
  2. Umbau von Popmenu von SWING auf SWT
    Von Florian Strienz im Forum Swing, Java2D/3D, SWT, JFace
    Antworten: 3
    Letzter Beitrag: 03.09.09, 20:51
  3. Hilfe beim Umbau
    Von Sasser im Forum PHP
    Antworten: 2
    Letzter Beitrag: 03.09.08, 18:30
  4. Formmailer: Umbau auf Sicherheit
    Von AGUNDA im Forum PHP
    Antworten: 1
    Letzter Beitrag: 16.03.05, 18:58
  5. Umbau Lichterkette
    Von Terraworm im Forum Elektrotechnik
    Antworten: 5
    Letzter Beitrag: 01.12.04, 13:53