SOAP: Invalid Token

I can’t find the cause of the crashes, because the Debugged App crashes hard and i have no chance to trace it in the debugger.
As soon as i call invoke, it crashes. Here’s my code (i changed the passwords and urls, because they are confidential):

[code] Dim SSocket As HTTPSecureSocket
Dim sm As New SOAPMethod
Dim form As Dictionary
Dim sr as New SOAPResult
Dim Token As String
Dim d As New Date
Dim s As String

SSocket = New HTTPSecureSocket
SSocket.Secure = True

sm.UseSocket(SSocket)
sm.LoadWSDLFromURL(“https://xxx.xxx.xxx/api/index.php?wsdl”)

form = New Dictionary
form.Value(“name”) = “xxx”
form.Value(“password”) = “xxx”

'md5( ipadresse:passwort:yyymmdd )
Token = System.GetNetworkInterface(0).IPAddress + “:PASSWORD:” + d.SQLDate.ReplaceAll("-","")

Token = MD5(Token)

sm.action = “https://xxx.xxx.xxx/api/index.php/GetCustomer
sm.url = “https://xxx.xxx.xxx:443/api/index.php

sm.parameter(“token”) = Token
sm.Parameter(“kdnr”) = “”
sm.parameter(“ma_kdnr”) = “12345”

sr= sm.invoke(“GetCustomer”)

s = sr.Result(“GetCustomerResponse”)[/code]

And this is the description of the WSDL Service:

[quote]Name: GetCustomer
Binding: xxx-APIBinding
Endpoint: https://xxx.xxx.xxx:443/api/index.php
SoapAction: https://xxx.xxx.xxx/api/index.php/GetCustomer
Style: rpc
Input:
use: encoded
namespace:
encodingStyle: http://schemas.xmlsoap.org/soap/encoding/
message: GetCustomerRequest
parts:
token: xsd:string
kdnr: xsd:int
ma_kdnr: xsd:string
Output:
use: encoded
namespace:
encodingStyle: http://schemas.xmlsoap.org/soap/encoding/
message: GetCustomerResponse
parts:
return: tns:GetCustomerReturn
Namespace:
Transport: http://schemas.xmlsoap.org/soap/http
Documentation: [/quote]

Can someone see the issue and please point me to the right direction? :slight_smile:

I just need to Encode the Token to Hex and it stops crashing! :slight_smile:

Token = EncodeHex(MD5(Token))

But now i get an XML 2 Error each time i call sm.LoadWSDLFromURL("https://xxx.xxx.xxx/api/index.php?wsdl").
Slowly but surely, i am going crazy… :slight_smile:

The XML Error seems to be related to the fact, that the SecureServer only accepts requests from specific IP Adresses = Solved.
But i can’t get my Token to work.

My service documentation says, i need to send a request which would be done in php with: md5( ipadress:password:yyymmdd ).

Now i use:

Token = MD5(Token) Token = EncodeHex(Token)

But i receive an “Invalid Token” reply… :-/

bump :slight_smile:

crash log ?
if you’re on OS X there should be one

[quote=48768:@Norman Palardy]crash log ?
if you’re on OS X there should be one[/quote]

I changed the Title of this Thread to “Invalid Token” because i am already past the crash issue.
Thank you Norman.

OMG! I found the “issue”…

I need to send the Token in lowercase… :slight_smile:

BTW: Why is Oh my god (O M G) converted to !@#$%! in this Forum???

Although it’s rather soft, to a conservative mind it probably still counts as blasphemy.