I have already generated the files using wsdl2Java and created the proxy client in JAVA.I am using Apache CXF framework and using Maven as Build Management tool. I can run the JAVA application and consume the service using JAVA. There is no problem with JAVA implementation.
The need is I need to invoke and request the same web service from PHP or JSP file and display the result in PHP or JSP file. I would like to use the present JAVA code. I don't know how to invoke the JAVA code from PHP or JSP page.
Please help me with the solutions.
You have created a web service, so your design should be centered around that. For Java programs (including JSP's) you can use the generated client classes to access the web service. For PHP I would recommend using one of the many SOAP client libraries to process and consume your WSDL. You might want to take a look at wsdl2php, NuSoap, or SoapClient.
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 looking for a java based CMS that exposes an API for external file upload.
So for instance I have a Tomcat server with a running CMS. I also have a (standalone) client that needs to add content to the CMS automatically (without user interference).
I already looked into Liferay (using Jackrabbit) but there is no way to upload documents/files from a client.
Does anyone know of a java CMS where this is possible ?
Thanks!
Coenos
If you are ready to take time in coding then you could make use of Liferay webservices to create a client yourself. Liferay exposes its core api as web service, using which you can do most of the things. To see the list of services that Liferay exposes check this url
http://localhost:8080/tunnel-web/axis
Replace localhost:8080 with yours.
To know more about this check out this wiki link
http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Web+services+-+Manage+Users,+Organizations,+User+Groups,+and+Roles+via+SOAP
I am normally used to using JSON/REST. I have been given access to a web service with WSDL file that I need to use to read data. I have no idea where to start
What is the quickest easiest way to get JAVA code up and running that can query this web "service"?
You can use libraries like Apache AXIS or Apache CXF, which include a WSDL2Java program you can run to parse the WSDL definition file and generate classes that let you invoke the web service.
Pick your framework (popular ones include Axis2, Spring-WS, Jax-WS). 2. Use the tool that comes with your framework to create Java proxies (for example, for Axis2, you'll use wsdl2java). 3. Write code that uses the generated proxies to actually call your web service.
I recommend Sun's JAX-WS (now built-in to Java 6). Google it (I can only post one link, below).
Some links...
Main site:
jax-ws.dev.java.net/
JAX-WS is under the Glassfish Metro project, but you don't need Glassfish to use it (we don't). However this is a good resource:
metro.dev.java.net/guide/
For starting with WSDL, see specifically:
https://metro.dev.java.net/guide/Developing_client_application_with_locally_packaged_WSDL.html