Is anyone know how to expose a WSDL with a dynamic XSD ? The choice of the XSD should depend of URL parameters given during the WSDL request. The operations of the WSDL
Prefered framework is Spring Web Service but other solutions are welcome.
Regards,
Spring-ws is able to generate the WSDL on the fly, based on your XSD files. I'm not sure if this is what you want since you're changing the webservice definition. In my opinion you should only have one definition.
Perhaps it's an option to provide multiple entry points, based on different XSD's. Since Spring-WS can take care of generating the WSDL that might be an option for you. It would at least provide you with only one WSDL.
Another option is of course to create a REST service where you're free to implement this any way you'd like.
Related
I want to generate service implementation from WSDL (Top down approach) in Java but I dont want to use any tool. For example If we want to create stubs we can use wsimport.
Please let me know if this is a duplicate question.
Thanks
If you don't want to use any tool to generate code or stubs, maybe you would like to use Spring WebServices. This way you only create an EndPoint able to process WS messages, that is, you only worry about implementing server logic.
With this approach you can define beans to marshalling, using jaxb2 (or another), and the EndPoint brings you functionality to receive not XML payload, but Java Objects instead.
If you don't want to genereta code or stubs, I think Spring WS is nice for you.
If you don't want to use any tool at all, then sorry for my answer, but I believed what you didn't want is to generate code.
Below is the Maven plugins which create Java from WSDL:
Axis :
Axis plugin
CXF
CXF plugin
For SOAP Based Web Services, why one should choose Spring WS over JAX-WS.
I had gone through some article even Spring WS doc feature but still I am not clear.
If I need to convince someone to use Spring WS I can't.
So I want the difference in simple terms that any Web Service Developer can understand.
Thanks in advance.
I am not going into the details of JAX-WS versus Spring-WS.
You might want to refer to the link here for details on that and google it.
From my personal experience :
Spring-WS Advantages over JaxWS
You want to use a databinding other than JAXB (JibX, Castor or
others)
You want extreme fine grained control on the endpoint mapping strategy
You are choosing a WSDL first approach (though many argue that JAXWS also supports a WSDL first approach, it is generally accepted to be more flexible in spring-ws)
JaxWS over SpringWS
You want to go for a java first approach
You want to make your code flexible (since JAXWS is a specification you can have multiple implementations)
You want to use other annotation driven development of JAX-WS
At work, we currently have a WSDL interface as well as a semi-RESTful interface that we're looking to expand upon and take it to the next level.
The main application runs using Servlets + JSPs as well as Spring.
The idea is that the REST and WSDL are interfaces for an API that will be designed. These (and potentially other things in future) are simply a method through which clients will be able to integrate with the interface.
I'm wondering if there are any suggestions or recommendations on frameworks / methodologies, etc for implementing that under-lying API or does it make sense simply to create some Spring beans which is called either by WSDL or REST?
Hope that makes sense.
Have a look at Eunicate it is great . You are using spring , Spring has had support of SOAP for a while and Spring 3 has support of REST (Creating and Consuming).
Your approach makes sense. Probably the most important advice is to make the external API layer as thin as possible. You can use Axis, Apache CXF, Jersey, etc. to handle the implementation of the REST or SOAP protocols, but the implementation of those services should just load the passed in data into a common request object, and pass that into a separate service that handles the request and returns a response object which the external API layer will marshall into the correct format for you.
This approach works especially well when you have a competitor providing similar services and you want to make it easy for their customers to switch. You just build a new external API that mirrors the competitors, and simply translates their format to your internal api model and provided your services are functionally equivalent, you're done.
This is a really late response, but I have a different view on this topic. The traditional way as we know it is to unmarshall xml to java and marshall java to xml. However if the wsdl changes then it would effectively be a structural change in the code which would again require a deployment.
Instead of the above approach if we list the fields mentioned in the wsdl in a presistent store, load the mappings in memory and prepare our structures based on these mappings we would have to have many less changes for this..Thus IMO instead of using existing libraries a configurable approach to unmarshalling and marshalling should be taken.
I wrote RESTful web service using RESTeasy implementation and turn EJB into JSON. And now I'm on the way of development client side.
I'm using Netbeans. How I can generate WADL file? And after I would generated client stub without any problem.
Please, could you suggest me how I can do this? Or maybe you know different easy way.
Thanks a lot!
Artem
Just FYI if you are trying to create a RESTful system, then generating client proxies using WADL will eliminate a significant number of the benefits REST provides.
However, if you are using the term REST as a way to describe a Http API (HAPI) service then go right ahead and use WADL. I'm not saying this to be pedantic about terminology, I just want you to be aware that, if this the case, you are free to ignore all the "it's not RESTful" because you are not trying to do REST, and that's cool.
If you are trying to make a system where the client and server components can evolve independently over the next 5 to 10 years, then maybe REST is right for you in which case WADL is probably not what you want.
I'm looking for a solution of dynamic web service client such as DII from JAX-RPC.
I need to generate a client from a WSDL.
But the WSDL is only known at runtime (so I don't have any available interface).
I had a look on JbossESB, JbossWS, JaxWS,JaxRPC, but I could'nt find anything that fits this requirements.
Thanks for your help.
It appears that this is possible with CXF and some java reflection.
jax-ws-dynamic-dispatch-with-cxf
I'm personally looking for a solution for this + a dynamic server model as well.
Good luck.
finding a ready-made solution to your problem is not easy. at least none exist AFAIK. due to the inherent, unknown complexity of the backing schema types associated w/ an operation's request and response, it's not possible to have such a solution.
however, putting together the correct tools, or using some open-source frameworks/libraries/tools you might be able to achieve something similar. basically you'll need to have a WSDL4J implementation, along with a schema parser like XMLBeans to get this working.
A tool which comes to my mind is SoapUI. it achieves something similar - user loads a WSDL at runtime and thereafter can execute operations. the source of this tool is also available for modification under LGPL here. you'll need to strip and salvage the core functionality that suits your need. or best, build one of your own :]