|
|
I have an existing Spring MVC application, a function of which I need to expose via a web-service.
Using JAX-WS Spring, I exposed a web service with a simple echo response, however I am now having trouble expanding that to what I require..
If there's a simple means of doing this I am missing I would be grateful, or if anyone can resolve my questions below about my current method, that would be great.
1.gt; My spring MVC app has my beans bound in dispatcher-servlet.xml, whereas the WS binding only functions in application-context.xml.
From what I have found, dispatcher-servlet, is a child of application-context, and can read beans from app-context, but app context cannot read beans from the dispatcher. Given this, I cannot access my business services to call the functionality I wish to expose.
2.gt; Binding them in spring aside, if I add the property and getters and setters to my web-service, ready for binding, then JAX throws a small fit regarding properties on the other object.
So for example I have an Endpoint, I bind a helperService to it, as soon as I add a property to that helper service of a type of class which uses interfaces, the project fails to initialize, citing JAXB's inability to map interfaces.
I actually don't want JAX to map these properties, I just want to use them in constructing the response, but JAX seems intent on mapping them anyway.
If I leave off the getters and setters, I can't bind it in Spring.
I did try adding @WebMethod(exclude=true); tags to the getters/setters, however that gives me an invalid syntax error.
At this point I'm in way over my head..
Thanks in advance,
~ Jon
Why Jax WS? Would you like to try Spring WS instead?
Here's an integration tutorial for Spring MVC and WS: 2010/12...ing-3-mvc.html
I went with JAX-WS because I have experience with it, and it's nice and easy to work with.. I have a tight time-line, and learning something else in the middle of my project isn't my first choice.
That said, if Spring WS is straight forward enough, I'm definitely open to it.. I'll take a look. Thanks! |
|