When running wsdl2java, there is a -wsdlLocation param that can be used to 
specify exactly what gets embedded into the code.    Thus, ou can use the 
classpath url you specified.

Dan

On Thursday 30 October 2008 8:53:12 pm sreuland wrote:
> I've tried different uri forms and not having any luck. When the wsdl2java
> is run against a wsdl, the Service class that it generates has a static
> initializer for locating the wsdl file during runtime:
>
>  public final static URL WSDL_LOCATION;
>     public final static QName SERVICE = new
> QName("http://namespaces.stuff.my";, "MyService");
>     public final static QName MyPort = new
> QName("http://namespaces.stuff.my";, "MyPort");
>     ....
>     static {
>         URL url = null;
>         try {
>             url = new URL("my.wsdl");
>         } catch (MalformedURLException e) {
>             System.err.println("Can not initialize the default wsdl from
> my.wsdl");
>             // e.printStackTrace();
>         }
>         WSDL_LOCATION = url;
>     }
>
>
> I'm trying to avoid a published wsdl url on the web, the other option
> 'file:my.wsdl' does work but is causing maintenance issue as each client
> needs to place 'my.wsdl' in jvm's startup directory. Ideally I'd like to
> embed the wsdl as a resource in a jar and then reference it from classpath.
> Any possibility that wsdl2java could detect if a 'classpath:' scheme is
> present in wsdllocation parameter like 'classpath:my/stuff/my.wsdl' and
> then emit code like :
>
> static {
>         URL url = null;
>         try {
>             url = new
> MyService.class.getClassLoader().getResource("my/stuff/my.wsdl");
>         } catch (MalformedURLException e) {
>             System.err.println("Can not initialize the default wsdl from
> classpath for my/stuff/my.wsdl");
>             // e.printStackTrace();
>         }
>         WSDL_LOCATION = url;
>     }



-- 
Daniel Kulp
[EMAIL PROTECTED]
http://dankulp.com/blog

Reply via email to