[JBossWS] - Problems in the comunication of a WebService and a client
by Fantagir
Hi!
I'm implementing a webservice using Jbossws and jax-rpc. I develop the next one service:
package edu.campus.osid.authentication.client;
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface IAuthenticationComponent extends Remote{
public boolean isUserAuthenticated(org.osid.OsidContext ctx) throws RemoteException;
}
package edu.campus.osid.authentication.client;
import java.rmi.RemoteException;
import org.osid.OsidContext;
import org.osid.OsidException;
public class AuthenticationComponent implements IAuthenticationComponent {
public boolean isUserAuthenticated(OsidContext ctx) throws RemoteException{
String str;
try {
str = (String) ctx.getContext("iduser");
int iId = Integer.parseInt(str);
if (iId ==1) return true;
else return false;
} catch (OsidException e) {
// TODO Auto-generated catch block
e.printStackTrace();
System.out.println("Error AuthenticationComponentServer/Osid: "+e.getMessage());
throw new RemoteException();
}
}
}
I have the OsidContext class in a .jar that I add in the Java Buid Path of my project. When I build the project no errors appears. But when I want to publish the service (generate the .war of the webservice, generate file .wsdl, mapping.xml) the wstools said that cant find the ?OsidContext? class.
If I unzip the .jar in the directory /bin of my project wstools can fing the classes.
There is another way of to solve this problem? What I have to do?
An other problem is in the client. I develop the client for this webservice and when I execute the next errors appears ?Cannot obtain java type mapping for: {urn:types}OsidContext?
My client code is the next one:
public class Main {
public static void main( String[] args ) throws Exception {
if( args.length < 1 )
{
System.out.println( "Usage: Id name" );
System.exit( 0 );
}
String argument = args[ 0 ];
OsidContext ctx = new OsidContext();
ctx.assignContext("iduser", argument);
//CollectionProperties propietats = new CollectionProperties();
String urlstr = CollectionProperties.getPropiedad("service.url");
String nameServiceStr = CollectionProperties.getPropiedad("service.name");
String namespaceServiceStr = CollectionProperties.getPropiedad("service.namespace");
System.out.println( "Contacting webservice at " + urlstr );
URL url = new URL(urlstr);
//se indican el namespace en el que se encuentra el servicio y su nombre
//(esto se puede ver en el WSDL)
QName qname = new QName(namespaceServiceStr,
nameServiceStr);
ServiceFactory factory = ServiceFactory.newInstance();
Service service = factory.createService( url, qname );
I AuthenticationComponent age = ( I AuthenticationComponent ) service.getPort( IAuthenticationComponent.class );
System.out.println( "age.age(" + id + ")" );
System.out.println( "output:" + age.isUserAuthenticated ( ctx ) );
}
}
What can I do? I have the .jar that contains the class OsidContext in this project as well in the project of the Webservice
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088870#4088870
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088870
17 years, 3 months
[JBossWS] - Re: jbossWS -
by birke
I was searching in my jmx-console but i find three entries:
| jboss.j2ee:
| jar=wfm-server.jar,name=WebServiceNotificationBean,service=EJB3
|
| jboss.management.local:
| J2EEApplication=null,J2EEServer=Local,WebModule=sanssouci-application.jar-wfm-server.jar-ws58591.war,j2eeType=Servlet,name=WebServiceNotificationBean
|
| jboss.web:
| J2EEApplication=none,J2EEServer=none,WebModule=//localhost/wfm-server,j2eeType=Servlet,name=WebServiceNotificationBean
|
but in none of these sites behind the link is written something like "id". sorry i am a quite newbee with the inner core of jboss, i use it mostly for hosting just my ejb's. so please tell me where exact i will find the usefull entry in the jmx-console.
with great thanks ... your birke
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088689#4088689
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088689
17 years, 3 months
[JBossWS] - Re: Problem migrating web service from WS4EE to JBOSSWS
by ggary
I am having the same problem in both 4.0.4 and 4.2.1
The "helloworld' type sample web service works just fine but when I am trying to do a real thing using Spring injected beans then I am getting this exception on deployment:
anonymous wrote : ERROR [-::RMI TCP Connection(25)-10.10.10.10] [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/rsystools/ws]] StandardWrapper.Throwable
| java.lang.IllegalArgumentException: interface org.jboss.mx.util.ProxyContext is not visible from class loader
| at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)
| at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
| at org.jboss.mx.util.MBeanProxy.get(MBeanProxy.java:90)
| at org.jboss.mx.util.MBeanProxy.get(MBeanProxy.java:78)
| at org.jboss.ws.server.AbstractServlet.init(AbstractServlet.java:66)
| at org.jboss.ws.server.ServiceEndpointServlet.init(ServiceEndpointServlet.java:72)
|
If anyone knows the solution, please speak up.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088677#4088677
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088677
17 years, 3 months