You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Boyan Yurukov (JIRA)" <ji...@apache.org> on 2008/01/18 13:34:34 UTC

[jira] Issue Comment Edited: (AXIS2-3172) Multiple ports in WSDL not supported

    [ https://issues.apache.org/jira/browse/AXIS2-3172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12560363#action_12560363 ] 

yurukov edited comment on AXIS2-3172 at 1/18/08 4:32 AM:
---------------------------------------------------------------

It is still not resolved. It was suggested that it is not allowed to have two wsdl ports with the same transport type. They tell me the idea of different ports is to provide the same functionality over different transports. I haven't found any clue in the specs, then again I haven't looked that hard. You could try and use another binding. 

There is a hack that fixes this in adb. You need to create both skeletons and then merge services.xml and the wsdl skeleton classes. First you copy all the methods in the same class&interface, then you put the message receivers in different packages and make them use the same service implementation class (the merged one). In the end you need to copy the operations from the services.xml of the one port, into the other. For the new operations you have to specify a custom message receiver, because the default is responsible for another port. 

It is possible to merge the message receivers, but it takes a lot of work. You need one wsdl skeleton class, because axis requires it for the automatic wsdl generation (even when you don't use one). 

Here is an example of a merged services.xml. It is a cut down version of what I use.

<serviceGroup>
    <service name="ServiceName">
        <messageReceivers>
            <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" class="org.neon_toolkit.registry.omv.service.lifecyclemanager.NeOnRegistryOMVCentraSiteMessageReceiverInOut"/>
        </messageReceivers>
        <parameter name="ServiceClass">org.neon_toolkit.registry.omv.service.NeOnRegistryOMVCentraSiteSkeleton</parameter>
        <parameter name="useOriginalwsdl">true</parameter>
        <parameter name="modifyUserWSDLPortAddress">true</parameter>
        <operation name="approveObjects" mep="http://www.w3.org/ns/wsdl/in-out">
            <actionMapping>urn:oasis:names:tc:ebxml-regrep:wsdl:registry:bindings:3.0:LifeCycleManagerPortType#approveObjects</actionMapping>
            <outputActionMapping>urn:neon-toolkit-org:registry:omv:service:2.3:LifeCycleManagerPortType:approveObjectsResponse</outputActionMapping>
        </operation>
        /* .....................................  more operations from the port this code was generated for*/
        

      /*.............................this is the copied port with a custom message receiver */
        <operation name="submitAdhocQuery" mep="http://www.w3.org/ns/wsdl/in-out">
			<messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" class="org.neon_toolkit.registry.omv.service.querymanager.NeOnRegistryOMVCentraSiteMessageReceiverInOut"/>        	
            <actionMapping>urn:oasis:names:tc:ebxml-regrep:wsdl:registry:bindings:3.0:QueryManagerPortType#submitAdhocQuery</actionMapping>
            <outputActionMapping>urn:neon-toolkit-org:registry:omv:service:2.3:QueryManagerPortType:submitAdhocQueryResponse</outputActionMapping>
        </operation>
    </service>
</serviceGroup>

      was (Author: yurukov):
    It is still not resolved. It was suggested that it is not allowed to have two wsdl ports with the same transport type. They tell me the idea of different ports is to provide the same functionality over different transports. I haven't found any clue in the specs, then again I haven't looked that hard. You could try and use another binding. 

There is a hack that fixes this in adb. You need to create both skeletons and then merge services.xml and the wsdl skeleton classes. First you copy all the methods in the same class&interface, then you put the message receivers in different packages and make them use the same class (the merged one). In the end you need to copy the operations from the services.xml of the one port, into the other. For the new operations you have to specify a custom message receiver, because the default is responsible for another port. 

It is possible to merge the message receivers, but it takes a lot of work. You need one wsdl skeleton class, because axis requires it for the automatic wsdl generation. 

Here is an example of a merged services.xml. It is a cut down version of what I use.

<serviceGroup>
    <service name="ServiceName">
        <messageReceivers>
            <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" class="org.neon_toolkit.registry.omv.service.lifecyclemanager.NeOnRegistryOMVCentraSiteMessageReceiverInOut"/>
        </messageReceivers>
        <parameter name="ServiceClass">org.neon_toolkit.registry.omv.service.NeOnRegistryOMVCentraSiteSkeleton</parameter>
        <parameter name="useOriginalwsdl">true</parameter>
        <parameter name="modifyUserWSDLPortAddress">true</parameter>
        <operation name="approveObjects" mep="http://www.w3.org/ns/wsdl/in-out">
            <actionMapping>urn:oasis:names:tc:ebxml-regrep:wsdl:registry:bindings:3.0:LifeCycleManagerPortType#approveObjects</actionMapping>
            <outputActionMapping>urn:neon-toolkit-org:registry:omv:service:2.3:LifeCycleManagerPortType:approveObjectsResponse</outputActionMapping>
        </operation>
        /* .....................................  more operations from the port this code was generated for*/
        

      /*.............................this is the copied port with a custom message receiver */
        <operation name="submitAdhocQuery" mep="http://www.w3.org/ns/wsdl/in-out">
			<messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" class="org.neon_toolkit.registry.omv.service.querymanager.NeOnRegistryOMVCentraSiteMessageReceiverInOut"/>        	
            <actionMapping>urn:oasis:names:tc:ebxml-regrep:wsdl:registry:bindings:3.0:QueryManagerPortType#submitAdhocQuery</actionMapping>
            <outputActionMapping>urn:neon-toolkit-org:registry:omv:service:2.3:QueryManagerPortType:submitAdhocQueryResponse</outputActionMapping>
        </operation>
    </service>
</serviceGroup>
  
> Multiple ports in WSDL not supported
> ------------------------------------
>
>                 Key: AXIS2-3172
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3172
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb, codegen
>    Affects Versions: 1.3, 1.2
>         Environment: WinXP
>            Reporter: Boyan Yurukov
>            Assignee: Amila Chinthaka Suriarachchi
>
> I have a wsdl with two ports in one service:
>   <service name="DaService">
>     <port name="OnePort" binding="tns:OneBinding">
>       <soap:address location="http://localhost:28080/soap"/>
>     </port>
>     <port name="TwoPort" binding="tns:TwoBinding">
>       <soap:address location="http://localhost:28080/soap"/>
>     </port>
>   </service>
> When I try to generate a service with wsdl2java I run this command: 
>   "%AXIS2_HOME%\bin\wsdl2java.bat" -uri DaService.wsdl -p com.my.namespace -d adb -s -ss -sd -ssi -ap
> However only code for the first port is generated. The wsdl in the service still contains both ports as it is copied from the original file, but in the java code there are methods only for one port. Here is the services.xml:
> <serviceGroup>
>     <service name="DaService">
>         <messageReceivers>
>             <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" class="com.my.namespace.DaServiceMessageReceiverInOut"/>
>         </messageReceivers>
>         <parameter name="ServiceClass">com.my.namespace.DaServiceSkeleton</parameter>
>         <parameter name="useOriginalwsdl">true</parameter>
>         <parameter name="modifyUserWSDLPortAddress">true</parameter>
>         <operation name="submitAdhocQuery" mep="http://www.w3.org/ns/wsdl/in-out">
>             <actionMapping>urn:com:my:namespace:bindings:OnePortType#submit</actionMapping>
>             <outputActionMapping>urn:com.my.namespace:OnePortType:submitResponse</outputActionMapping>
>         </operation>
>     </service>
> </serviceGroup>
> (there may be some names and namespace inconsistencies, because I changed them manually for the bug report)
> What I did to make it work is generate the code for both ports and merge it. I edited services.xml, the skeleton, the skeleton interface and the message receiver so that they are all able to work with all the operations from both ports.

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org