简体   繁体   中英

how to build(url for web services also), deploy and use web services in java

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.

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

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 .

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