WAS v8.5 > Develop applications > Develop web services - Invocation framework (WSIF) > Use WSIF to invoke web services > Linking a WSIF service to the underlying implementation of the serviceWriting the WSDL extension that lets your WSIF service invoke an enterprise bean
Using the EJB provider, WSIF clients can invoke enterprise beans through RMI-IIOP. Use this information, and associated code fragments, to help to write the Web Services Description Language (WSDL) extension that links your 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 EJB provider does not support the WSIF synchronous timeout. The EJB provider will not time out waiting for a Java method to complete. Your WSIF client can invoke an enterprise bean 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 verify every implementation offers the same semantics. For example, for transactions, the bean deployer must specify TX_REQUIRES_NEW to force a new transaction.
Use the following procedure, and associated code fragments, to help to write the Web Services Description Language (WSDL) extension that enables your WSIF service to invoke an enterprise bean.
- Specify the EJB binding.
<!-- 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:
- A question mark (?) means optional, and an asterisk (*) means 0 or more.
- The name attribute of the <format:typeMap> element is a qualified name of a simple or complex type used by one of the EJB operations.
- The formatType attribute of the <format:typeMap> element is the fully qualified class name for the Java class to which the element specified by name maps.
- The methodName attribute of the <ejb:operation> element is the name of the method on the enterprise bean that is called by the operation.
- The parameterOrder attribute of the <ejb:operation> element contains a white space-separated list of part names that define the order in which they are passed to the EJB method.
- The interface attribute of the <ejb:operation> element must be set to either remote or home. The value specifies the interface of the enterprise bean on which the method named by the methodName attribute is accessible.
- Specify the <ejb:address> element.
<service ... > port* <ejb:address className="nmtoken" jndiName="nmtoken" initialContextFactory="nmtoken" ? jndiProviderURL="nmtoken" ? /> </port> </service>In this example:
- The className attribute of the <ejb:address> element specifies the fully qualified class name of the home interface class of the enterprise bean.
- The jndiName attribute of the <ejb:address> element specifies the full JNDI name used to look up the enterprise bean.
- The initialContextFactory attribute of the <ejb:address> element is optional and specifies the initial context factory class.
- The jndiProviderURL attribute of the <ejb:address> element is optional and specifies the JNDI provider web address.
Related concepts:
WSIF and WSDL
Related
Linking a WSIF service to a SOAP over HTTP service
Linking a WSIF service to a JMS-provided service
Writing the WSDL extension that lets your WSIF service invoke a method on a local Java object
Reference:
WSIFOperation - Synchronous and asynchronous timeouts reference