[
https://issues.apache.org/jira/browse/MUSE-214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12482873
]
Dan Jemiolo commented on MUSE-214:
----------------------------------
Before everyone gets excited about the ability to map operation names to any
kind of method available, I'd encourage you to stop and compare the current
Muse descriptor to some other, past descriptors that have been used for similar
tasks. The current Muse descriptor is already, in my opinion, larger than it
should be - I'd like to be able to rely more on convention and less on config
parameters. But we can't do anything about what's already there; it's important
that we try and keep the descriptor as simple as possible so that it does not
turn into the JAX-RPC mapping file.
The JAX-RPC mapping file is a standard descriptor described by the JAX-RPC JSR.
Its schema is here:
http://java.sun.com/xml/ns/j2ee/j2ee_jaxrpc_mapping_1_1.xsd
At the bottom of this comment is an example JAX-RPC mapping file from an old
project we had that ran on WebSphere. It only defines the four WSRP operations
and two WSRL operations, and it has all of the flexibility that has described
in this issue so far. It's also known, inside IBM, as "the file that no human
could create by hand". To me, that is a huge red flag. The Muse descriptor is
no nirvana either, but it's still creatable without the magic of Rational
Application Developer, etc.
It looks to me like we're headed down the road of the JAX-RPC mapping file, and
I want to be sure we don't do so lightly. Muse does not allow operation
overloading right now because that is not compliant with the WS-I Basic
Profile. This means that a capability should not have two methods with the same
name. The problem of two capabilities having the same method after code gen
seems like a design time problem to me - would it not be clearer to change your
own WSDLs/XSDs to accomodate any WSDLs/XSDs that you're importing and cannot
change? It seems like we will end up adding a lot of infrastructure and schema
in order to allow for a confusing interface design. This must be balanced with
the need to meet the original goals of the project, among them, making WS-*
more accessible to the average programmer.
Sample JAX-RPC mapping file for just WSRP and WSRL:
<?xml version="1.0" encoding="UTF-8"?>
<java-wsdl-mapping xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd">
<package-mapping>
<package-type>com.ibm.cowbell.deploy.websphere</package-type>
<namespaceURI>
http://websphere.deploy.cowbell.ibm.com
</namespaceURI>
</package-mapping>
<java-xml-type-mapping>
<java-type>org.w3c.dom.Element</java-type>
<root-type-qname xmlns:rtq="http://xml.apache.org/xml-soap">
rtq:Element
</root-type-qname>
<qname-scope>complexType</qname-scope>
</java-xml-type-mapping>
<java-xml-type-mapping>
<java-type>javax.xml.soap.SOAPElement</java-type>
<root-type-qname
xmlns:rtq="http://websphere.ibm.com/webservices/">
rtq:SOAPElement
</root-type-qname>
<qname-scope>complexType</qname-scope>
</java-xml-type-mapping>
<java-xml-type-mapping>
<java-type>java.lang.Object</java-type>
<root-type-qname xmlns:rtq="http://www.w3.org/2001/XMLSchema">
rtq:anyType
</root-type-qname>
<qname-scope>simpleType</qname-scope>
</java-xml-type-mapping>
<service-interface-mapping>
<service-interface>
com.ibm.cowbell.deploy.websphere.WebSphereTouchpointServiceService
</service-interface>
<wsdl-service-name
xmlns:sim="http://websphere.deploy.cowbell.ibm.com">
sim:WebSphereTouchpointServiceService
</wsdl-service-name>
<port-mapping>
<port-name>WebSphereTouchpointService</port-name>
<java-port-name>WebSphereTouchpointService</java-port-name>
</port-mapping>
</service-interface-mapping>
<service-endpoint-interface-mapping>
<service-endpoint-interface>
com.ibm.cowbell.deploy.websphere.WebSphereTouchpointService
</service-endpoint-interface>
<wsdl-port-type
xmlns:seimwpt="http://websphere.deploy.cowbell.ibm.com">
seimwpt:WebSphereTouchpointService
</wsdl-port-type>
<wsdl-binding
xmlns:seimwb="http://websphere.deploy.cowbell.ibm.com">
seimwb:WebSphereTouchpointServiceSoapBinding
</wsdl-binding>
<service-endpoint-method-mapping>
<java-method-name>handleRequest</java-method-name>
<wsdl-operation>GetResourceProperty</wsdl-operation>
<wrapped-element></wrapped-element>
<method-param-parts-mapping>
<param-position>0</param-position>
<param-type>org.w3c.dom.Element</param-type>
<wsdl-message-mapping>
<wsdl-message
xmlns:mppm="http://websphere.deploy.cowbell.ibm.com">
mppm:GetResourcePropertyRequest
</wsdl-message>
<wsdl-message-part-name>
GetResourceProperty
</wsdl-message-part-name>
<parameter-mode>IN</parameter-mode>
</wsdl-message-mapping>
</method-param-parts-mapping>
<wsdl-return-value-mapping>
<method-return-value>
org.w3c.dom.Element
</method-return-value>
<wsdl-message
xmlns:wrvm="http://websphere.deploy.cowbell.ibm.com">
wrvm:GetResourcePropertyResponse
</wsdl-message>
<wsdl-message-part-name>
GetResourcePropertyResponse
</wsdl-message-part-name>
</wsdl-return-value-mapping>
</service-endpoint-method-mapping>
<service-endpoint-method-mapping>
<java-method-name>handleRequest</java-method-name>
<wsdl-operation>
GetMultipleResourceProperties
</wsdl-operation>
<wrapped-element></wrapped-element>
<method-param-parts-mapping>
<param-position>0</param-position>
<param-type>org.w3c.dom.Element</param-type>
<wsdl-message-mapping>
<wsdl-message
xmlns:mppm="http://websphere.deploy.cowbell.ibm.com">
mppm:GetMultipleResourcePropertiesRequest
</wsdl-message>
<wsdl-message-part-name>
GetMultipleResourceProperties
</wsdl-message-part-name>
<parameter-mode>IN</parameter-mode>
</wsdl-message-mapping>
</method-param-parts-mapping>
<wsdl-return-value-mapping>
<method-return-value>
org.w3c.dom.Element
</method-return-value>
<wsdl-message
xmlns:wrvm="http://websphere.deploy.cowbell.ibm.com">
wrvm:GetMultipleResourcePropertiesResponse
</wsdl-message>
<wsdl-message-part-name>
GetMultipleResourcePropertiesResponse
</wsdl-message-part-name>
</wsdl-return-value-mapping>
</service-endpoint-method-mapping>
<service-endpoint-method-mapping>
<java-method-name>handleRequest</java-method-name>
<wsdl-operation>QueryResourceProperties</wsdl-operation>
<wrapped-element></wrapped-element>
<method-param-parts-mapping>
<param-position>0</param-position>
<param-type>org.w3c.dom.Element</param-type>
<wsdl-message-mapping>
<wsdl-message
xmlns:mppm="http://websphere.deploy.cowbell.ibm.com">
mppm:QueryResourcePropertiesRequest
</wsdl-message>
<wsdl-message-part-name>
QueryResourceProperties
</wsdl-message-part-name>
<parameter-mode>IN</parameter-mode>
</wsdl-message-mapping>
</method-param-parts-mapping>
<wsdl-return-value-mapping>
<method-return-value>
org.w3c.dom.Element
</method-return-value>
<wsdl-message
xmlns:wrvm="http://websphere.deploy.cowbell.ibm.com">
wrvm:QueryResourcePropertiesResponse
</wsdl-message>
<wsdl-message-part-name>
QueryResourcePropertiesResponse
</wsdl-message-part-name>
</wsdl-return-value-mapping>
</service-endpoint-method-mapping>
<service-endpoint-method-mapping>
<java-method-name>handleRequest</java-method-name>
<wsdl-operation>SetResourceProperties</wsdl-operation>
<wrapped-element></wrapped-element>
<method-param-parts-mapping>
<param-position>0</param-position>
<param-type>org.w3c.dom.Element</param-type>
<wsdl-message-mapping>
<wsdl-message
xmlns:mppm="http://websphere.deploy.cowbell.ibm.com">
mppm:SetResourcePropertiesRequest
</wsdl-message>
<wsdl-message-part-name>
SetResourceProperties
</wsdl-message-part-name>
<parameter-mode>IN</parameter-mode>
</wsdl-message-mapping>
</method-param-parts-mapping>
<wsdl-return-value-mapping>
<method-return-value>
org.w3c.dom.Element
</method-return-value>
<wsdl-message
xmlns:wrvm="http://websphere.deploy.cowbell.ibm.com">
wrvm:SetResourcePropertiesResponse
</wsdl-message>
<wsdl-message-part-name>
SetResourcePropertiesResponse
</wsdl-message-part-name>
</wsdl-return-value-mapping>
</service-endpoint-method-mapping>
<service-endpoint-method-mapping>
<java-method-name>handleRequest</java-method-name>
<wsdl-operation>Destroy</wsdl-operation>
<wrapped-element></wrapped-element>
<method-param-parts-mapping>
<param-position>0</param-position>
<param-type>org.w3c.dom.Element</param-type>
<wsdl-message-mapping>
<wsdl-message
xmlns:mppm="http://websphere.deploy.cowbell.ibm.com">
mppm:DestroyRequest
</wsdl-message>
<wsdl-message-part-name>
Destroy
</wsdl-message-part-name>
<parameter-mode>IN</parameter-mode>
</wsdl-message-mapping>
</method-param-parts-mapping>
<wsdl-return-value-mapping>
<method-return-value>
org.w3c.dom.Element
</method-return-value>
<wsdl-message
xmlns:wrvm="http://websphere.deploy.cowbell.ibm.com">
wrvm:DestroyResponse
</wsdl-message>
<wsdl-message-part-name>
DestroyResponse
</wsdl-message-part-name>
</wsdl-return-value-mapping>
</service-endpoint-method-mapping>
<service-endpoint-method-mapping>
<java-method-name>handleRequest</java-method-name>
<wsdl-operation>SetTerminationTime</wsdl-operation>
<wrapped-element></wrapped-element>
<method-param-parts-mapping>
<param-position>0</param-position>
<param-type>org.w3c.dom.Element</param-type>
<wsdl-message-mapping>
<wsdl-message
xmlns:mppm="http://websphere.deploy.cowbell.ibm.com">
mppm:SetTerminationTimeRequest
</wsdl-message>
<wsdl-message-part-name>
SetTerminationTime
</wsdl-message-part-name>
<parameter-mode>IN</parameter-mode>
</wsdl-message-mapping>
</method-param-parts-mapping>
<wsdl-return-value-mapping>
<method-return-value>
org.w3c.dom.Element
</method-return-value>
<wsdl-message
xmlns:wrvm="http://websphere.deploy.cowbell.ibm.com">
wrvm:SetTerminationTimeResponse
</wsdl-message>
<wsdl-message-part-name>
SetTerminationTimeResponse
</wsdl-message-part-name>
</wsdl-return-value-mapping>
</service-endpoint-method-mapping>
<service-endpoint-method-mapping>
<java-method-name>handleRequest</java-method-name>
<wsdl-operation>Create</wsdl-operation>
<wrapped-element></wrapped-element>
<method-param-parts-mapping>
<param-position>0</param-position>
<param-type>org.w3c.dom.Element</param-type>
<wsdl-message-mapping>
<wsdl-message
xmlns:mppm="http://websphere.deploy.cowbell.ibm.com">
mppm:CreateRequest
</wsdl-message>
<wsdl-message-part-name>
Create
</wsdl-message-part-name>
<parameter-mode>IN</parameter-mode>
</wsdl-message-mapping>
</method-param-parts-mapping>
<wsdl-return-value-mapping>
<method-return-value>
org.w3c.dom.Element
</method-return-value>
<wsdl-message
xmlns:wrvm="http://websphere.deploy.cowbell.ibm.com">
wrvm:CreateResponse
</wsdl-message>
<wsdl-message-part-name>
CreateResponse
</wsdl-message-part-name>
</wsdl-return-value-mapping>
</service-endpoint-method-mapping>
</service-endpoint-interface-mapping>
</java-wsdl-mapping>
> XML element name could lead to invalid operation generation.
> ------------------------------------------------------------
>
> Key: MUSE-214
> URL: https://issues.apache.org/jira/browse/MUSE-214
> Project: Muse
> Issue Type: Bug
> Components: Tooling - Code Generation
> Affects Versions: 2.2.0
> Environment: Ubuntu Edgy 6.10, JDK 1.5.0
> Reporter: Jose Antonio
> Assigned To: Dan Jemiolo
> Priority: Minor
> Fix For: 2.3.0
>
>
> Some valid elements named as <element name="this-is-valid"> could lead to the
> generation of invalid function names like
> public void this-is-valid() throws Exception
> Which is not a valid java function name. When dealing with such names, upper
> dashes should be substituted with lower dashes so it generates a valid name:
> public void this_is_valid()
> I've found this while dealing with a wsdl that I have no control over it, so
> I cannot change the element's format because it's from a server that's
> deployed and is going to invoke me with that message.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]