[jboss-user] [JBossWS] - web services client
koriel
do-not-reply at jboss.com
Tue Oct 24 10:36:17 EDT 2006
I want to implement a user authentication service using web services..so I have these classes
| package server.webservices;
|
| import javax.ejb.Local;
| import javax.ejb.Remote;
|
| @Local
| @Remote
| public interface LoginService
| {
| public boolean Authenticate(String userid,String passid);
| }
|
| package server.webservices;
|
| import javax.ejb.Local;
| import javax.ejb.Remote;
| import javax.ejb.Stateless;
| import javax.jws.WebMethod;
| import javax.jws.WebService;
|
|
| @Stateless
| @Local( { LoginService.class } )
| @Remote( { LoginService.class } )
|
| @WebService(name = "LoginService",
| serviceName = "LoginService",
| endpointInterface = "server.webservices.LoginServiceSEI"
| )
| public class LoginServiceBean implements LoginService
| {
|
| @WebMethod
| public boolean Authenticate(String userid, String passid)
| {
| //testing
| return true;
| }
|
|
| }
|
| package server.webservices;
|
| import java.rmi.Remote;
| import java.rmi.RemoteException;
|
| import javax.jws.WebMethod;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
|
| import org.jboss.annotation.ejb.RemoteBinding;
| import org.jboss.ws.annotation.PortComponent;
|
| @WebService(name = "LoginService",
| serviceName = "LoginService"
| // See JSR-181 for exact details: http://jcp.org/aboutJava/communityprocess/mrel/jsr181/index.html
| )
|
| @SOAPBinding(style = SOAPBinding.Style.DOCUMENT,
| use = SOAPBinding.Use.LITERAL,
| parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
|
| /*
| * BossWS propriatary annotations
| */
| @RemoteBinding(jndiBinding = "/ejb3/EJBLoginServiceSEI")
| @PortComponent(transportGuarantee="NONE",
| contextRoot = "/",
| urlPattern="/server/soap/LoginService")
| public interface LoginServiceSEI extends Remote
| {
|
|
| public boolean Authenticate(String userid,String passid) throws RemoteException;
| }
|
so I use wstools.sh to generate the client classes and I have four classes
| /*
| * JBossWS WS-Tools Generated Source
| *
| * Generation Date: Thu Oct 12 14:16:24 CEST 2006
| *
| * This generated source code represents a derivative work of the input to
| * the generator that produced it. Consult the input for the copyright and
| * terms of use that apply to this source code.
| */
|
| package client.webservices.client;
|
|
| public class Authenticate
| {
|
| protected java.lang.String string_1;
|
| protected java.lang.String string_2;
| public Authenticate(){}
|
| public Authenticate(java.lang.String string_1, java.lang.String string_2){
| this.string_1=string_1;
| this.string_2=string_2;
| }
| public java.lang.String getString_1() { return string_1 ;}
|
| public void setString_1(java.lang.String string_1){ this.string_1=string_1; }
|
| public java.lang.String getString_2() { return string_2 ;}
|
| public void setString_2(java.lang.String string_2){ this.string_2=string_2; }
|
| }
|
| /*
| * JBossWS WS-Tools Generated Source
| *
| * Generation Date: Thu Oct 12 14:16:24 CEST 2006
| *
| * This generated source code represents a derivative work of the input to
| * the generator that produced it. Consult the input for the copyright and
| * terms of use that apply to this source code.
| */
|
| package client.webservices.client;
|
| public class AuthenticateResponse
| {
|
| protected boolean result;
| public AuthenticateResponse(){}
|
| public AuthenticateResponse(boolean result){
| this.result=result;
| }
| public boolean isResult() { return result ;}
|
| public void setResult(boolean result){ this.result=result; }
|
| }
|
| /*
| * JBossWS WS-Tools Generated Source
| *
| * Generation Date: Thu Oct 12 14:16:24 CEST 2006
| *
| * This generated source code represents a derivative work of the input to
| * the generator that produced it. Consult the input for the copyright and
| * terms of use that apply to this source code.
| */
| package client.webservices.client;
| public interface LoginService_PortType extends java.rmi.Remote
| {
|
| public client.webservices.client.AuthenticateResponse authenticate(client.webservices.client.Authenticate authenticate) throws java.rmi.RemoteException;
| }
|
| /*
| * JBoss, the OpenSource EJB server
| * Distributable under LGPL license. See terms of license at gnu.org.
| */
|
| //Auto Generated by jbossws - Please do not edit!!!
|
| package client.webservices.client;
|
|
| import javax.xml.rpc.*;
|
|
| public interface LoginService_Service extends javax.xml.rpc.Service
| {
|
| public client.webservices.client.LoginService_PortType getLoginServicePort() throws ServiceException;
|
| }
|
so my question is how can I use those clients classes to implement a request in an ejb3.0 bean class. A small example would be great...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980393#3980393
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980393
More information about the jboss-user
mailing list