Hi. I'm new to SOAP and trying to make a simple link between my online Kashflow database and an offline/desktop version, in RealBasic, using their SOAP objects. I'm making progress, with GetCustomers, but getting this error message returned. I'm absolutely sure the username/password are correct. Anybody any ideas what this is about? There are some other mentions of this error in the forums but they are dealing with PHP. Code: <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <GetCustomersResponse xmlns="KashFlow"> <GetCustomersResult/> <Status>NO</Status> <StatusDetail>An exception occured whilst trying to authenticate you. String reference not set to an instance of a String. Parameter name: s at System.Text.Encoding.GetBytes(String s) at KashFlow.wsDb.pwHash(String s) at KashFlow.wsDb.AuthenticateUser(String UserName, String Password, String ipaddr, String& errMsg) </StatusDetail> </GetCustomersResponse> </soap:Body> </soap:Envelope> (Note I've wrapped that manually for clarity -- everything up to and including "An exception occured whilst trying to authenticate you." had no line breaks.) Many thanks for any help offered. Bruce (not really mick)
Hi Bruce (not really mick), Can you please forward me the SOAP message you're submitting to our server. Thanks,
Hi both. I'm struggling to find the raw XML, because the RealBasic object doesn't expose it, and whilst I've downloaded WireShark to see if I can sniff it, I can't seem to coerce any sense out of it at all. Is there another way to get at it? Cheers Bruce --
Hi Bruce, Is RealBasic free to download and if it is, please send us a link to download it and also send us the code you're using to send the request. Sandy
Hi Sandy It's free for evaluation, from realsoftware.com I'm using the Mac version. The code is literally just the below. txtReturn is a text control on a form. The code runs in the Click event of a button on the same form: Code: // you will need... Dim sock as new HTTPSecureSocket Dim sm as SOAPMethod Dim sr as SOAPResult // set it up sock.Secure = True sm = new SOAPMethod sm.UseSocket sock sm.url = "https://secure.kashflow.co.uk/api/service.asmx" sm.methodNamespace="https://secure.kashflow.co.uk" sm.action = "KashFlow/GetCustomers" sm.parameter("UserName") = "myusername" sm.parameter("Password") = "mypassword" // do it sr = sm.invoke("GetCustomers") txtReturn.text= sr.document.tostring
Hi Bruce, Had a go and it works well for me but I made some changes. See code below Code: Dim sock as new HTTPSecureSocket Dim sm as SOAPMethod Dim sr as SOAPResult // set it up sock.Secure = True sm = new SOAPMethod sm.UseSocket sock sm.url = "https://secure.kashflow.co.uk/api/service.asmx" sm.methodNamespace="KashFlow" sm.action = "KashFlow/GetCustomers" sm.parameter("UserName") = "Username" sm.parameter("Password") = "Password" // do it sr = sm.invoke("GetCustomers") txtReturn.text= sr.document.tostring Give this a go and get back to me if you still need assistance. Thanks,