3

I have created J2me application (prototype) and now I have to add web services to it which are written in .Net.

How to do that? I'm looking for the procedure for developing j2me client in which I can pass parameters which are similar as in .Net web service.

gnat
  • 6,213
  • 108
  • 53
  • 73
user1520655
  • 95
  • 1
  • 5

2 Answers2

2

As the sreehari explained, first you need to have JAX-RPC API to include in your project. Once you have done that, the next thing comes, How to call web service.

Web Service can be created in any language like Java ( servlets ), PHP or .net, I have worked with all these three. for Java & PHP you can directly call the web-service, while for .net you need to create stubs.

Steps to create stubs. Once you create these stubs, you can simply call it like you call other methods in code and pass the argument ( if necessary ).

Also look at this quetsion How to use web service in J2ME application ?

Community
  • 1
  • 1
Lucifer
  • 29,392
  • 25
  • 90
  • 143
  • @Lucifier:Thnx.I have a J2me prototype application and .net webservices.I mean to say these two are developed but the path through which the communication will get started is still pending.so according to you i have to include JAX_RPC API in my app and after generating stubs i can call my .net Web services?Is there any other option?thanx in advance. – user1520655 Jul 19 '12 at 10:18
  • yes, and you required to put your web service on live ip, so that you can access it through gprs, or you can use WiFi Connection, if your device is going to support it. – Lucifer Jul 19 '12 at 10:21
  • ok.yesterday Sreehari provided this URl related JAX_RPC http://www.ibm.com/developerworks/wireless/library/wi-jsr/.As i don't know anything regarding JAX-RPC and Stubs so will it be sufficient for me to understand JAX_RPC and Stubs.I am new to J2me.Thnx – user1520655 Jul 19 '12 at 10:29
  • Can u guide me regarding this,if possible?Till now u have helped alot.Thanx for that but i need more as i am doing all this for first time so it will take a little bit more time to grasp. – user1520655 Jul 19 '12 at 10:33
  • Sure, I have updated my answer with a new link, please check it. – Lucifer Jul 19 '12 at 10:36
  • Ok i have started reading that link but i am sure i will need your help while reading.Thanks for your patience.Can i ask you if it is required? – user1520655 Jul 19 '12 at 10:41
  • sure, i will try my best to help you :) – Lucifer Jul 19 '12 at 10:42
  • @lucifier:Do i need to use SOAP? – user1520655 Jul 19 '12 at 11:19
  • you may use, SOAP, KXML, REST – Lucifer Jul 19 '12 at 11:21
  • If we are creating Stubs then there is no need to work over SOAP,is it like so? – user1520655 Jul 19 '12 at 11:26
  • that's a server side part, how the web services are made. – Lucifer Jul 19 '12 at 11:27
  • Can't we use HTTP POST method to call web services? – user1520655 Jul 19 '12 at 11:53
  • Yes, but that is an J2ME Part – Lucifer Jul 20 '12 at 01:53
  • Exactly.I don't have to made web services as they are already developed in .Net.I have to call those web services from my j2me (prototype) app.Are you getting my point? – user1520655 Jul 21 '12 at 05:04
  • Exactly.I don't have to made web services as they are already developed in .Net.I have to call those web services from my j2me (prototype) app.I worked on JAX-RPC using option Java web service client in Netbeans under options "Web Services".Its works fine if we develop for Java app but following Error occurs while doing for Java ME project. Error: test.wsdl is not compliant with Java ME Web Services specification (JSR-172). – user1520655 Jul 21 '12 at 05:16
  • JSR 172 is JAXP XML Parser Lib, have you added it ? – Lucifer Jul 21 '12 at 08:00
  • No,while i was trying for web application i found direct option "Web Service Client" ,with the help of which two folders gets generated named "Generated Sources(jax-rpc) and Web Service References.But already mentioned problem occurs while doing the same with J2me app. But now i tried to get the response via Http Post method. – user1520655 Jul 23 '12 at 07:17
0

You will need to use JAX-RPC API to create client for Web services. It doesn't matter in which language the service is implemented. I am not sure on limitations from a J2ME perspective.

Sree
  • 746
  • 6
  • 21
  • Thanx alot for your response.Can you refer particular link which will help me in understanding JAX-RPC as i am new to J2ME?One more thing during R&D i came to know about SOAP.Do i need to work over it?I donot know anything related J2me webservices.Kindly help if you can.Thanx in advance. – user1520655 Jul 18 '12 at 11:43
  • Will you please check the following link?Am i going in the right direction? http://ninadgawad.wordpress.com/2007/08/26/web-service-client-development-using-jax-rpc-api/ – user1520655 Jul 18 '12 at 11:55
  • @user1520655 - Check this http://www.ibm.com/developerworks/wireless/library/wi-jsr/ – Sree Jul 18 '12 at 12:12