-
1. Re: How to expose stateless session bean as webservice ?
cazacov Jul 14, 2003 8:58 AM (in response to cazacov)I modified build.bat and now can compile and run HelloWorld example.
But problem remains, I have already jar file with session beans and want to automatically generate webservice wrapper to access EJBs from my C++ application. How can I do it ? -
2. Re: How to expose stateless session bean as webservice ?
samart Jul 14, 2003 5:57 PM (in response to cazacov)the web-service.xml below should help you. the "GLxx" stuff are my own classes/interfaces.
basically, create a filename.wsr and include that as a module in your ear file. all i have in the wsr is a meta-inf with this web-service.xml file. the interfaces that are mentioned in th web-service.xml are from my ejb's in the .jar that's also in the ear.
have fun.
-trevor
<?xml version="1.0" encoding="UTF-8"?>
<deployment name="PRS" targetNamespace="http://www.gs.com/PRS" xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<!--
this is an extension to the Axis deployment descriptor which allows to
specify the naming environment for the deployed ws logic
--> -
3. Re: How to expose stateless session bean as webservice ?
cazacov Jul 21, 2003 5:28 AM (in response to cazacov)Thanks, Samart, now it runs !!!
If my method returns primitive type, it works OK. But if I try to return user-defined class, like
public class TestTransferObject implements java.io.Serializable {
public int intfield;
public String strfield;
public TestTransferObject() {
intfield = 5;
strfield = "some text";
}
}
then server throws an exception:
java.io.IOException: No serializer found for class de.slsag.test.TestTransferObject in registry org.apache.axis.encoding.TypeMappingImpl@a96606
How can I return composite objects ?
PS: I use XMLSPY to send SOAP requests to server. -
4. Re: How to expose stateless session bean as webservice ?
cazacov Jul 21, 2003 8:31 AM (in response to cazacov)Problem solved :-)
I had to add:
<beanMapping qname="myNS:TestTransferObject" xmlns:myNS="urn:TestTransferObject" languageSpecificType="java:de.slsag.test.TestTransferObject"/>
to my web-service.xml file -
5. Re: How to expose stateless session bean as webservice ?
psien Jul 30, 2003 12:53 PM (in response to cazacov)I tried doing this for a stateless session ejb but I get the following error:-
org.apache.axis.ConfigurationException: Could not find home in JNDI
[java] AxisFault
[java] faultCode: {http://xml.apache.org/axis/}Server.generalException
[java] faultString: Could not find home in JNDI
[java] faultActor: null
[java] faultDetail:
[java] Could not find home in JNDI
[java] javax.naming.NameNotFoundException: TLWebService not bound
[java] at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
[java] at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
[java] at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
...
here's the application.xml
<?xml version="1.0" encoding="UTF-8"?>
<display-name>TLWebService</display-name>
<web-uri>tlwebservice.war</web-uri>
<context-root>TLWebService</context-root>
TLWebService.wsr
TLWebServiceEJB.jar
TLWebService.wsr
here's the web-service.xml
<?xml version="1.0" encoding="UTF-8"?>
<deployment
targetNamespace="http://net.jboss.org/TLWebService"
xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<!-- this is an extension to the Axis deployment descriptor which allows to
specify the naming environment for the deployed ws logic -->
The session ejb descriptors are standard ejb-jar.xml:-
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
<!-- Generated XML! -->
<ejb-jar>
<enterprise-beans>
<ejb-name>TLWebServiceEJB</ejb-name>
com.tlc.webservices.TLWebServiceHome
com.tlc.webservices.TLWebService
<ejb-class>com.tlc.webservices.TLWebServiceEJB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<ejb-name>TLWebServiceEJB</ejb-name>
<method-name>*</method-name>
<trans-attribute>NotSupported</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
jboss.xml:-
<?xml version="1.0"?>
<enterprise-beans>
<ejb-name>TLWebServiceEJB</ejb-name>
<jndi-name>TLWebService</jndi-name>
</enterprise-beans> -
6. Re: How to expose stateless session bean as webservice ?
cazacov Aug 28, 2003 7:45 AM (in response to cazacov)Hi, psien
I see some differences in our xml files. Here the are:
application.xml
TLWebService.wsr
web-service.xml
<parameter name="homeInterfaceName" value="TLWebServiceLocalHome"/>
My bean has same EJB and JNDI names
jboss.xml
<ejb-name>TLWebService</ejb-name>
<jndi-name>TLWebService</jndi-name>
I had a vacation at last three weeks, hope you already solved this problem. If not, do not hesitate to contact me by e-mail