+

Search Tips   |   Advanced Search

Example: Writing the WSDL extension that enables the WSIF service to invoke an enterprise bean


Use the EJB provider, WSIF clients can invoke enterprise beans through Remote Method Invocation over Internet Inter-ORB Protocol (RMI-IIOP). Use this information, and associated code fragments, to help you to write the WSDL extension that links the WSIF service to a service implemented as an enterprise bean.

Although we can use the EJB provider for EJB(IIOP)-based Web service invocation, IBM recommends that you instead invoke RMI-IIOP Web services using JAX-RPC.

The EJB client JAR file must be available in the client runtime environment with the current provider. The enterprise bean is invoked using typical EJB invocation methods, using RMI-IIOP, with the current security and transaction contexts. If the EJB provider is invoked within a transaction, the transaction is passed to the onward service and the standard EJB transaction attribute applies.

If there are multiple implementations of the service, it is up to the service providers to make sure that every implementation offers the same semantics. For example, in the case of transactions, the bean deployer must specify TX_REQUIRES_NEW to force a new transaction.

The EJB provider does not support the WSIF synchronous timeout. The EJB provider will not time out waiting for a Java method to complete.

To use the EJB provider, we need the following binding specified in the WSDL file:

 

Example

    <!-- EJB binding --> 
    <binding .... > 
        <ejb:binding /> 
        <format:typeMapping style="Java " encoding="Java "/>? 
            <format:typeMap name="qname" formatType="nmtoken"/>* 
        </format:typeMapping> 
        <operation>* 
            <ejb:operation 
                methodName="nmtoken" 
                parameterOrder="nmtoken"
                returnPart="nmtoken"? 
                interface="remote|home" /> 
            <input name="nmtoken"? />? 
            <output name="nmtoken"? />? 
            <fault name="nmtoken"? />? 
        </operation> 
    </binding>

In this example:

In the next example:

    <service ... > 
        <port>* 
            <ejb:address 
                className="nmtoken" 
                jndiName="nmtoken"
                initialContextFactory="nmtoken" ?
                jndiProviderURL="nmtoken" ? /> 
        </port> 
   </service> 





 

Related concepts


WSIF and WSDL

 

Related tasks


Linking a WSIF service to a SOAP over HTTP service
Linking a WSIF service to a JMS-provided service
Linking a WSIF service to the underlying implementation of the service

 

Related


Example: Writing the WSDL extension that enables the WSIF service to invoke a method on a local Java object
WSIFOperation - Synchronous and asynchronous timeouts reference