[JBossWS] - EJB client for a Web service
by freejohn22
Hi all!
I'm trying to use an EJB as client for a Web service. Unfortunately I'm having some problems when I'm injecting the WebServiceRef into the EJB.
Here's my code:
This is the WebService in the .war file :
@WebService
| @SOAPBinding(style = SOAPBinding.Style.RPC)
| public class POJOWs implements POJOWsItf
| {
|
| @WebMethod
| public String echo(String input)
| {
| return input + " called !";
| }
| }
This is the EJb in the jar file:
@Stateless
|
| public class EJBClient implements EJBClientItf {
|
|
| @WebServiceRef(POJOWs.class)
| private POJOWs service;
|
| public String callWS(String input) {
|
| System.out.println("EJB called !");
| return service.echo(input);
|
|
| }
| }
Now when I try to lookup my EJb and invoke the method callWS :
<%
| InitialContext ctx = new InitialContext();
| com.sample.EJBClientItf ejb = null;
| ejb = ( com.sample.EJBClientItf)ctx.lookup("StatelessfulExample/EJBClient/remote");
| String ss = ejb.callWS("hello");
| out.println(ss);
|
| %>
Here's the error I get:
javax.ejb.EJBException: java.lang.RuntimeException: Unable to inject jndi dependency: env/com.sample.EJBClient/service into property com.sample.EJBClient.service: WebServiceRef type 'class com.sample.POJOWs' is not assignable to javax.xml.ws.Service
How can I fix it ?
thanks a lot
john
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4186444#4186444
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4186444
17 years, 5 months
[Security & JAAS/JBoss] - Creating a custom PolicyCombiningAlgorithm
by dspoja
Hello,
I am trying to create a custom policy combining algorithm. Unfortunately, the only documentation I have is Sun XACML Programmer's Guide for Version 1.2 from 2004. Since then the API has changed, and I am having a hard time getting my policies to be parsed correctly once I've added the algorithm to the BaseCombiningAlgorithmFactory. I am getting an exception in AbstractPolicy "error parsing combining algorithm". I see that it is using CombiningAlgFactory to get instance of the factory, and that returns only standard combining algorithms. That is why I am getting an exception, but I am not sure how to fix this unless I modify AbstractPolicy, which is probably not the way to do it.
Has anyone gone through this pain before? Which factory did you add your new algorithm to? Any code snippets are greatly appreciated.
Thank you,
Danja
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4186440#4186440
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4186440
17 years, 5 months