New topic: NilObjectexception with SOAP
<http://forums.realsoftware.com/viewtopic.php?t=47334> Page 1 of 1 [ 3 posts ] Previous topic | Next topic Author Message jcgarrido Post subject: NilObjectexception with SOAPPosted: Tue Mar 19, 2013 12:33 pm Joined: Wed Feb 08, 2012 9:33 am Posts: 7 I get a NilObjectexception invoking a soap call (to use a SAP webservice) with authentication. I can make a working call ussing soapui, but setting authentycation type preemptive. If this parameter is setting as default (global http settings) it doesn't work. I read that this means that autentication must be done at header. I analized raw data of soapui and authentication parameter is the same that mine (in watch window, at the right of the screen). I know that action parameter is empty, but is also empty in soapui request. I don't know what to do. Some ideas? Dim sm as SoapMethod Dim sr as SOAPResult Dim WS as new HTTPSocket // create SOAPMethod and define parameters sm = New SoapMethod sm.UseSocket (WS) WS.SetRequestHeader "Authorization","Basic " + EncodeBase64("MYUSER:MYPWD") sm.parameter("Werks") = SELF.t_Werks.Text sm.parameter("Lgort") = SELF.t_Lgort.Text sm.parameter("Ean") = SELF.t_Ean.Text sm.parameter("Exid") = SELF.t_Exidv.Text sm.parameter("Charg") = SELF.t_Charg.Text sm.parameter("Meins") = SELF.t_Meins.Text sm.parameter("Quantity") = SELF.t_Quantity.Text sm.parameter("Encodeur") = SELF.t_Encodeur.Text sm.parameter("Zzdate") = SELF.t_Zzdate.Text sm.parameter("Zzuzeit") = SELF.t_Zzuzeit.Text // set method properties sm.methodNamespace = "MYNAMESPACE" sm.action = "" sm.url="MYULR" // execute function sr = sm.invoke("Myfunc") 'HERE I GET NILOBJECTEXCEPTION Top timhare Post subject: Re: NilObjectexception with SOAPPosted: Tue Mar 19, 2013 2:51 pm Joined: Fri Jan 06, 2006 3:21 pm Posts: 12160 Location: Portland, OR USA This seems to be a limitation with the Soap classes. They work for simple requests, but nothing complex. And I've never been able to get them to work with authentication. Use an HTTPSocket, build the XML for the soap yourself, and Post it to the service. You'll get a string containing the xml response, which you can parse. Top jcgarrido Post subject: Re: NilObjectexception with SOAPPosted: Wed Mar 20, 2013 2:10 am Joined: Wed Feb 08, 2012 9:33 am Posts: 7 I'll try i. Thanks a lot. Regards. Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 3 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
