Hi all, I get it to work. Now it seems easy. I am using JBossIDE 1.5.1 GA and JBoss 4.0.4RC1. For the client, the one that works is the one generated by wscompile (and not the one generated by JBossIDE). Better than words, I attach my config files.
This is my config file for wscompile to generate the client: <?xml version="1.0" encoding="UTF-8"?> | | <configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config"> | <!-- <service> or <wsdl> or <modelfile> --> | <wsdl | location="http://localhost:8080/OMBrowserEJB/OMBrowserEndpoint?wsdl" | packageName="com.irisel.oms.ws.client2" /> | </configuration> | And this is my build.xml to run wscompile: <?xml version="1.0" encoding="UTF-8"?> | <project name="WS Artifacts Generator" default="_ws_generation_"> | <property file="xdoclet-build.properties" /> | <property name="eclipse.home" value="C:/JBossIDE/eclipse" /> | <property name="xdoclet.basedir" value="${eclipse.home}/plugins/org.jboss.ide.eclipse.xdoclet.core_1.5.1.GA" /> | <property name="jboss.net.version" value="4.0" /> | | <path id="project.classpath"> | <pathelement location="build" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.4/ejb-api.jar" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.4/jacc-api.jar" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.4/jca-api.jar" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.4/jms-api.jar" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.4/jsp-api.jar" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.4/jta-api.jar" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.4/servlet-api.jar" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.4/sql-api.jar" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.ws.core_1.5.1.GA/lib/wsi-1.0/jaxr-api.jar" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.ws.core_1.5.1.GA/lib/wsi-1.0/jaxrpc-api.jar" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.ws.core_1.5.1.GA/lib/wsi-1.0/saaj-api.jar" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.ws.core_1.5.1.GA/lib/wsi-1.0/xml-api.jar" /> | <pathelement location="C:/IRISEL/eclipse/oms/ext/mysql-connector-java-3.0.8-stable-bin.jar" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.aop.core_1.1.1.GA/jboss-aop.jar" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.aop.core_1.1.1.GA/jboss-common.jar" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.aop.core_1.1.1.GA/qdox.jar" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.aop.core_1.1.1.GA/concurrent.jar" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.aop.core_1.1.1.GA/trove.jar" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.aop.core_1.1.1.GA/javassist.jar" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.aop.core_1.1.1.GA/jboss-aspect-library.jar" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.aop.core_1.1.1.GA/bsh-1.3.0.jar" /> | <pathelement location="C:/IRISEL/eclipse/oms/build" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.3/ejb-api.jar" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.3/jca-api.jar" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.3/jms-api.jar" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.3/jsp-api.jar" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.3/jta-api.jar" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.3/servlet-api.jar" /> | <pathelement location="${eclipse.home}/plugins/org.jboss.ide.eclipse.jdt.j2ee.core_1.5.1.GA/lib/j2ee-1.3/sql-api.jar" /> | <pathelement location="C:/IRISEL/jboss/OMSServer/lib/ext/sun/activation.jar" /> | <pathelement location="C:/IRISEL/jboss/OMSServer/lib/ext/sun/improvider.jar" /> | <pathelement location="C:/IRISEL/jboss/OMSServer/lib/ext/sun/imservice.jar" /> | <pathelement location="C:/IRISEL/jboss/OMSServer/lib/ext/sun/jaxen-core.jar" /> | <pathelement location="C:/IRISEL/jboss/OMSServer/lib/ext/sun/jaxrpc-impl.jar" /> | <pathelement location="C:/IRISEL/jboss/OMSServer/lib/ext/sun/jso.jar" /> | <pathelement location="C:/IRISEL/jboss/OMSServer/lib/ext/sun/jss4.jar" /> | <pathelement location="C:/IRISEL/jboss/OMSServer/lib/ext/sun/log4j.jar" /> | <pathelement location="C:/IRISEL/jboss/OMSServer/lib/ext/sun/mail.jar" /> | <pathelement location="C:/IRISEL/jboss/OMSServer/lib/ext/sun/saxpath.jar" /> | <pathelement location="C:/IRISEL/jboss/OMSServer/lib/ext/sun/xmppd.jar" /> | <pathelement location="C:/IRISEL/jboss/OMSServer/lib/ext/sun/xp.jar" /> | <pathelement location="C:/Program Files/Java/JDK1.5.0_04/lib/tools.jar" /> | </path> | | <target name="_ws_generation_" depends="target_wscompile" /> | <target name="target_wscompile" description="wscompile "> | | <taskdef name="wscompile" classname="com.sun.xml.rpc.tools.ant.Wscompile"> | <classpath> | <path refid="project.classpath" /> | </classpath> | </taskdef> | <wscompile verbose="true" xPrintStackTrace="true" keep="true" fork="true" base="build" server="true" sourcebase="src" mapping="src/META-INF/jaxrpc-mapping.xml" nonclassdir="src/META-INF/wsdl" config="wscompile.config.xml"> | <classpath> | <path refid="project.classpath" /> | </classpath> | </wscompile> | </target> | <target name="target_wscompile_client" description="wscompile "> | | <taskdef name="wscompile" classname="com.sun.xml.rpc.tools.ant.Wscompile"> | <classpath> | <path refid="project.classpath" /> | </classpath> | </taskdef> | <wscompile gen="true" base="build" features="explicitcontext,wsi,unwrap" keep="true" debug="true" verbose="true" xPrintStackTrace="true" fork="true" sourcebase="src" config="wscompile.client.config.xml"> | <classpath> | <path refid="project.classpath" /> | </classpath> | </wscompile> | </target> | </project> | My Webservice interface (it's a copy of the EJB Remote interface, changing the declaration to extend Remote: | package com.irisel.oms.ws; | | import java.rmi.Remote; | | /** | * Remote interface for OMGenEJB. | */ | public interface OMBrowserEndpoint | extends Remote | { | /** | * Business method that execs "method" of CLBrowser interface | */ | public java.lang.String exec( java.lang.String method,java.lang.String[] args ) | throws java.rmi.RemoteException; | | /** | * Business method | */ | public java.lang.String echo( java.lang.String s ) | throws java.rmi.RemoteException; | | } | And finally, my Test program: | package com.irisel.oms.ws.client2; | | public class Test { | | /** | * @param args | */ | public static void main(String[] args) { | // TODO Auto-generated method stub | try { | | OMBrowserWebService_Impl locator = new OMBrowserWebService_Impl(); | com.irisel.oms.ws.client2.OMBrowserEndpoint svc = locator.getOMBrowserEndpointPort(); | System.out.println(svc); | String s = svc.echo("hola!"); | System.out.println(s); | } | catch (Exception e) { | e.printStackTrace(); | } | } | } | To generate the client with wscompile, you have to have your web service running, of course. Good luck and cheers !! Jose Manuel View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3932473#3932473 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3932473 ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ JBoss-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jboss-user
