The class path won't matter (at least not in the version of Axis I checked),
as a FileInputStream is created with the path to the WSDL file. The path
could be absolute or relative to your startup directory.

Taken from org.apache.axis.handlers.soap.SOAPService

    /**
     * Generate WSDL.  If we have a specific file configured in the
     * ServiceDesc, just return that.  Otherwise run through all the Handlers
     * (including the provider) and call generateWSDL() on them via our
     * parent's implementation.
     */
    public void generateWSDL(MessageContext msgContext) throws AxisFault {
        if (serviceDescription == null ||
                serviceDescription.getWSDLFile() == null) {
            super.generateWSDL(msgContext);
            return;
        }

        // Got a WSDL file in the service description, so try and read it
        try {
            Document doc = XMLUtils.newDocument(
                    new FileInputStream(serviceDescription.getWSDLFile()));
            msgContext.setProperty("WSDL", doc);
        } catch (Exception e) {
            throw AxisFault.makeFault(e);
        }
    }

ClassLoader.getResourceAsStream(String name) would have been better.

/Christer

> -----Original Message-----
> From: Ma, Yongjie [mailto:[EMAIL PROTECTED]]
> Sent: den 24 januari 2003 18:22
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: RE: How to Override '?WSDL' to generate WSDL file and How to
> get web service list from Client?
> 
> 
> I still did not get it.
> 
> I played it using 
> CATALINA_HOME/webapps/axis/WEB-WEBINF/classes/samples/stock example, 
> and I put GetQuote.wsdl in same directory too. 
> 
> In the deploy.wsdd, I defined:
> 
> <service name="urn:xmltoday-deployed-quotes" provider="java:RPC">
>    <wsdlFile>full_path_to_wsdl_file</wsdlFile>
>    .....
> </service>
> 
> After deployment, I can get custom wsdl file successfully from ?wsdl.
> 
> But when I tried to use relative path, I always get exception 
> which said 
> "Fault - java.io.FileNotFoundException: GetQuote.wsdl (No 
> such file or directory) "
> 
> In this case, deploy.wsdd looks like:
> <service name="urn:xmltoday-deployed-quotes" provider="java:RPC">
>    <wsdlFile>relative_path_to_wsdl_file</wsdlFile>
>    .....
> </service>
> 
> So could you pls tell me what relatvie_path_to_wsdl_file I 
> should use????
> 
> Thanks
> Jack
> 

Reply via email to