|
Replies:
7
-
Last Post:
Aug 28, 2007 6:33 AM
by: ankitkinra
|
|
|
|
|
|
|
web services client - dynamic invocation
Posted:
Apr 22, 2007 11:24 AM
|
|
|
Dear
Thanks for reading my first post on this forum. I was wondering how one can create a Java client that consumes a web service of which the WSDL location or file is only available at run time?
Thanks in advance!
Greetings Geert
|
|
|
|
|
|
|
Re: web services client - dynamic invocation
Posted:
Apr 23, 2007 5:42 AM
in response to: geertmonsieur
|
|
|
Hi
see Create a dynamic Service here https://jax-ws.dev.java.net/nonav/2.1.1rc1/docs/dispatch.html
If you mean how to change the endpoint address on a (from wsdl) generated client proxy at run time: you can set the wsdl location in the constructor of the client proxy (just look at the generated code).
hope that helps
|
|
|
|
|
|
|
|
Re: web services client - dynamic invocation
Posted:
Apr 23, 2007 5:59 AM
in response to: wierob
|
|
|
Thanks for the feedback! I read the following on the mentioned web page:
Prepare the message request.
This is the client developer's responsibility. For examples of how to prepare specific request types refer to the Dispatch<T> sample applications.
If I'm correct this means you still need to build the SOAP messages manually in stead of generating it based on the web services structure defined in the WSDL file (like that is the case for static invocation).
|
|
|
|
|
|
|
|
Re: web services client - dynamic invocation
Posted:
May 2, 2007 3:17 AM
in response to: geertmonsieur
|
|
|
I all, I have the same problem of geertmonsieur...I want to realese a dynamic service invocation where "dynamic" means I want change the wsdl file and immediatly invoke it without building stub...to do this I would use dispatch mechanism but to do this I have to build manually the soap message. It is possible if I parse the schema inside the wsdl file and the n I build the soap message with attention, because the soap message structure must be different if (style=document use=literal) or if(style=rpc use=encoded). Is there some api that hel me to build soap message from wsdl?
Thanks in advance...
|
|
|
|
|
|
|
|
Re: web services client - dynamic invocation
Posted:
May 2, 2007 3:47 AM
in response to: travis_73
|
|
|
If you don't like to build the SOAP yourself you need to genereate client proxy from wsdl with wsimport. You can still change the servcie/wsdl lacation in this approach as mentioned above.
If you realy need to use the dispatch mechanisem then you must construct the SOAP yourself. It might be possible to use JAXB to assist in generating correct SOAP from java objects
|
|
|
|
|
|
|
|
Re: web services client - dynamic invocation
Posted:
May 2, 2007 3:55 AM
in response to: wierob
|
|
|
Thanks wierob for your answer! Summarized, it means one can only consume web services dynamically if you build the SOAP message manually (with the help of the JAXB). Calling wsimport at runtime isn't possible, I guess?
|
|
|
|
|
|
|
|
Re: web services client - dynamic invocation
Posted:
May 2, 2007 5:15 AM
in response to: geertmonsieur
|
|
|
You're welcome!
So your wsdl is only available at runtime? If not you can generate the proxy beforehand and than change the address.
Anyway wsimport is a script that calls the com.sun.tools.ws.WsImport class so I guess it is possible to execute this script programmatically in your application or even use the class directly. Sounds like a lot of work good luck
|
|
|
|
|
|
|
|
Re: web services client - dynamic invocation
Posted:
Aug 28, 2007 6:32 AM
in response to: wierob
|
|
|
I'm stuck in the same problem, and me being a beginner facing a lot of problem. please help.Thanks in advance..
Message was edited by: ankitkinra
|
|
|
|
|