[JBoss Seam] - Re: SOS-Creating WebService with Seam
by djohan0817
Thanks Chris for your response. Well first of all, I must tell you that I've been using Seam for a few months but I've never done Web Services with it, so I'm kinda new to this stuff.
I'm using :
JBossAS 4.0.5.GA
JBoss Seam 1.1.6.GA
JDK 5.0
In order for you to help me, I'll explain what I've done. I have my project that I've been working on, now I have to add a web Service layer. So I added a new namespace in the project and I create a class and it's interface. Here is the content of my class (it's just a test):
| import javax.jws.WebMethod;
| import javax.jws.WebService;
|
| @WebService
| @Stateless
| public class WS_Test implements WS_TestLocal
| {
| private String message = new String("Hello, ");
|
|
| @WebMethod
| public String sayHello(String name) {
| return message + name + ".";
| }
| }
I'm using Ant with eclipse to explode the project on JBoss. It generates the WSDL file, when I type "http://localhost:8080/jbossws" in the adress bar of my browser, I can see my web Service as a Registered Service Endpoint but when I click on it to view the wsdl, I get an error that tells me that the resource is not available. I don't understand...Any Idea?
Johan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069635#4069635
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4069635
17Â years, 3Â months
[EJB 3.0] - Re: EJBs and XML-RPCs
by ejb3workshop
I suggest you take a look at chapter 16 in the Final EJB3 Specification. (ejb-3_0-fr-spec-ejbcore.pdf)
| <enterprise-beans>
| <session>
| ...
| <ejb-name>EmployeeService</ejb-name>
| <ejb-class>com.wombat.empl.EmployeeServiceBean</ejb-class>
| ...
| <env-entry>
| <description>
| The maximum number of tax exemptions
| allowed to be set.
| </description>
| <env-entry-name>maxExemptions</env-entry-name>
| <env-entry-type>java.lang.Integer</env-entry-type>
| <env-entry-value>15</env-entry-value>
| </env-entry>
| <env-entry>
| <description>
| The minimum number of tax exemptions
| allowed to be set.
| </description>
| <env-entry-name>minExemptions</env-entry-name>
| <env-entry-type>java.lang.Integer</env-entry-type>
| <env-entry-value>1</env-entry-value>
| </env-entry>
| <env-entry>
| <env-entry-name>foo/name1</env-entry-name>
| <env-entry-type>java.lang.String</env-entry-type>
| <env-entry-value>value1</env-entry-value>
| </env-entry>
| <env-entry>
| <env-entry-name>foo/bar/name2</env-entry-name>
| <env-entry-type>java.lang.Boolean</env-entry-type>
| <env-entry-value>true</env-entry-value>
| </env-entry>
| <env-entry>
| <description>Some description.</description>
| <env-entry-name>name3</env-entry-name>
| <env-entry-type>java.lang.Integer</env-entry-type>
| </env-entry>
| <env-entry>
| <env-entry-name>foo/name4</env-entry-name>
| <env-entry-type>java.lang.Integer</env-entry-type>
| <env-entry-value>10</env-entry-value>
| </env-entry>
| ...
| </session>
| </enterprise-beans>
|
and then access it as
| // Obtain the enterprise bean?s environment naming context.
| Context initCtx = new InitialContext();
| Context myEnv = (Context)initCtx.lookup("java:comp/env");
| // Obtain the maximum number of tax exemptions
| // configured by the Deployer.
| Integer maxExemptions =
| (Integer)myEnv.lookup(?maxExemptions?);
| // Obtain the minimum number of tax exemptions
| // configured by the Deployer.
| Integer minExemptions =
| (Integer)myEnv.lookup(?minExemptions?);
| // Use the environment entries to customize business logic.
| if (numberOfExeptions > maxExemptions ||
| numberOfExemptions < minExemptions)
| throw new InvalidNumberOfExemptionsException();
| // Get some more environment entries. These environment
| // entries are stored in subcontexts.
| String val1 = (String)myEnv.lookup(?foo/name1?);
| Boolean val2 = (Boolean)myEnv.lookup(?foo/bar/name2?);
| // The enterprise bean can also lookup using full pathnames.
| Integer val3 = (Integer)
| initCtx.lookup("java:comp/env/name3");
| Integer val4 = (Integer)
| initCtx.lookup("java:comp/env/foo/name4");
|
Hope this helps
Alex
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069628#4069628
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4069628
17Â years, 3Â months
[JBoss Seam] - Re: seam-ui example: s:selectItems example is broken
by stephen.friedrich
Hm, that really doesn't help much.
How about a simple example that uses Seam's s:selectItems bound to a @OneToMany association in a selectMany-Component? :-)
I did a grep through all the examples' code to find this one usage in the ui example. All the other usages of s:selectItems were in selectOne-Components which is much simpler anyway.
I can't see how hibernate mappings can help here. If I understood correctly there's no such beast as an EJB2 entity bean with container-managed bidirectional relationships.
If the UI manipulates only the list no possible mapping can update the single entities, right?
My solution that updates each child entity when the list setter on the parent entity is called seems to work fine, but it feels realy crude.
Also I'd like to avoid loading the "oldGroup" (see code below) if it isn't yet loaded anyway. It's pointless and causes unnecessary DB access because the change in the parent entity does not affect the DB at all. Still I'd like to update already loaded "oldGroup"s so that their state is still valid in case they are processed further in the same conversation.
Any idea?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069627#4069627
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4069627
17Â years, 3Â months
[JBoss Seam] - beginner question on seam-gen deploy/explode task, please he
by Grandfatha
Hi,
I have spent quite some time now on seam-gen and I just cannot understand why I am having all these deployment issues. I have created a Seam project with seam-gen by generating Entities from existing tables of a old and shared database. I then ran seam-setup again to point my project to a different database for testing the new Seam project.
My problem is, I cannot deploy the application to neither 4.2.1 nor 4.2.0. If I run one of the two and then run seam-deploy or seam-explode, it only creates a folder "C:\Applications\server\default\deploy\...." and copies the files into it. But then nothing happens. No EarDeployer pops up on my Jboss Console.. nothing.
When I used JBoss for the last time (4.0.4) deployment was all about putting your "foo.ear" and "foo-ds.xml" in the deploy folder of your application server and you were pretty much done.
Why these new folders ("C:\Applications\...")?
Why cant seam-deploy just point to the deploy folder the old fashioned way?
What do I have to do to make this work?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069624#4069624
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4069624
17Â years, 3Â months