Java Reference
In-Depth Information
Add a Web Service method, testClient() that returns a String message. By
default, all public methods are exposed as web service operations. If you want
to explicitly mark methods as web service methods for maintainability, add the
annotation @WebMethod to them. The operationName and action of attributes may
be specified in the @WebMethod annotation. The operationName attribute maps
the operation name as mapped to the wsdl:operation element in the WSDL. The
default value is the same as the method name.
For SOAP bindings, the action attribute maps to the SoapAction header in the
SOAP messages. In the testClient() method, create an InitialContext object
using the WebLogic Server properties for initial context factory and provider
URL. As the web service is running directly on the WebLogic server instance, the
properties are not required to be specified. However, we have added the properties
for the setting in which the web service is not directly running on theWebLogic
Server instance:
Properties properties = new Properties();
properties.put("java.naming.factory.initial",
"weblogic.jndi.WLInitialContextFactory");
properties.put("java.naming.provider.url", "t3://localhost:7001");
InitialContext context = new InitialContext(properties);
Two methods are available to look up a session bean using the remote
business interface:
• Look up the session bean remote interface using the mapped name. The
global JNDI name for a session bean remote business interface is derived
from the remote business interface name. The format of the global JNDI
name is mappedName#qualified_name_of_businessInterface .
• Specify the business interface JNDI name in the weblogic-ejb-jar.xml
deployment descriptor. The global JNDI name is specified as follows:
<weblogic-enterprise-bean>
<ejb-name>CatalogSessionEJB</ejb-name>
<stateless-session-descriptor>
<business-interface-jndi-name-map>
<business-remote>CatalogSessionEJBRemote</business-remote>
<jndi-name>EJB3-SessionEJB</jndi-name>
</business-interface-jndi-name-map>
</stateless-session-descriptor>
</weblogic-enterprise-bean>
 
Search WWH ::




Custom Search