[JBossWS] - Generate WSDL (From JBoss Eclipse IDE or Command line)
by grdzeli_kaci
hi all,
i am newbie on this,
i need help.
i have documentation about Jboss Web Services and i am trying to run one small example (This is Thomas Diesler's example)
here is example from doc:
1. Remote Interface :
| import javax.ejb.Remote;
| public interface EJB3RemoteInterface {
| String echo(String input);
| }
|
2. Implementation
| import javax.annotation.Resource;
| import javax.ejb.Remote;
| import javax.ejb.SessionContext;
| import javax.ejb.Stateless;
| import javax.jws.WebMethod;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
| import org.jboss.annotation.ejb.RemoteBinding;
| import org.jboss.ws.annotation.WebContext;
|
| /**
| * Test the JSR-181 javax.jws.WebService annotation on an EJB3 endpoint.
| *
| * Uses the wsdlLocation attribute.
| *
| * @author Thomas.Diesler(a)jboss.org
| * @since 29-Apr-2005
| */
| @WebService(
| name = "EndpointInterface",
| targetNamespace = "http://www.openuri.org/2004/04/HelloWorld",
| serviceName = "TestService",
| wsdlLocation = "META-INF/wsdl/TestService.wsdl")
| @WebContext(contextRoot = "/jaxws-samples-webservice02-ejb3", urlPattern = "/*")
| @SOAPBinding(style = javax.jws.soap.SOAPBinding.Style.RPC)
| @Remote(EJB3RemoteInterface.class)
| @RemoteBinding(jndiBinding = "/ejb3/EJB3EndpointInterface")
| @Stateless
| public class EJB3Bean02 implements EJB3RemoteInterface {
| @Resource
| SessionContext sessionContext;
| @WebMethod
| public String echo(String input) {
| System.out.println("Reseive = " + input);
| return input + " - Reseived";
| }
| }
|
3. soapui-project.xml
| <?xml version="1.0" encoding="UTF-8"?>
| <con:soapui-project name="CustomerCare" soapui-version="SNAPSHOT" xmlns:con="http://eviware.com/soapui/config">
| <con:settings>
| <con:setting id="Output Classes Directory">/CustomerCare/bin</con:setting>
| <con:setting id="Output Source Directory">src</con:setting>
| <con:setting id="JBossWS wstools">/home/paatal/InstalledPrograms/jbossws-1.2.1.GA/install/bin</con:setting>
| <con:setting id="Add JBossWS JAR">true</con:setting>
| <con:setting id="com.eviware.soapui.jbosside.jbosswsNature">true</con:setting>
| </con:settings>
| </con:soapui-project>
|
i add JbossWs Nature For My Project from right click on project and add JBossWS -> Add JBossWS Nature,
I want generate WSDL from this class (EJB3Bean02)
after all i tried to generate wsdl from right click on this class and JBossWS -> Publish as web service, enter some parameters and than click generate but i got an error like this :
|
| Running JBossWS wstools for [CustomerCare]
| directory: /home/paatal/InstalledPrograms/Temp/Workshop_Studio_3.2_589/workspace/CustomerCare
| command: sh -c .//home/paatal/InstalledPrograms/jbossws-1.2.1.GA/install/bin/wstools.sh -cp bin -config /tmp/wstools-config52642.xml -dest /home/paatal/InstalledPrograms/Temp/Workshop_Studio_3.2_589/workspace/CustomerCare/src
| -cp: .//home/paatal/InstalledPrograms/jbossws-1.2.1.GA/install/bin/wstools.sh: No such file or directory
|
There is Incorrect path (There is two backslash - > ".//" i don't know why :( ) Is This JBoss Eclipse IDE Bug or maybe i have something incorrect
i configure my JBossWS Instalation Directory From Window -> Preferances -> JBoss Eclipse IDE -> Integrated Tools and set classpath for JBossWS wstools : "/home/paatal/InstalledPrograms/jbossws-1.2.1.GA/install/bin"
am i right ? can anybody help me on it ???
after all i tried to generate wsdl from command line without JBoss Eclipse IDE
| paatal@paatal:~/InstalledPrograms/jbossws-1.2.1.GA/install/bin> ./wstools.sh -cp bin -config /tmp/wstools-config52642.xml -dest /home/paatal/InstalledPrograms/Temp/Workshop_Studio_3.2_589/workspace/CustomerCare/src
|
but i got another error like This :
| Exception in thread "main" java.lang.NoClassDefFoundError: javax/jws/soap/SOAPBinding$ParameterStyle
| at org.jboss.ws.tools.helpers.ToolsHelper.handleJavaToWSDLGeneration(ToolsHelper.java:105)
| at org.jboss.ws.tools.WSTools.process(WSTools.java:133)
| at org.jboss.ws.tools.WSTools.generate(WSTools.java:69)
| at org.jboss.ws.tools.WSTools.generate(WSTools.java:119)
| at org.jboss.ws.tools.WSTools.main(WSTools.java:58)
|
did i something incorrect ?
can anybody help me ?
Regards,
Paata.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4042125#4042125
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4042125
18 years, 11 months
[JBoss Seam] - Nested conversations and transaction management
by FabBoco
Hi,
I have a couple of SFSB:
|
| @Stateful
| @Name("A")
| @Scope(ScopeType.CONVERSATION)
| @Transactional
| public class ABean implements Serializable, A
| {
| @PersistenceContext(type = PersistenceContextType.EXTENDED)
| private EntityManager em;
|
| @End(beforeRedirect=true)
| @Rollback
| public String cancel()
| {
| return "/AList.xhtml";
| }
|
|
| @Begin(nested=true)
| public String initCreate()
| {
| ....
|
| return "/A.xhtml";
| }
|
| @End(beforeRedirect=true)
| public String initCreate()
| {
| ....
|
| return "/ListA.xhtml";
| }
| }
|
| @Stateful
| @Name("B")
| @Scope(ScopeType.CONVERSATION)
| @Transactional
| public class BBean implements Serializable, B
| {
| @PersistenceContext(type = PersistenceContextType.EXTENDED)
| private EntityManager em;
|
| @End(beforeRedirect=true)
| @Rollback
| public String cancel()
| {
| return "/BList.xhtml";
| }
|
|
| @Begin(nested=true)
| public String initCreate()
| {
| ....
|
| return "/B.xhtml";
| }
|
| @End(beforeRedirect=true)
| public String initCreate()
| {
| ....
|
| return "/ListB.xhtml";
| }
| }
|
|
I do the following actions:
1) I call a.initCreate(); (a is an instance of A, a long running conversation is still active before this call, say #1)
1.a) The page A.xhtml is shown
1.b) a new nested conversation is created, say #2
2) from inside the A page I call b.initCreate() (it is opened in a popup)
2.a) The page B.xhtml is shown
2.b) a new nested conversation is created, say #3
3) from inside the B page I call b.processCreate
3.a) conversation #3 is closed
3.b) a new B object is create and stored into the database
4) from inside the A page I call a.cancell
4.a) conversation #2 is rolled back
4.b) no new a object is create but the b object is present into the database
>From this behavior I presume that the parent conversation and the nested conversation have two different database transaction and that the transaction related to the nested conversation is always committed on nested conversation closure even thought the parent conversation (and the related database transaction) could be rolled back.
Am I right ?
Can I change this behavior in some way ?
I wonder why the nested conversation doesn't nest the database transaction too.
Thank you to everybody for his help.
Regards
Fab.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4042118#4042118
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4042118
18 years, 11 months