0

i have a server with oracle database for which i have to make web services. i searched a lot but didn't got a perfect solution from starting means building web service of URL having simple parameters and json parameters also. and then giving response of json. please tell me if i am sitting in front of my server then from where i have to start and what to do from start to end. i have to use it in android apps. please i am in trouble. because i never build web service before. thanx in advance.

Ajay Singh
  • 11
  • 1
  • 7
  • 1
    see if this help http://stackoverflow.com/questions/4846783/exposing-existing-api-as-a-web-service – kosa Nov 05 '12 at 03:05

2 Answers2

0

There are two ways to write web services in java

  1. SOAP- Simple object access protocol
  2. Restful web service.
    Both have their own advantages and disadvantages. But personally I think writing a restful web service is good.
    This may help you: Compare and contrast REST and SOAP web services?

SOAP is based on XML. The messages are transmitted via XML format. You will have to create both server side and client side. After creating the server side implementation you have to create a wsdl file for the client to access. Writing the client side is also simple.
This link may help you:
Introductory JAX-WS tutorial for Eclipse using a top down approach

Restful web services are URL based. This will be better for your purpose. and it is easy to implement when compared to SOAp.
This link may help you
http://docs.oracle.com/cd/E19226-01/820-7627/giqbx/index.html

Community
  • 1
  • 1
Konza
  • 2,143
  • 17
  • 30
0

For server side : Web-service : Is just a way of exposing your methods on web service . As KonZa said there are two types of web-service and u can choose any one of them . For starter i would prefer you to check this site : http://netbeans.org/kb/docs/websvc/jax-ws.html which will teach you how to make web-service and publish them .

Client Side : For Android , your job is pretty simple : Check SO or web for how use KSOAP2 Library which is used for communicating with webservice in android .

For all this you just need to have strong java base .
Let me know if you have any other query .

Code_Life
  • 5,742
  • 4
  • 29
  • 49
  • Hi Mohit, Thanx for your kind reply. but i want json response from my web service and this all is talking about xml response. and tell me please, do we query from db inside methods to generate json response. and do we make our return string in json format. thanx – Ajay Singh Nov 06 '12 at 09:41
  • I don't think so that any database support return type as JSON string. I think so u would have manually convert it. – Code_Life Nov 06 '12 at 11:48