Hi
We are using WSConsume to generate stubs for a WSDL document. We put the document in the
jar-file along with the generated stubs, and specify the wsdlLocation as
"file.wsdl".
The @WebServiceClient file then contains the following part in a static block:
| static {
| URL url = null;
| try {
| URL baseUrl;
| baseUrl = foo.Bar.class.getResource(".");
| url = new URL(baseUrl, "file.wsdl");
| } catch (MalformedURLException e) {
| logger.warning("Failed to create URL for the wsdl Location:
'file.wsdl', retrying as a local file");
| logger.warning(e.getMessage());
| }
| PXORDER_WSDL_LOCATION = url;
| }
|
I don't know why it makes use of the baseURL, but this fails when the resource is in a
jar file. A simpler approach (that works in a jar file also), is to simply do:
| static {
| URL url = null;
| try {
| url = foo.Bar.class.getResource("file.wsdl");
| } catch (MalformedURLException e) {
| logger.warning("Failed to create URL for the wsdl Location:
'file.wsdl', retrying as a local file");
| logger.warning(e.getMessage());
| }
| PXORDER_WSDL_LOCATION = url;
| }
|
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4255319#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...