I am working on J2ME-WEBSERVICES to get information from server through SOAP protocol. For this task actually i went through two ways,
1) i) First created Web-service with normal java class in elipse and then created Client project for the web-service then it creates stub and service classes.
ii) And then i deploy the war file in to tomcat server and i successfully used the java class method got result correctly,
iii) URL i have used in Android application, With KSOAP api application works correctly, even i tested in mobile.
iv) but when i used the same url in j2me-midlet code i was written like:
but i am getting Nullpointer exception when pointer at SoapWriter.writeProperty() class.
2) Second way is, I used the stub and service classes of WebserviceClient project, and i created a MIDlet in same package (placed all supported jar files for MIDlet in lib folder)
DBWEBSoapBindingStub stub=new DBWEBSoapBindingStub();
stub._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "URL of webservice at server");
ii) I successfully compiled and preverified, with the generated class files i created jar, and when i deploy application in mobile, getting below exceptions :
:1) Noclassfound exception for org.apache.axis.client.stub : For this i placed axis.jar file in to application jar file. but still problem is when i deploy in to mobile, " jar file is max size" problem (size==1.6MB)
2) second exception is javax.xml.rpc.Service class not found : if i place the jar file in my application jar file it gives me exception like : " cannot create a class in system package "
so please let me know the solution for this issue, hope experts can help me out.
Moving on, in your first attempt, I don't understand what SoapObject is, is it a new class or subclass that you made?
Also, in your second attempt, there isn't an "org.apache.axis" package or "javax.xml.rpc.Service" class in jsr 172, you should register your jar with your eclipse project instead of just adding a jar file into the resource folder, and the size error says that your jar's file size exceeds the limit set by the device implementation.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com