I tried the example in section 2.2.2 of WS binding spec (line 201 to 225).

I have no problem if the service is promoted as following definition:

<service name="BService" promoted="BComponent">
       <interface.java interface=".....BService"/>
       <binding.ws name="BServiceSOAP11" requires="soap.1_1"/>
       <binding.ws requires="soap.1_2"/>
</service>

<component name="BComponent">
        <implementation.java class=".....BServiceImpl"/>
</component>

<component name="AComponent1">
    <implementation.java class=".....AServiceImpl"/>
    <reference name="b1">
        <interface.java interface=".....BService"/>
        <binding.ws requires="soap.1_2" uri="http://localhost:8080/BService"/>
    </reference>
</component>



But, if the serivice is not promoted as following definition:

<component name="BComponent">
        <implementation.java
class="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.impl.BServiceImpl"/>
        <service name="BService">
              <interface.java
interface="org.apache.tuscany.sca.vtest.wsbinding.nowsdl.multisoapbindings.BService"/>
              <binding.ws name="BServiceSOAP11" requires="soap.1_1"/>
              <binding.ws requires="soap.1_2"/>
       </service>
</component>

<component name="AComponent1">
        <implementation.java class="....AServiceImpl"/>
        <reference name="b1" target="BComponent/BService">
                <interface.java interface=".....BService"/>
        <binding.ws requires="soap.1_2" uri="http://localhost:8080/BComponent"/>
        </reference>
</component>

I got exception:

May 26, 2008 4:33:05 PM
org.apache.tuscany.sca.http.tomcat.TomcatServer addServletMapping
INFO: Added Servlet mapping: http://gkwan5:8080/BComponent
org.osoa.sca.ServiceRuntimeException:
org.osoa.sca.ServiceRuntimeException:
java.lang.IllegalArgumentException: addChild:  Child name
'/BComponent' is not unique
        at 
org.apache.tuscany.sca.host.embedded.SCADomain.createNewInstance(SCADomain.java:276)
        at 
org.apache.tuscany.sca.host.embedded.SCADomain.newInstance(SCADomain.java:70)


Is it a bug? Or I mis-understand or mis-use about multi-soap bindings?

Thanks
Gilbert

Reply via email to