You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Kevin Jones <kj...@develop.com> on 2002/12/20 18:16:07 UTC

Returning my own WSDL from ?wsdl

After I've created and deployed a web service is there ant way to get
Axis to turn off automatic WSDL generation when it sees the ?wsdl
parameter and instead get it to return wsdl that i deploy with the
service?

Thanks,

Kevin Jones


Re: Returning my own WSDL from ?wsdl

Posted by Steve Loughran <st...@iseran.com>.
yes, you can config axis to return a file or resource on the classpath,
instead of its own wsdl.  look at reference.html in CVS for details

-steve

----- Original Message -----
From: "Kevin Jones" <kj...@develop.com>
To: "Axis User" <ax...@xml.apache.org>
Sent: Friday, December 20, 2002 09:16
Subject: Returning my own WSDL from ?wsdl


> After I've created and deployed a web service is there ant way to get
> Axis to turn off automatic WSDL generation when it sees the ?wsdl
> parameter and instead get it to return wsdl that i deploy with the
> service?
>
> Thanks,
>
> Kevin Jones
>
>


Re: Returning my own WSDL from ?wsdl

Posted by Steve Loughran <st...@iseran.com>.
yeah, I was catching up.

What would be cool would be if axis would let you name a class that
implemented some getWSDL() method in an interface, so that you could write a
'smart' wsdl generator that even did different things for different callers.

----- Original Message -----
From: "Kevin Jones" <kj...@develop.com>
To: "Axis User" <ax...@xml.apache.org>
Sent: Monday, December 30, 2002 11:03
Subject: Re: Returning my own WSDL from ?wsdl


> I guess you were reading through the threads and hadn't got to the last
> one I posted - I'd already figured this :-)
>
> > well, stick it as a resource in the classpath. You are left with a
separate
> > problem 'what if I want to include full urls in the wsdl', but that may
be
> > tractable at build time
> --
> Kevin Jones
> Developmentor
> www.develop.com
>
>


Re: Returning my own WSDL from ?wsdl

Posted by Kevin Jones <kj...@develop.com>.
I guess you were reading through the threads and hadn't got to the last
one I posted - I'd already figured this :-)

> well, stick it as a resource in the classpath. You are left with a separate
> problem 'what if I want to include full urls in the wsdl', but that may be
> tractable at build time
-- 
Kevin Jones
Developmentor
www.develop.com


Re: Returning my own WSDL from ?wsdl

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: "Kevin Jones" <kj...@develop.com>
To: "Weicheng Peng" <we...@voxa.com>
Cc: "Axis User" <ax...@xml.apache.org>
Sent: Saturday, December 21, 2002 11:58
Subject: Re: Returning my own WSDL from ?wsdl


> > You need to set fullpath file name, axis doesn't use relative path >
> for this
> > case.
>
> Which means it's broken. Setting the full path is useless for several
> reasons:
>
> If I want to deploy the app as a WAR file I won't have a full path.
> Different Servers will have differnet paths
> Windows vs Linux!
>
> I would regard this as a bug,

well, stick it as a resource in the classpath. You are left with a separate
problem 'what if I want to include full urls in the wsdl', but that may be
tractable at build time


Re: Returning my own WSDL from ?wsdl

Posted by Kevin Jones <kj...@develop.com>.
Actually it's not a bug. The code does the right thing, it loads
resources relative to WEB-INF/classes

If I have a WSDL file called MathService.wsdl, I put the file in
WEB-INF/classes, I then add this to server.wsdd

<wsdlFile>/MathService.wsdl</wsdlFile>

Then it works fine - but notice the '/' in front of the name

-- 
Kevin Jones
Developmentor
www.develop.com


Re: Returning my own WSDL from ?wsdl

Posted by Weicheng Peng <we...@voxa.com>.
I agree .
Weicheng

----- Original Message ----- 
From: "Kevin Jones" <kj...@develop.com>
To: "Weicheng Peng" <we...@voxa.com>
Cc: "Axis User" <ax...@xml.apache.org>
Sent: Saturday, December 21, 2002 11:58 AM
Subject: Re: Returning my own WSDL from ?wsdl


> > You need to set fullpath file name, axis doesn't use relative path >
> for this
> > case.
> 
> Which means it's broken. Setting the full path is useless for several
> reasons:
> 
> If I want to deploy the app as a WAR file I won't have a full path.
> Different Servers will have differnet paths
> Windows vs Linux!
> 
> I would regard this as a bug,
> 
> -- 
> Kevin Jones
> Developmentor
> www.develop.com
> 
> 

Re: Returning my own WSDL from ?wsdl

Posted by Kevin Jones <kj...@develop.com>.
> You need to set fullpath file name, axis doesn't use relative path >
for this
> case.

Which means it's broken. Setting the full path is useless for several
reasons:

If I want to deploy the app as a WAR file I won't have a full path.
Different Servers will have differnet paths
Windows vs Linux!

I would regard this as a bug,

-- 
Kevin Jones
Developmentor
www.develop.com




Re: Returning my own WSDL from ?wsdl

Posted by Weicheng Peng <we...@voxa.com>.
You need to set fullpath file name, axis doesn't use relative path for this
case.
there are such code snippet in axis source codes,

WSDDService.java
 public WSDDService(Element e){
        ...
        Element wsdlElem = getChildElement(e, ELEM_WSDD_WSDLFILE);
        if (wsdlElem != null) {
            String fileName = XMLUtils.getChildCharacterData(wsdlElem);
            desc.setWSDLFile(fileName);
        }
        ...
}

SOAPService.java
    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);
        }
    }

This is better fixed by Axis development group . :-)

Weicheng

----- Original Message -----
From: "Kevin Jones" <kj...@develop.com>
To: "Axis User" <ax...@xml.apache.org>
Sent: Saturday, December 21, 2002 8:33 AM
Subject: Re: Returning my own WSDL from ?wsdl


> This works, but only for a given value of works!
>
> I want the WSDL to be part of my web app, so I've added
>
> <wsdlFile>MathService.wsdl</wsdlFile>
>
> to my wsdd file.
>
> I've put the MathService.wsdl file in every directory in the webapp but
> I get the 'Unable to find WSDL file' fault.
>
> So how do I reference the wsdl that's part of the application?
>
> Kevin Jones
>
> On Fri, 2002-12-20 at 19:38, Weicheng Peng wrote:
> > try this
> > just add   <wsdlFile>c:/xmloutput.wsdl</wsdlFile> into service in wsdd.
> >
> >  <service name="xmloutput" provider="java:RPC">
> >   <operation name="xmloutput" qname="xmloutput"
> > returnQName="xmloutputResponse" returnType="ns1:XmloutputResponse"
> > xmlns:ns1="xmloutput">
> >    <parameter name="macroname" type="xsd:string"
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>
> >    <parameter name="item1" type="xsd:double"
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>
> >   </operation>
> >   <parameter name="allowedMethods" value="xmloutput"/>
> >   <parameter name="wsdlPortType" value="xmloutputPortType"/>
> >   <parameter name="className"
value="xmloutput.XmloutputBindingTypeImpl"/>
> >   <parameter name="wsdlServicePort" value="xmloutput"/>
> >   <parameter name="wsdlTargetNamespace" value="xmloutput"/>
> >   <parameter name="wsdlServiceElement" value="xmloutput"/>
> >   <typeMapping
> > deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > qname="ns2:ListItemType"
> > serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
> > type="java:xmloutput.ListItemType" xmlns:ns2="xmloutput"/>
> >   <typeMapping
> > deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
qname="ns3:List"
> > serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
> > type="java:xmloutput.ListItemType[]" xmlns:ns3="xmloutput"/>
> >   <typeMapping
> > deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
qname="ns4:Item1"
> > serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
> > type="java:double[]" xmlns:ns4="xmloutput"/>
> >   <typeMapping
> > deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > qname="ns5:XmloutputEnd"
> > serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
> > type="java:xmloutput.XmloutputEnd" xmlns:ns5="xmloutput"/>
> >   <typeMapping
> > deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
> > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > qname="ns6:XmloutputResponse"
> > serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
> > type="java:xmloutput.XmloutputResponse" xmlns:ns6="xmloutput"/>
> >   <wsdlFile>c:/xmloutput.wsdl</wsdlFile>
> >  </service>
> >
> > Weiceheng
> >
> > ----- Original Message -----
> > From: "Kevin Jones" <kj...@develop.com>
> > To: "Axis User" <ax...@xml.apache.org>
> > Sent: Friday, December 20, 2002 9:16 AM
> > Subject: Returning my own WSDL from ?wsdl
> >
> >
> > > After I've created and deployed a web service is there ant way to get
> > > Axis to turn off automatic WSDL generation when it sees the ?wsdl
> > > parameter and instead get it to return wsdl that i deploy with the
> > > service?
> > >
> > > Thanks,
> > >
> > > Kevin Jones
> >


Re: Returning my own WSDL from ?wsdl

Posted by Kevin Jones <kj...@develop.com>.
This works, but only for a given value of works!

I want the WSDL to be part of my web app, so I've added

<wsdlFile>MathService.wsdl</wsdlFile>

to my wsdd file.

I've put the MathService.wsdl file in every directory in the webapp but
I get the 'Unable to find WSDL file' fault.

So how do I reference the wsdl that's part of the application?

Kevin Jones

On Fri, 2002-12-20 at 19:38, Weicheng Peng wrote:
> try this
> just add   <wsdlFile>c:/xmloutput.wsdl</wsdlFile> into service in wsdd.
> 
>  <service name="xmloutput" provider="java:RPC">
>   <operation name="xmloutput" qname="xmloutput"
> returnQName="xmloutputResponse" returnType="ns1:XmloutputResponse"
> xmlns:ns1="xmloutput">
>    <parameter name="macroname" type="xsd:string"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>
>    <parameter name="item1" type="xsd:double"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>
>   </operation>
>   <parameter name="allowedMethods" value="xmloutput"/>
>   <parameter name="wsdlPortType" value="xmloutputPortType"/>
>   <parameter name="className" value="xmloutput.XmloutputBindingTypeImpl"/>
>   <parameter name="wsdlServicePort" value="xmloutput"/>
>   <parameter name="wsdlTargetNamespace" value="xmloutput"/>
>   <parameter name="wsdlServiceElement" value="xmloutput"/>
>   <typeMapping
> deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> qname="ns2:ListItemType"
> serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
> type="java:xmloutput.ListItemType" xmlns:ns2="xmloutput"/>
>   <typeMapping
> deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" qname="ns3:List"
> serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
> type="java:xmloutput.ListItemType[]" xmlns:ns3="xmloutput"/>
>   <typeMapping
> deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" qname="ns4:Item1"
> serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
> type="java:double[]" xmlns:ns4="xmloutput"/>
>   <typeMapping
> deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> qname="ns5:XmloutputEnd"
> serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
> type="java:xmloutput.XmloutputEnd" xmlns:ns5="xmloutput"/>
>   <typeMapping
> deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> qname="ns6:XmloutputResponse"
> serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
> type="java:xmloutput.XmloutputResponse" xmlns:ns6="xmloutput"/>
>   <wsdlFile>c:/xmloutput.wsdl</wsdlFile>
>  </service>
> 
> Weiceheng
> 
> ----- Original Message -----
> From: "Kevin Jones" <kj...@develop.com>
> To: "Axis User" <ax...@xml.apache.org>
> Sent: Friday, December 20, 2002 9:16 AM
> Subject: Returning my own WSDL from ?wsdl
> 
> 
> > After I've created and deployed a web service is there ant way to get
> > Axis to turn off automatic WSDL generation when it sees the ?wsdl
> > parameter and instead get it to return wsdl that i deploy with the
> > service?
> >
> > Thanks,
> >
> > Kevin Jones
> 


Re: Returning my own WSDL from ?wsdl

Posted by easter <ea...@free.fr>.
Nice tip, but this then raises the question, why doesn't wsdl2java
automagically fill this tag since he's the
one responsible for generating the deployment descriptors...


WH

Weicheng Peng wrote:

>try this
>just add   <wsdlFile>c:/xmloutput.wsdl</wsdlFile> into service in wsdd.
>
> <service name="xmloutput" provider="java:RPC">
>  <operation name="xmloutput" qname="xmloutput"
>returnQName="xmloutputResponse" returnType="ns1:XmloutputResponse"
>xmlns:ns1="xmloutput">
>   <parameter name="macroname" type="xsd:string"
>xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>
>   <parameter name="item1" type="xsd:double"
>xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>
>  </operation>
>  <parameter name="allowedMethods" value="xmloutput"/>
>  <parameter name="wsdlPortType" value="xmloutputPortType"/>
>  <parameter name="className" value="xmloutput.XmloutputBindingTypeImpl"/>
>  <parameter name="wsdlServicePort" value="xmloutput"/>
>  <parameter name="wsdlTargetNamespace" value="xmloutput"/>
>  <parameter name="wsdlServiceElement" value="xmloutput"/>
>  <typeMapping
>deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
>encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>qname="ns2:ListItemType"
>serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
>type="java:xmloutput.ListItemType" xmlns:ns2="xmloutput"/>
>  <typeMapping
>deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
>encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" qname="ns3:List"
>serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
>type="java:xmloutput.ListItemType[]" xmlns:ns3="xmloutput"/>
>  <typeMapping
>deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
>encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" qname="ns4:Item1"
>serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
>type="java:double[]" xmlns:ns4="xmloutput"/>
>  <typeMapping
>deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
>encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>qname="ns5:XmloutputEnd"
>serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
>type="java:xmloutput.XmloutputEnd" xmlns:ns5="xmloutput"/>
>  <typeMapping
>deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
>encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>qname="ns6:XmloutputResponse"
>serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
>type="java:xmloutput.XmloutputResponse" xmlns:ns6="xmloutput"/>
>  <wsdlFile>c:/xmloutput.wsdl</wsdlFile>
> </service>
>
>Weiceheng
>
>----- Original Message -----
>From: "Kevin Jones" <kj...@develop.com>
>To: "Axis User" <ax...@xml.apache.org>
>Sent: Friday, December 20, 2002 9:16 AM
>Subject: Returning my own WSDL from ?wsdl
>
>
>  
>
>>After I've created and deployed a web service is there ant way to get
>>Axis to turn off automatic WSDL generation when it sees the ?wsdl
>>parameter and instead get it to return wsdl that i deploy with the
>>service?
>>
>>Thanks,
>>
>>Kevin Jones
>>    
>>
>
>
>
>  
>



Re: Returning my own WSDL from ?wsdl

Posted by Weicheng Peng <we...@voxa.com>.
try this
just add   <wsdlFile>c:/xmloutput.wsdl</wsdlFile> into service in wsdd.

 <service name="xmloutput" provider="java:RPC">
  <operation name="xmloutput" qname="xmloutput"
returnQName="xmloutputResponse" returnType="ns1:XmloutputResponse"
xmlns:ns1="xmloutput">
   <parameter name="macroname" type="xsd:string"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>
   <parameter name="item1" type="xsd:double"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>
  </operation>
  <parameter name="allowedMethods" value="xmloutput"/>
  <parameter name="wsdlPortType" value="xmloutputPortType"/>
  <parameter name="className" value="xmloutput.XmloutputBindingTypeImpl"/>
  <parameter name="wsdlServicePort" value="xmloutput"/>
  <parameter name="wsdlTargetNamespace" value="xmloutput"/>
  <parameter name="wsdlServiceElement" value="xmloutput"/>
  <typeMapping
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
qname="ns2:ListItemType"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
type="java:xmloutput.ListItemType" xmlns:ns2="xmloutput"/>
  <typeMapping
deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" qname="ns3:List"
serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
type="java:xmloutput.ListItemType[]" xmlns:ns3="xmloutput"/>
  <typeMapping
deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" qname="ns4:Item1"
serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
type="java:double[]" xmlns:ns4="xmloutput"/>
  <typeMapping
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
qname="ns5:XmloutputEnd"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
type="java:xmloutput.XmloutputEnd" xmlns:ns5="xmloutput"/>
  <typeMapping
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
qname="ns6:XmloutputResponse"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
type="java:xmloutput.XmloutputResponse" xmlns:ns6="xmloutput"/>
  <wsdlFile>c:/xmloutput.wsdl</wsdlFile>
 </service>

Weiceheng

----- Original Message -----
From: "Kevin Jones" <kj...@develop.com>
To: "Axis User" <ax...@xml.apache.org>
Sent: Friday, December 20, 2002 9:16 AM
Subject: Returning my own WSDL from ?wsdl


> After I've created and deployed a web service is there ant way to get
> Axis to turn off automatic WSDL generation when it sees the ?wsdl
> parameter and instead get it to return wsdl that i deploy with the
> service?
>
> Thanks,
>
> Kevin Jones