Hi,

I'm testing jax-ws integration in openejb.
Considering we have a web service endpoint interface
@WebService(targetNamespace="http://superbiz.org/wsdl"; )
public interface CalculatorWs {
        public int sum(int add1, int add2);
        public int multiply(int mul1, int mul2);
}

with one implementation
@Stateless
@WebService(
        portName = "CalculatorPort",
        serviceName = "CalculatorWsService",
        targetNamespace = "http://superbiz.org/wsdl";,
        endpointInterface = "org.superbiz.calculator.CalculatorWs")
public class CalculatorImpl implements CalculatorWs, CalculatorRemote    {
...
}

I would like to publish again this web service with this implementation.
So my ejb-jar.xml defines a new session
        <session>
            <ejb-name>CalculatorImplUsernameTokenPlainPassword</ejb-name>
           
<service-endpoint>org.superbiz.calculator.CalculatorWs</service-endpoint>
            <ejb-class>org.superbiz.calculator.CalculatorImpl</ejb-class>
        </session>

The new session bean is created and well bound to JNDI. I'm able to use both
with the local ejb interface.
But, I expected to have 2 web services published, but ... not !

After a short investigation, it seems to me it can not work because in the
WsDeployer.java:291 we have
webserviceDescription.getPortComponent().add(portComponent);

Both session beans have the same portComponentName (the
ejbClass.getSimpleName()) so when deploying the second port component, it
replaces the first one.

I found a work around using the old webservices.xml file
<webservice-description>
       
<webservice-description-name>CalculatorImplUsernameTokenPlainPasswordWS</webservice-description-name>
<!--       
<wsdl-file>META-INF/CalculatorImplUsernameTokenPlainPasswordWSService.wsdl</wsdl-file>-->
<!--       
<jaxrpc-mapping-file>META-INF/CalculatorImplUsernameTokenPlainPassword-mapping.xml</jaxrpc-mapping-file>-->
        <port-component>
           
<port-component-name>CalculatorImplTimestamp</port-component-name>
            <wsdl-port>CalculatorImplUsernameTokenPlainPassword</wsdl-port>
           
<service-endpoint-interface>org.superbiz.calculator.CalculatorWs</service-endpoint-interface>
            <service-impl-bean>
               
<ejb-link>CalculatorImplUsernameTokenPlainPassword</ejb-link>
            </service-impl-bean>
        </port-component>
    </webservice-description>

It works for me but as you probably noticed, I'm currently offending the XSD
as I should have <wsdl-file> and <jaxrpc-mapping-file> tags.

Do you agree on that behavior ?
Do you have any other solution ?

Thanks.
Jean-Louis
-- 
View this message in context: 
http://www.nabble.com/How-to-define-more-than-one-port-component-for-one-endpoint-interface-implementation-tp22678764p22678764.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Reply via email to