Hello,
I'm using Jboss 4.0.5G, JbossWS 1.0.3, SDK 1.5.0_9 and Windows XP_SP2.
I have created theses classes using EJB3 annotation:
package business;
import java.rmi.Remote;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
@WebService
@SOAPBinding(style = Style.RPC)
public interface SelecionarMusicas extends Remote{
public java.util.List selecionarMusicas() ;
}
package business;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.Remote;
import javax.ejb.Stateless;
import javax.jws.WebService;
import transfer.MusicaTO;
import delegate.ManterMusicaDelegate;
import exceptions.MusicaException;
@Stateless
@WebService(endpointInterface="business.SelecionarMusicas")
@Remote(SelecionarMusicas.class)
public class SelecionarMusicasWS {
public java.util.List selecionarMusicas() throws MusicaException{
List musicas = new ArrayList();
ManterMusicaDelegate delegate;
delegate = new ManterMusicaDelegate();
musicas = delegate.selecionarMusicas();
return musicas;
}
}
package client;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.xml.namespace.QName;
import javax.xml.rpc.ServiceException;
import javax.xml.rpc.ServiceFactory;
import javax.xml.rpc.Service;
import transfer.MusicaTO;
import business.SelecionarMusicas;
public class WebserviceClient {
private static final String nameSpace="http://business/jaws";
private static final String service="SelecionarMusicasService";
private static final String
wsdl="http://localhost:8080/easd2007/SelecionarMusicasWS?wsdl";
public static void main(String[] args) {
try {
System.out.println("Starting Test Client");
URL url = new URL(wsdl);
QName qname = new QName(nameSpace,service);
System.out.println("Creating a service");
ServiceFactory factory = ServiceFactory.newInstance();
Service remote = factory.createService(url, qname);
System.out.println("Obtaining reference to a proxy object");
SelecionarMusicas proxy = (SelecionarMusicas) remote.getPort(SelecionarMusicas.class);
System.out.println("Accessed local proxy: " + proxy);
System.out.println("Receiving data: ");
List musicas = new ArrayList();
musicas = proxy.selecionarMusicas();
for (Iterator iter = musicas.iterator() ; iter.hasNext();){
System.out.print("Nome: "+ iter.next().getNome());
System.out.print("Tom: "+ iter.next().getNome());
System.out.print("Dominante Primário: "+ iter.next().getNome());
System.out.print("Dominante Secundário: "+ iter.next().getNome());
System.out.print("Diminuto Ascendente: "+ iter.next().getNome());
System.out.print("Diminuto Descendente: "+ iter.next().getNome());
System.out.print("Diminuto Alternativo: "+ iter.next().getNome());
System.out.print("Clichê Harmônico: "+ iter.next().getNome());
}
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (ServiceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
When I try to use a webservice client happens it:
Exception in thread "main" org.jboss.ws.WSException: Cannot obtain java type
mapping for: {http://business/jaws}List
at
org.jboss.ws.deployment.JSR109MetaDataBuilder.buildParameterMetaDataRpc(JSR109MetaDataBuilder.java:321)
at
org.jboss.ws.deployment.JSR109MetaDataBuilder.setupOperationsFromWSDL(JSR109MetaDataBuilder.java:196)
at
org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaDataInternal(JSR109ClientMetaDataBuilder.java:208)
at
org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:126)
at
org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:82)
at org.jboss.ws.jaxrpc.ServiceImpl.(ServiceImpl.java:96)
at org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:157)
at org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:128)
at client.WebserviceClient.main(Unknown Source)
Somebody know why ?
Thanks!
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084262#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...