axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Saminda Abeyruwan" <>
Subject Re: Custom WSDL generation
Date Tue, 05 Feb 2008 08:41:30 GMT
Hi Dobri,

In deed, if the parameter is defined as prior, it would cause a class cast
exception. This should be fixed. The intended used case for WSDLSupplier is
IMHO not what you have identified. You'll be able to find a use case in [1].

Since you are using org.apache.axis2.rpc.receivers.RPCMessageReceiver, this
will generate the WSDL for your POJO. And if policy is applied, it will be
correctly attached to the WSDL.

If you have a pre-defined WSDL, please use the parameter

<parameter name="useOrignalWSDL"> true </parameter>

Where wsdl's endpoint should be named exactly as the service name.  In this
case "Test1".

Please do log a JIRA to prevent class cast exception.

Thank you



[1] .

On Feb 4, 2008 8:52 PM, Dobri Kitipov <> wrote:

> Hi everybody,
> There is one mail thread
> that talks about using
> WSDLSupplier that gives you the possibility to hook your own WSDL on the
> fly. This is done implementing an interface
> org.apache.axis2.dataretrieval.WSDLSupplier.
> What I am currently trying to do is to test this feature. I implemented my
> own WSDLSupplier, but not sure how to specify it. Looking into the above
> mentioned thread we can read:
> "I added a check in printWSDL() to see if there was a WSDLSupplier sitting
> in the "WSDLSupplier" parameter of the AxisService.  If so, it attempts to
> call the WSDLSupplier to obtain the Definition object from there
> dynamically.  It then runs that WSDL through the usual
> printDefinitionObject() API.  This allows my custom service to plug in and
> generate its own WSDL."
> IMHO I should add a parameter into the services.xml file like:
> <serviceGroup>
>   <service name="Test1">
>     <description>Web Service Test1</description>
>     <parameter name="WSDLSupplier">com.test.wsdlsupplier.MyWSDLSupplier
> </parameter>
>     <messageReceivers>
>       <messageReceiver class="
> org.apache.axis2.rpc.receivers.RPCMessageReceiver" mep="
>     </messageReceivers>
>     <operation name="echo"/>
>   </service>
> </serviceGroup>
> The problem is that into org.apache.axis2.description.AxisService method
> public void printWSDL(OutputStream out, String requestIP) the check is:
> WSDLSupplier supplier = (WSDLSupplier)getParameterValue("WSDLSupplier");
> So I receive:
> java.lang.ClassCastException: java.lang.String
>     org.apache.axis2.description.AxisService.printWSDL(
> :1167)
> ...
> which is something expected because  getParameterValue("WSDLSupplier");
> returns a String object, but not WSDLSupplier. So it is not possible to cast
> String to WSDLSupplier.
> Please, advise me how it should be done. I did not find anything that
> explains this.
> Thank you in advance!
> Dobri

Saminda Abeyruwan

Senior Software Engineer
WSO2 Inc. -

View raw message