I have an java EE web server running struts 2, hibernate and spring frameworks. The web application is simple online file storage solution with encryption. Now I want to expose my methods via a SOAP web service so that I can use that in my android application. I have the WSDL for my web service. I followed a tutorial and come to know that we can use java wsimport tool to generate java classes from WSDL.
Can I use that java classes to use in my android application So that my application can communicate with the remote server?
I am using hibernate for database operation so there would be hibernate entity classes that are returned. I am thinking I can have simple POJO classes in android application instead of hibernate entity classes.
You can have a look at this, I dont think it will work out of the box. KSoap2-android project library might help you .
http://www.ibm.com/developerworks/webservices/library/ws-android/index.html
Related
We want to develop a Java based Web-services (since the API's we want to use are Java based)
I would like to know if it's possible to use the IBM Rational Team Concert Plain Java API's (https://jazz.net/downloads/rational-team-concert/releases/5.0/RTC-Client-plainJavaLib-5.0.zip) as part of the Web-servicesand deploy them in the server?
Basically we use these API's on a client based Java applications. What I am looking at is more like a services which can be consumed by many applications
Anyone has any experience in deploying the client based API in the server as Web-services?
After multiple tries, it is possible to use the RTC Plain Java API's as Webservices.
How I did:
Followed the simple Webs Service creation tutorial (http://wiki.eclipse.org/Creating_a_Bottom-Up_Java_Web_Service)
Adapted to my needs
First added the "RTC plain Java API's (JAR's)" to the Eclipse build path
Then added the "RTC plain Java API's (JAR's)" to the "WebContent/Lib/" folder of my Dynamic web project
Created a new Web service & Web service client
I was able to login to RTC via this for starters
I am using Play framework 1.2.5 in my application in Eclipse IDE. I need to access a web service built using IBM JAX-RPC. I have got the wsdl file of the web service which I need to access in my applicatiom.
For normal Java EE applications, I used to paste the WSDL in my workspace, generate the files by right clicking the WSDL file => Generate Client option i.e. generating files with the help of Eclipse IDE.
I am not sure how to access the WSDL using Play framework.
I want to know:
1) Where to paste the WSDL file in my workspace?
2) In Play framework how do generate the client (Not sure even if we need this or not in play framework) and access the service methods?
3) Any additional settings needed for accessing the service methods?
Please let me know about this.
Regards,
The easy way:
Use Play!'s built-in play.libs.WS (Link #2 and #3). You have to create the raw HTTP requests yourself, and parse the XML result from the server yourself. Of course, this can become a complex task, if the web service interface is complex.
Preferably, you will create a JAX-RPC client based on your WSDL, and use it from your Play! application.
I have create one simple web service and I deploy it to the axis2 web application based on this tutorial
After creating my service, I am able to deploy it to the server and I can see the WSDL file by this url: localhost:8084/axis2/services/HelloAxisWorld?wsdl
Now, I want to call this service by an independent java application. I found some pieces of code that makes the invocation, but I am facing problems because I suppose that I don't include the proper libraries in my project.
Does anybody knows an example to call the web service by using axis2?
A simple Google for 'axis2 client tutorial' gives me this. It covers setting up your classpath properly, generating java from the WSDL via wsdl2java, and developing the client from this.
I am new to web services and below I am sharing my understanding so far by reading on net:
Apache Axis and Apache CXF - are web services frameworks used to develop Java web services.
JAX-RS - Java API to develop Restful web services.
JAX-WS - Java API to develop SOAP web services.
Is the above correct? Or if you want to add something to it.
In my project, I am going to use web services with Spring framework.I am told that project will have both SOAP and RESTful web services.I am very much new to this.
Can somebody please guide me in this regard by sharing some valuable information or any good link which will make me understand better?
Your statements are correct, but it's not clear whether you've understood one crucial fact: CXF and Axis are both implementations of the JAX-WS standard. CXF additionally implements JAX-RS, and there are some libraries that only implement JAX-RS, such as Jersey (Oracle's reference implementation) and RESTEasy from JBoss.
For your project, the big question is whether you will only consume those webservices, or also publish them. If you need to publish a webservice, you'll have to include the entire implementation library and learn to use it. If you only consume the services, you'll just need some generated client and data binding classes.
Another question is whether your RESTful services will talk XML or JSON (SOAP always uses XML), as you'll need a parser or binding framework for JSON (JAX-B for XML is included in recent JDKs).
I'm tasked with creating a Java Web Service for a .NET 2.0 client to consume.
What would your suggestions for the implementation be?
The solution doesn't need to be very heavyweight (don't need a full Java EE container I believe) but what do you think is the best solution for this? I have thought about using Glassfish v2 with JAX-WS annotations (#WebService), and JAXB XML Bindings(e.g. #XmlElement), which I assume the .NET client would be able to consume?
Has anyone tried this scenario?
Would Glassfish be overkill though, since I'm merely using the Web Service as a mechanism for .NET on Windows to communicate to the Linux box, the underlying application is extremely small.
Any suggestions are more than welcome :)
Thanks,
James
P.S. Other notes - would you use Axis/CXF instead of Glassfish? Would you use a servlet container such as Tomcat? etc.
I have used Axis2 and it works.
I had the same problem of making Data Exposing API (Web Service in my case) in Java.
I made the web service using Axis2 and Spring (to access database) and the WSDL created via Axis2 was easily consumed via ASP.NET Application via its Add Web Service Dialog Box and the corresponding Proxy Classes were created easily.