[ 
https://issues.apache.org/jira/browse/TUSCANY-2900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12707297#action_12707297
 ] 

Simon Laws commented on TUSCANY-2900:
-------------------------------------

I've been experimenting with the wsdl gen code and I've extended it to generate 
jms binding and ports in the cases where these are not available. However there 
still remains the problem of how to get at the WSDL. There is one scenario that 
could be used as a workaround and we could make some tactical fixes but let me 
summarize what the situation is so far. The examples here are from 
itest/wsdlgen which will be committed under this JIRA.

1) Explicit URI - No manual WSDL
===========================

Exposes the service over JMS only. No endpoint from which to retrieve ?wsdl

    <component name="HelloWorldServiceComponent1">
        <implementation.java class="helloworld.HelloWorldImpl" />
            <service name="HelloWorldService">
            <binding.ws 
uri="jms:/queue.sample?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;java.naming.provider.url=tcp://localhost:51293"/>
        </service>
    </component>

Leads to 

  <wsdl:binding name="HelloWorldService_Binding" type="tns:HelloWorldService">
    <SOAP:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/jms"/>
    ...
  </wsdl:binding>
  <wsdl:binding name="HelloWorldServiceBinding" type="tns:HelloWorldService">
    <SOAP:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"/>
   ...
  </wsdl:binding>
  <wsdl:service name="HelloWorldServiceService">
    <wsdl:port name="HelloWorldServicePort" 
binding="tns:HelloWorldService_Binding">
      <SOAP:address 
location="jms:/queue.sample?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;java.naming.provider.url=tcp://localhost:51293"/>
    </wsdl:port>
  </wsdl:service>


2) Explicit URI - Manual WSDL describes interface
=======================================

Exposes the service over JMS only. No endpoint from which to retrieve ?wsdl

    <component name="HelloWorldServiceComponent2">
        <implementation.java class="helloworld.HelloWorldImpl" />
        <service name="HelloWorldService">
            <interface.wsdl 
interface="http://helloworld/#wsdl.interface(HelloWorldService)" />
            <binding.ws 
uri="jms:/queue.sample?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;java.naming.provider.url=tcp://localhost:51293"/>
        </service>
    </component>

leads to 

<wsdl:definitions name="HelloWorldServiceComponent2.HelloWorldService" 
targetNamespace="http://helloworld/HelloWorldServiceComponent2/HelloWorldService";
 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
xmlns:tns="http://helloworld/HelloWorldServiceComponent2/HelloWorldService"; 
xmlns:ns0="http://helloworld/"; 
xmlns:SOAP11="http://schemas.xmlsoap.org/wsdl/soap/";>
  <wsdl:import namespace="http://helloworld/"; location="wsdl/helloworld.wsdl">
    </wsdl:import>
  <wsdl:binding name="HelloWorldServiceBinding" type="ns0:HelloWorldService">
    <SOAP11:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="getGreetings">
      <SOAP11:operation soapAction="urn:getGreetings"/>
      <wsdl:input name="getGreetingsRequest">
        <SOAP11:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="getGreetingsResponse">
        <SOAP11:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="HelloWorldServiceService">
    <wsdl:port name="HelloWorldServicePort" 
binding="tns:HelloWorldServiceBinding">
      <SOAP11:address 
location="jms:/queue.sample?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;java.naming.provider.url=tcp://localhost:51293"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

So this actually has an extra JMS binding/port at the moment as the original 
manual WSDL (which is included) also has a JMS binding and JMS port and also 
the HTTP equivalent in the imported manual wsdl. So not precisely correct. 
Would be correct if we removed the bindings and service from the manual WSDL. 

3) Explicit URI - Manual WSDL binding referenced
=======================================

Exposes the service over JMS only. No endpoint from which to retrieve ?wsdl

    <component name="HelloWorldServiceComponent3">
        <implementation.java class="helloworld.HelloWorldImpl" />
        <service name="HelloWorldService">
            <binding.ws 
uri="jms:/queue.sample?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;java.naming.provider.url=tcp://localhost:51293"
                        
wsdlElement="http://helloworld/#wsdl.binding(HelloWorldJmsBinding)"/>
        </service>
    </component>

Leads to 

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="HelloWorldServiceComponent3.HelloWorldService" 
targetNamespace="http://helloworld/HelloWorldServiceComponent3/HelloWorldService";
 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
xmlns:tns="http://helloworld/HelloWorldServiceComponent3/HelloWorldService"; 
xmlns:ns0="http://helloworld/"; 
xmlns:SOAP11="http://schemas.xmlsoap.org/wsdl/soap/";>
  <wsdl:import namespace="http://helloworld/"; location="wsdl/helloworld.wsdl">
    </wsdl:import>
  <wsdl:service name="HelloWorldServiceService">
    <wsdl:port name="HelloWorldServicePort" binding="ns0:HelloWorldJmsBinding">
      <SOAP11:address 
location="jms:/queue.sample?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;java.naming.provider.url=tcp://localhost:51293"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

Again appears correct a this level but the imported manual WSDL still carries 
the existing manually specified ports/bindings which may not be exposed. 

4)  Manual WSDL port referenced
==========================

Exposes the service over JMS only. No endpoint from which to retrieve ?wsdl

    <component name="HelloWorldServiceComponent4">
        <implementation.java class="helloworld.HelloWorldImpl" />
        <service name="HelloWorldService">            
            <binding.ws 
wsdlElement="http://helloworld/#wsdl.port(HelloWorldService/HelloWorldJmsPort)"/>
        </service>
    </component>

Leads to 

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="HelloWorldServiceComponent4.HelloWorldService" 
targetNamespace="http://helloworld/HelloWorldServiceComponent4/HelloWorldService";
 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
xmlns:tns="http://helloworld/HelloWorldServiceComponent4/HelloWorldService"; 
xmlns:ns0="http://helloworld/"; 
xmlns:SOAP11="http://schemas.xmlsoap.org/wsdl/soap/";>
  <wsdl:import namespace="http://helloworld/"; location="wsdl/helloworld.wsdl">
    </wsdl:import>
  <wsdl:service name="HelloWorldServiceService">
    <wsdl:port name="HelloWorldJmsPort" binding="ns0:HelloWorldJmsBinding">
      <SOAP11:address 
location="jms:/queue.sample?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;java.naming.provider.url=tcp://localhost:51293"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

Again appears correct a this level but the imported manual WSDL still carries 
the existing manually specific ports/bindings which may defined endpoints that 
are not explicitly exposed. 


5)  Manual WSDL service referenced
=============================

This is the one case where the service is exposed over JMS and HTTP through the 
configuration of a single binding. This is because the manual WSDL has both JMS 
and HTTP service ports defined. 

    <component name="HelloWorldServiceComponent5">
        <implementation.java class="helloworld.HelloWorldImpl" />
        <service name="HelloWorldService">            
            <binding.ws 
wsdlElement="http://helloworld/#wsdl.service(HelloWorldService)"/>
        </service>
    </component> 

Leads to 

<wsdl:definitions name="HelloWorldServiceComponent5.HelloWorldService" 
targetNamespace="http://helloworld/HelloWorldServiceComponent5/HelloWorldService";
 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
xmlns:tns="http://helloworld/HelloWorldServiceComponent5/HelloWorldService"; 
xmlns:ns0="http://helloworld/"; 
xmlns:SOAP11="http://schemas.xmlsoap.org/wsdl/soap/";>
  <wsdl:import namespace="http://helloworld/"; location="wsdl/helloworld.wsdl">
    </wsdl:import>
  <wsdl:service name="HelloWorldServiceService">
    <wsdl:port name="HelloWorldJmsPort" binding="ns0:HelloWorldJmsBinding">
      <SOAP11:address 
location="jms:/queue.sample?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;java.naming.provider.url=tcp://localhost:51293"/>
    </wsdl:port>
    <wsdl:port name="HelloWorldSoapPort" binding="ns0:HelloWorldSoapBinding">
      <SOAP11:address 
location="http://localhost:8085/HelloWorldServiceComponent"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

The service ports are a repeat of what is in the imported manual WSDL. Going to 
the HTTP service URL, e.g. http://L3AW203:8085/HelloWorldServiceComponent?wsdl, 
will give you a WSDL with both HTTP and JMS service ports in it. 

It seems that we could get more accurate WSDL by excluding the original 
manually specific service and ports from and imported WSDL.  This does however 
show a work around  of manually specifying WSDL with both HTTP and JMS 
endpoints but not ideal if you are starting from Java. 

To fix this we need to answer the meta data exchange question. The general 
solution is to look at general meta data exchange solutions. A couple of 
tactical solutions come to mind. 

1) Look at a single WSDL for a whole service regardless of how many bindings 
(only binding.ws would actually generate a WSDL though). In that way you could 
configure HTTP and JMS endpoints in separate binding and have the WSDL generated

2) add a Tuscany specific flag to binding.ws or to the JMS uri within 
binding.ws to specify a port to be opened up where WSDL can be retrieve from. 

3) the other solutions, from the previous post,  of providing a better command 
line tool etc. are also still valid. 



> WSDL Generation does not respect all binding.ws entries
> -------------------------------------------------------
>
>                 Key: TUSCANY-2900
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2900
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Axis Binding Extension
>    Affects Versions: Java-SCA-1.4
>         Environment: Linux x86_64 Weblogic 9.2.3 JDK 1.5.0_12
>            Reporter: Dave Sowerby
>            Assignee: Simon Laws
>             Fix For: Java-SCA-1.5
>
>
> If I modify the the helloworld-ws-reference-jms's helloworldwsjms.composite 
> file so that the service entry is as follows: 
>           <service name="HelloWorldService">
>               <interface.java interface="helloworld.HelloWorldService" />
>                 <binding.ws 
> uri="jms:/queue.sample?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;java.naming.provider.url=tcp://localhost:61619"/>
>                 <binding.ws /> 
>         </service>
> I find that the generated ?wsdl does not include the binding for the JMS SOAP 
> Endpoint - only the new <binding.ws />
> Also, there is no obvious way for accessing the original 
> helloworld-ws-reference-jms service's generated WSDL.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to