I want to create a REST client in Java using definitions. I cannot control the server. The service provides me some XRD documents defining it, but my Java tool (Apache CXF) can generate Java classes only from WADL or WSDL documents.
I know that XRD is not the same than WSDL nor WADL, but:
Is there any tool to convert XRD to WSDL or WADL?
Related
Tech Stack: Java 1.6, JPA (Hibernate 3), Spring 3, Oracle 11g
Hello,
In one of my projects, we have to create a number of web services.
These web services are like 'create application' and 'udpate application'.
For creating an application, the input data (request XML) is around 90-100 lines.
In my view I should be using SOAP\XML webservice (Spring), but my company has decided to go forward with REST (JAX-RS).
I think it will be difficult for client to create such request without any formal contract.
Or do you think REST will serve the purpose?
Thanks,
Adi
REST is much more flexible then SOAP. with REST service you can return responses as XML/JSON/HTML while in SOAP its usually just XML.
REST also uses plain HTTP unlike SOAP which extends HTTP.
So your company did the right choice. Regarding the format of the answer, if it's JSON, you can use libraries like Gson to convert messages. You'll need to write a document describing the different links and their input/output (look here for example)
If it's XML, all you need is an XSD for the request/response and again use a FW like XmlBeans to Marshal/Unmarshal the request/response. In that case, just give the client the XSD's and the above mentioned document.
I want to create an Object Model (may be in UML?) and then use some tools to generate entities in JAVA (for client side) and in PHP (for server side).
Primarily, I wish to write a JAVA client side application communicating with a PHP based web services using REST and JSON.
Idea is to avoid writing (and then maintaining), object entities separately in java and php.
JSON serialization of entities would be a big plus
Please suggest tools/approach that I could take to achieve the objective.
you need to implement the Apache solr server
Solr client
Ibm developer works on Solr
Check php manual about the service
Wiki solr
I need to develop Webservice Application for our Client .
I dont know anything about WSDL4J
From the net I found this
"The Web Services Description Language for Java Toolkit (WSDL4J) allows the creation, representation, and manipulation of WSDL documents.
Is the reference implementation for JSR110 'JWSDL' (jcp.org)."
But anybody please tell me why should we use WSDL for developing webservices?
Is there any specific advantage we will get?
And can anybody please point me a link where to start for working with WSDL4j?
You actually need not to use wsdl4j for developing web services or clients for web services. There are other SOAP stacks developed on top of that. Axis2 is such an open source SOAP stack..
WSDL2Java tool that comes with Axis2 - which been used to generate client side stubs from a given WSDL. uses wsdl4j internally..
Situation:
We are planning to build a set of new services a long side a set of old SOAP (Spring, apache CXF) web services. Our customers are used to being able to use ?wsdl to get a wsdl describing a service and the content it will accept/return.
I'm looking at providing the new services via spring controllers and RESTful urls. However not all of a request can be handled via a RESTful url, so we still need to have a payload request and responses. I'm looking at use #RequestBody and #ResponseBody and spring's Message Converters to auto(magically) handle both XML and JSON content. The idea being to let spring do as much of the heaving lifting as possible.
The problem:
I'm trying to figure out if it's possible given the REST/Message converter concept, to be able to provide a description of a service and it's request/response data in a similar fashion to the ?wsdl request. I understand that there are WADL documents that can be generated by some systems, but they appear to be a proposel and not fully accepted yet.
Does anyone know if spring can generate WADLs or something else that I can use to allow clients to query the RESTful services data structures?
SpringMVC doesn't support WADL auto generation, mostly because it doesn't use the JSR-311 standard REST API.
I have create a blog entry with a simple WADL generation Controller in java :
Tuxgalaxy Blog Entry.
But Tomasz Nurkiewicz also provide a WADL generation Controller in scala :
nurkiewicz Blog Entry.
You could use CXF JAX-RS for your REST services since you're already using it for SOAP (you can even expose the same service as SOAP and REST with CXF), and CXF gives you the WADL that you want by adding ?_wadl&_type=xml
The following code will work with Spring REST 4x and its based on the suggested code by tuxgalaxy provided on below https://jira.spring.io/browse/SPR-8705
http://javattitude.com/2014/05/26/wadl-generator-for-spring-rest/
I am implementing SOAP web services for a commercial application, and I am using GroovyWS to speed up the development.
But, when I deploy it on Tomcat, I am not using Grails, as the software has it's own J2EE framework, so how I do I get it to react to wsdl requests?
Do I need to write a groovy-based servlet?
Ideally I would like the WSDL generated upon request, so I can easily change the interface and see the change.
It seems I will miss the annotations that JAX-WS provides for, though, to help fine-tune the WSDL.
Using the example web application, the WSDL can be retrieved as follows:
http://localhost:6980/MathService?wsdl