02-22-2010 02:55 PM
I currently find myself in need ot a J2ME method/class/something-or-other that mimics the functionality of SoapRequestBuilder in J2SE, used to call a method from a web service. The standard code is as follows:
SoapRequestBuilder s = new SoapRequestBuilder();
s.Server = "127.0.0.1";
s.MethodName = "GetBoxId";
s.XmlNamespace = "http://www.mySite.com";
s.WebServicePath = "/Interfaces/package.asmx";
s.SoapAction = s.XmlNamespace+s.MethodName;
s.AddParameter ("userId", 0);
s.AddParameter ("boxId", ID);
Does anyone know the proper method for doing this on the BlackBerry platform? I'm working with 4.7 and later.
Solved! Go to Solution.
02-23-2010 09:08 AM
Any thoughts? This is rather important to initializing my application, and I've found no related documentation. I've searched the knowledge base, exhausted my Google-fu...
Thanks for your consideration,
02-23-2010 10:45 AM
hi .you can either use KSOAP or just create the entire SOAP request as a String and then write it to the output stream.
KSOAP code is given below . it might help you
SoapObject request = new SoapObject("http://www.webserviceX.NET", "GetWeather"); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); request.addProperty("CityName","London"); request.addProperty("CountryName",""); System.out.println(request.toString()); envelope.setOutputSoapObject(request); envelope.dotNet = true; ht.call(SOAPAction,envelope); SoapObject result = (SoapObject)envelope.bodyIn; System.out.println(result.toString()); System.out.println("Name: "+result.getName()+"\nNameSpace: "+result.getNamespace()+"\n Property Count: " +result.getPropertyCount()); System.out.println(result.toString());
02-23-2010 10:54 AM
I actually found the same program on my own, and I'm working with a similar example. I'm still a bit apprehensive about including an external library in a commercial application, but I'm hoping including a reference in the source is sufficient. Thanks for the help!