G'day all,
I'm just getting started writing an application, and I'm dealing with JBossWS for
the first time. I've been banging my head against a brick wall for some time now, and
haven't been able to find an answer anywhere (although I'm now suffering from
serious information overload).
Basically, I'm running two components. The first is an EJB3 stateless session bean
"server", deployed in JBoss 4.0.5; the second is a very simple standalone
client. The server deploys fine, and responds appropriately to requests made using soapUI;
however, although the client compiles fine, attempting to run it provides the following
stack trace:
[java] Exception in thread "main" org.jboss.ws.WSException: Cannot obtain java
type mapping for: {http://servercontroller.application.server.webcrawler.thedistillery
| .com.au/jaws}addItemToWatchList
| [java] at
org.jboss.ws.deployment.JSR109MetaDataBuilder.buildParameterMetaDataDoc(JSR109MetaDataBuilder.java:451)
| [java] at
org.jboss.ws.deployment.JSR109MetaDataBuilder.setupOperationsFromWSDL(JSR109MetaDataBuilder.java:200)
| [java] at
org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaDataInternal(JSR109ClientMetaDataBuilder.java:208)
| [java] at
org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:126)
| [java] at
org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:82)
| [java] at org.jboss.ws.jaxrpc.ServiceImpl.<init>(ServiceImpl.java:96)
| [java] at
org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:157)
| [java] at
org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:128)
| [java] at
au.com.thedistillery.webcrawler.server.application.servercontroller.TestWebService.main(TestWebService.java:23)
My initial thought were that I was using a complex type that wasn't being mapped
properly, however when I stripped the code down to only using the available literals (i.e.
long, String, etc.), I kept getting the same error. I have tried using wstools to generate
artifacts, however, all I get is a bunch of Java files which, when integrated into the
client, return an almost identical error. I have also managed to generate an XML mapping
file - do I need to deploy this or make it available to the client in some way?
The client code, in full, is (the class WatchList is a POJO with some very simple
attributes, all of which are Java primitives):
| package au.com.thedistillery.webcrawler.server.application.servercontroller;
|
| import
au.com.thedistillery.webcrawler.server.application.servercontroller.WatchListManagerInterface;
|
| import javax.xml.namespace.QName;
| import javax.xml.rpc.Call;
| import javax.xml.rpc.Service;
| import javax.xml.rpc.ServiceFactory;
| import java.net.URL;
| import java.io.File;
|
| public class TestWebService
| {
| public static void main(String[] args) throws Exception
| {
| URL url = new
URL("http://localhost:8080/crawler/WatchListManager?wsdl"); // from xml files,
soap address, last line
| QName qname = new
QName("http://servercontroller.application.server.webcrawler.thedistillery.com.au/jaws",
| "WatchListManagerInterfaceService");//first line from xml file
|
|
| ServiceFactory factory = ServiceFactory.newInstance();
| Service service = factory.createService(url, qname);// create service
|
| WatchListManagerInterface cm = (WatchListManagerInterface)
service.getPort(WatchListManagerInterface.class);
|
| cm.createWatchList("frank", 1000);
| }
| }
The endpoint interface I'm using looks like:
package au.com.thedistillery.webcrawler.server.application.servercontroller;
|
| import java.net.URI;
| import java.util.List;
|
| import javax.jws.WebMethod;
| import javax.jws.WebService;
|
| @WebService
| public interface WatchListManagerInterface {
|
| /* Methods that provide access to manipulation functionality of WatchLists */
|
| @WebMethod public int createWatchList(String name, long durationMilliSeconds);
| @WebMethod public boolean deleteWatchList(int watchListID);
|
| @WebMethod public boolean addItemToWatchList(int watchListID, URI itemURI);
| @WebMethod public int getWatchListItemID(int watchListID, URI itemURI);
| @WebMethod public boolean removeItemFromWatchList(int watchListID, int
watchListItemID);
|
| @WebMethod public WatchList getWatchList(int watchListID);
| @WebMethod public WatchList[] getAllWatchLists();
| @WebMethod public boolean updateWatchList(WatchList updatedWatchList);
I can provide more code if necessary.
Thanks in advance,
James
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993212#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...