简体   繁体   中英

How to consume web services from a J2ME application

I need to access a web service from a J2ME application. Any good advice or example about how to consume web services from this framework?

For SOAP webservices: If you have a J2ME device which has JSR 172, you can create webservice client stubs and call the webservice methods on those stubs. However, JSR 172 is not widely available on most of the devices. The better way would be to use KSOAP2 to create SOAP requests and invoke your webservice methods.

For REST web services: You would just need to use HTTP Connection classes.

For parsing the XML response, you can use KXML2. Its a good third party library.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM