[
https://issues.apache.org/jira/browse/AXIS2-3492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13270763#comment-13270763
]
Andreas Veithen commented on AXIS2-3492:
----------------------------------------
Before proposing to change the meaning of an existing parameter (your patch
changes the code to expect a String instead of a WSDLSupplier), you should
carefully check where in the code that parameter is used and what this change
would break...
orcus2:axis2 veithen$ find . -name "*.java" -exec grep -H WSDLSupplier '{}' ';'
./modules/kernel/src/org/apache/axis2/dataretrieval/WSDLSupplier.java: *
Parameters under the name "WSDLSupplier", it will be queried.
./modules/kernel/src/org/apache/axis2/dataretrieval/WSDLSupplier.java:public
interface WSDLSupplier {
./modules/kernel/src/org/apache/axis2/description/AxisService.java:
// If we find a WSDLSupplier, use that
./modules/kernel/src/org/apache/axis2/description/AxisService.java:
WSDLSupplier supplier = (WSDLSupplier) getParameterValue("WSDLSupplier");
./modules/metadata/src/org/apache/axis2/jaxws/description/builder/JAXWSRIWSDLGenerator.java:import
org.apache.axis2.dataretrieval.WSDLSupplier;
./modules/metadata/src/org/apache/axis2/jaxws/description/builder/JAXWSRIWSDLGenerator.java:public
class JAXWSRIWSDLGenerator implements SchemaSupplier, WSDLSupplier {
./modules/metadata/src/org/apache/axis2/jaxws/description/DescriptionFactory.java:
axisService.addParameter("WSDLSupplier", value);
./modules/metadata/src/org/apache/axis2/jaxws/description/DescriptionFactory.java:
log.info("Unable to set the WSDLSupplier", ex);
Also since when it is necessary to use reflection to invoke a method defined by
an interface?
> WSDLSupplier configuration and/or check is not proper/obvious
> -------------------------------------------------------------
>
> Key: AXIS2-3492
> URL: https://issues.apache.org/jira/browse/AXIS2-3492
> Project: Axis2
> Issue Type: Bug
> Components: kernel
> Reporter: Dobri Kitipov
> Assignee: Amila Chinthaka Suriarachchi
> Attachments: AXIS2-3492.patch
>
>
> Hi everybody,
> There is one mail thread http://marc.info/?l=axis-dev&m=118399944531093&w=2
> 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="xxxxx"
> mep="http://www.w3.org/2004/08/wsdl/in-out"/>
> </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(AxisService.java: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.
> AFAIK when you add a parameter to services/axis2.xml it is supposed to be
> retrieved as String. May be there is a need of an additional new attribute
> like "type". E.g.:
> <parameter name="WSDLSupplier "
> type="class">com.test.wsdlsupplier.MyWSDLSupplier</parameter>
> or for example something like specifing the deployer into axis2.xml:
> <deployer extension=".class" directory="pojo"
> class="org.apache.axis2.deployment.POJODeployer"/>
> or in our case
> <WSDLSupplier class="com.test.wsdlsupplier.MyWSDLSupplier"/> ?
> May be more close to this is the way "ServiceClass" parameter is treated by
> Axis. It finally loads it using a ClassLoader.
> We need to think more deeply which one is preferable.
> I was advised to open the JIRA
> (http://www.mail-archive.com/[email protected]/msg39772.html).
> Best regards, Dobri
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]