[jboss-cvs] JBossAS SVN: r59481 - in trunk/ejb3: src/main/org/jboss/ejb3 and 7 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jan 10 09:19:28 EST 2007


Author: wolfc
Date: 2007-01-10 09:19:11 -0500 (Wed, 10 Jan 2007)
New Revision: 59481

Added:
   trunk/ejb3/src/main/org/jboss/ejb3/webservice/
   trunk/ejb3/src/main/org/jboss/ejb3/webservice/WebServiceContextImpl.java
   trunk/ejb3/src/main/org/jboss/injection/WebServiceContextPropertyInjector.java
   trunk/ejb3/src/resources/test/jaxws/
   trunk/ejb3/src/resources/test/jaxws/TestService.wsdl
   trunk/ejb3/src/test/org/jboss/ejb3/test/jaxws/
   trunk/ejb3/src/test/org/jboss/ejb3/test/jaxws/EndpointEJB.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/jaxws/EndpointInterface.java
   trunk/ejb3/src/test/org/jboss/ejb3/test/jaxws/unit/
   trunk/ejb3/src/test/org/jboss/ejb3/test/jaxws/unit/ContextEJBTestCase.java
Modified:
   trunk/ejb3/build-test.xml
   trunk/ejb3/src/main/org/jboss/ejb3/BaseSessionContext.java
   trunk/ejb3/src/main/org/jboss/injection/ResourceHandler.java
Log:
EJBTHREE-757: getMessageContext

Modified: trunk/ejb3/build-test.xml
===================================================================
--- trunk/ejb3/build-test.xml	2007-01-10 12:32:49 UTC (rev 59480)
+++ trunk/ejb3/build-test.xml	2007-01-10 14:19:11 UTC (rev 59481)
@@ -1813,6 +1813,19 @@
       </jar>
    </target>
 
+   <target name="jaxws"
+      description="Builds a simple jar."
+      depends="compile-classes">
+
+      <mkdir dir="${build.lib}"/>
+
+      <jar jarfile="${build.lib}/jaxws-context.jar">
+         <fileset dir="${build.classes}">
+            <include name="org/jboss/ejb3/test/jaxws/*.class"/>
+         </fileset>
+      </jar>
+   </target>
+
    <target name="wolfc"
       description="Builds all jar files."
       depends="compile-classes">
@@ -3013,6 +3026,10 @@
             
             <!-- For clustered entities -->
             <path refid="hsqldb.hsqldb.classpath"/>
+
+            <!-- For JBossWS testing -->
+            <path refid="sun.jaxb.classpath"/>
+            <pathelement path="${sun.jaxb.lib}/jaxb-impl.jar"/>
          </classpath>
 
          <formatter type="plain" usefile="true"/>
@@ -3438,7 +3455,15 @@
       <wait-on-shutdown conf="all"/>
    </target>
 
+   <target name="start-stop-test" depends="init" description="Start and stop JBoss">
 
+      <start-jboss conf="all" host="${node0}" jvmargs="-Xmx128M"/>
+      <wait-on-host/>
+
+      <stop-jboss/>
+      <wait-on-shutdown conf="all"/>
+   </target>
+
    <target name="no-start-jboss-ejb-tests" depends="init" description="Execute all tests">
       <antcall target="test" inheritRefs="true">
          <param name="test" value="webservices"/>
@@ -3483,6 +3508,9 @@
          <param name="test" value="interceptors"/>
       </antcall>
       <antcall target="test" inheritRefs="true">
+         <param name="test" value="jaxws"/>
+      </antcall>
+      <antcall target="test" inheritRefs="true">
          <param name="test" value="txexceptions"/>
       </antcall>
       <antcall target="test" inheritRefs="true">

Modified: trunk/ejb3/src/main/org/jboss/ejb3/BaseSessionContext.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/BaseSessionContext.java	2007-01-10 12:32:49 UTC (rev 59480)
+++ trunk/ejb3/src/main/org/jboss/ejb3/BaseSessionContext.java	2007-01-10 14:19:11 UTC (rev 59481)
@@ -24,13 +24,12 @@
 import java.io.Externalizable;
 import java.io.IOException;
 import java.io.ObjectInput;
-import java.io.ObjectOutput;
+import java.io.ObjectOutput; 
 import java.security.Identity;
 import java.security.Principal;
-import java.util.HashSet;
+import java.util.HashSet; 
 import java.util.List;
 import java.util.Properties;
-
 import javax.ejb.EJBException;
 import javax.ejb.EJBHome;
 import javax.ejb.EJBLocalHome;
@@ -47,18 +46,21 @@
 import javax.transaction.TransactionManager;
 import javax.transaction.UserTransaction;
 import javax.xml.rpc.handler.MessageContext;
-
 import org.jboss.annotation.security.SecurityDomain;
-import org.jboss.aop.Advisor;
+import org.jboss.aop.Advisor; 
 import org.jboss.ejb3.security.SecurityDomainManager;
 import org.jboss.ejb3.tx.TxUtil;
 import org.jboss.ejb3.tx.UserTransactionImpl;
-import org.jboss.logging.Logger;
+import org.jboss.logging.Logger; 
 import org.jboss.metadata.SecurityRoleRefMetaData;
 import org.jboss.security.RealmMapping;
 import org.jboss.security.RunAsIdentity;
 import org.jboss.security.SecurityAssociation;
-import org.jboss.security.SimplePrincipal;
+import org.jboss.security.SimplePrincipal; 
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
+import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
+import org.jboss.ws.core.soap.MessageContextAssociation;
 
 /**
  * Comment
@@ -72,7 +74,6 @@
    protected transient Container container;
    protected transient RealmMapping rm;
    protected BaseContext baseContext;
-   private MessageContext msgContext;
 
    public BaseSessionContext()
    {
@@ -347,14 +348,16 @@
       return ((SessionContainer)container).getInvokedBusinessInterface();
    }
 
-   public void setMessageContext(MessageContext msgContext) throws IllegalStateException
-   {
-      this.msgContext = msgContext;
-   }
-
    public MessageContext getMessageContext() throws IllegalStateException
    {
-      return msgContext;
+      // disallowed for stateful session beans (EJB3 FR 4.4.1 p 81)
+      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+      if(msgContext == null)
+         throw new IllegalStateException("no message context found");
+      if(msgContext instanceof SOAPMessageContextJAXRPC)
+         return (SOAPMessageContextJAXRPC) msgContext;
+      else
+         return new SOAPMessageContextJAXRPC(msgContext);
    }
 
 }

Added: trunk/ejb3/src/main/org/jboss/ejb3/webservice/WebServiceContextImpl.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/webservice/WebServiceContextImpl.java	2007-01-10 12:32:49 UTC (rev 59480)
+++ trunk/ejb3/src/main/org/jboss/ejb3/webservice/WebServiceContextImpl.java	2007-01-10 14:19:11 UTC (rev 59481)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.webservice;
+
+import java.security.Principal;
+
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.handler.MessageContext;
+
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.w3c.dom.Element;
+
+/**
+ * An injectable web service context.
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class WebServiceContextImpl implements WebServiceContext
+{
+   public WebServiceContextImpl()
+   {
+   }
+   
+   /* (non-Javadoc)
+    * @see javax.xml.ws.WebServiceContext#getEndpointReference(org.w3c.dom.Element[])
+    */
+   public EndpointReference getEndpointReference(Element... arg0)
+   {
+      throw new UnsupportedOperationException();
+   }
+
+   /* (non-Javadoc)
+    * @see javax.xml.ws.WebServiceContext#getEndpointReference(java.lang.Class, org.w3c.dom.Element[])
+    */
+   public <T extends EndpointReference> T getEndpointReference(Class<T> arg0, Element... arg1)
+   {
+      throw new UnsupportedOperationException();
+   }
+
+   /* (non-Javadoc)
+    * @see javax.xml.ws.WebServiceContext#getMessageContext()
+    */
+   public MessageContext getMessageContext()
+   {
+      CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+      if(msgContext instanceof SOAPMessageContextJAXWS)
+         return (SOAPMessageContextJAXWS) msgContext;
+      else
+         return new SOAPMessageContextJAXWS(msgContext);
+   }
+
+   /* (non-Javadoc)
+    * @see javax.xml.ws.WebServiceContext#getUserPrincipal()
+    */
+   public Principal getUserPrincipal()
+   {
+      throw new UnsupportedOperationException();
+   }
+
+   /* (non-Javadoc)
+    * @see javax.xml.ws.WebServiceContext#isUserInRole(java.lang.String)
+    */
+   public boolean isUserInRole(String arg0)
+   {
+      throw new UnsupportedOperationException();
+   }
+
+}

Modified: trunk/ejb3/src/main/org/jboss/injection/ResourceHandler.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/injection/ResourceHandler.java	2007-01-10 12:32:49 UTC (rev 59480)
+++ trunk/ejb3/src/main/org/jboss/injection/ResourceHandler.java	2007-01-10 14:19:11 UTC (rev 59481)
@@ -449,7 +449,7 @@
       }
       else if (type.equals(WebServiceContext.class))
       {
-         // FIXME: For now we skip it, and rely on the WS stack to perform the injection
+         injectors.put(accObj, new WebServiceContextPropertyInjector(property));
       }
       else if (type.equals(String.class)
               || type.equals(Character.class)

Added: trunk/ejb3/src/main/org/jboss/injection/WebServiceContextPropertyInjector.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/injection/WebServiceContextPropertyInjector.java	2007-01-10 12:32:49 UTC (rev 59480)
+++ trunk/ejb3/src/main/org/jboss/injection/WebServiceContextPropertyInjector.java	2007-01-10 14:19:11 UTC (rev 59481)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.injection;
+
+import org.jboss.ejb3.webservice.WebServiceContextImpl;
+import org.jboss.injection.lang.reflect.BeanProperty;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class WebServiceContextPropertyInjector extends AbstractPropertyInjector
+{
+
+   protected WebServiceContextPropertyInjector(BeanProperty property)
+   {
+      super(property);
+   }
+
+   public void inject(Object instance)
+   {
+      property.set(instance, new WebServiceContextImpl());
+   }
+}

Added: trunk/ejb3/src/resources/test/jaxws/TestService.wsdl
===================================================================
--- trunk/ejb3/src/resources/test/jaxws/TestService.wsdl	2007-01-10 12:32:49 UTC (rev 59480)
+++ trunk/ejb3/src/resources/test/jaxws/TestService.wsdl	2007-01-10 14:19:11 UTC (rev 59481)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<definitions name="TestService" targetNamespace="http://org.jboss.ws/jaxws/context" xmlns:tns="http://org.jboss.ws/jaxws/context" 
+  xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+  <types/>
+  <message name="EndpointInterface_echo">
+    <part name="String_1" type="xsd:string"/>
+  </message>
+  <message name="EndpointInterface_echoResponse">
+    <part name="result" type="xsd:string"/>
+  </message>
+  <portType name="EndpointInterface">
+    <operation name="echo" parameterOrder="String_1">
+      <input message="tns:EndpointInterface_echo"/>
+      <output message="tns:EndpointInterface_echoResponse"/>
+    </operation>
+  </portType>
+  <binding name="EndpointInterfaceBinding" type="tns:EndpointInterface">
+    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
+    <operation name="echo">
+      <soap:operation soapAction=""/>
+      <input>
+        <soap:body use="literal" namespace="http://org.jboss.ws/jaxws/context"/>
+      </input>
+      <output>
+        <soap:body use="literal" namespace="http://org.jboss.ws/jaxws/context"/>
+      </output>
+    </operation>
+  </binding>
+  <service name="TestService">
+    <port name="EndpointInterfacePort" binding="tns:EndpointInterfaceBinding">
+    <!--
+      <soap:address location="http://@jbosstest.host.name@:8080/jaxws-context"/>
+    -->
+      <soap:address location="http://localhost:8080/jaxws-context"/>
+    </port>
+  </service>
+</definitions>

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/jaxws/EndpointEJB.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/jaxws/EndpointEJB.java	2007-01-10 12:32:49 UTC (rev 59480)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/jaxws/EndpointEJB.java	2007-01-10 14:19:11 UTC (rev 59481)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.jaxws;
+
+// $Id: EndpointEJB.java 1874 2007-01-09 14:28:41Z thomas.diesler at jboss.com $
+
+import javax.annotation.Resource;
+import javax.ejb.SessionContext;
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.WebServiceException;
+
+import org.jboss.ws.annotation.PortComponent;
+
+ at WebService(endpointInterface = "org.jboss.ejb3.test.jaxws.EndpointInterface", serviceName = "TestService", targetNamespace = "http://org.jboss.ws/jaxws/context")
+ at PortComponent(contextRoot = "/jaxws-context", urlPattern = "/*")
+ at Stateless
+public class EndpointEJB
+{
+   @Resource
+   WebServiceContext wsCtx;
+
+   @Resource
+   SessionContext ejbCtx;
+   
+   public String echo(String input)
+   {
+      try
+      {
+         String retValue = getValueJAXWS() + "/" + getValueJAXRPC();
+         return retValue;
+      }
+      catch (SOAPException ex)
+      {
+         throw new WebServiceException(ex);
+      }
+   }
+
+   private String getValueJAXWS() throws SOAPException
+   {
+      javax.xml.ws.handler.soap.SOAPMessageContext jaxwsContext = (javax.xml.ws.handler.soap.SOAPMessageContext)wsCtx.getMessageContext();
+      SOAPMessage soapMessage = jaxwsContext.getMessage();
+      SOAPElement soapElement = (SOAPElement)soapMessage.getSOAPBody().getChildElements().next();
+      soapElement = (SOAPElement)soapElement.getChildElements().next();
+      return soapElement.getValue();
+   }
+
+   private String getValueJAXRPC() throws SOAPException
+   {
+      javax.xml.rpc.handler.soap.SOAPMessageContext jaxrpcContext = (javax.xml.rpc.handler.soap.SOAPMessageContext)ejbCtx.getMessageContext();
+      SOAPMessage soapMessage = jaxrpcContext.getMessage();
+      SOAPElement soapElement = (SOAPElement)soapMessage.getSOAPBody().getChildElements().next();
+      soapElement = (SOAPElement)soapElement.getChildElements().next();
+      return soapElement.getValue();
+   }
+}

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/jaxws/EndpointInterface.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/jaxws/EndpointInterface.java	2007-01-10 12:32:49 UTC (rev 59480)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/jaxws/EndpointInterface.java	2007-01-10 14:19:11 UTC (rev 59481)
@@ -0,0 +1,35 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.ejb3.test.jaxws;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+ at WebService(targetNamespace = "http://org.jboss.ws/jaxws/context")
+ at SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface EndpointInterface extends Remote
+{
+   String echo(String input) throws RemoteException;
+}

Added: trunk/ejb3/src/test/org/jboss/ejb3/test/jaxws/unit/ContextEJBTestCase.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/jaxws/unit/ContextEJBTestCase.java	2007-01-10 12:32:49 UTC (rev 59480)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/jaxws/unit/ContextEJBTestCase.java	2007-01-10 14:19:11 UTC (rev 59481)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.test.jaxws.unit;
+
+// $Id: ContextEJBTestCase.java 1874 2007-01-09 14:28:41Z thomas.diesler at jboss.com $
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.ejb3.test.jaxws.EndpointInterface;
+import org.jboss.test.JBossTestCase;
+import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+
+/**
+ * Test JAXWS WebServiceContext
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 29-Apr-2005
+ */
+public class ContextEJBTestCase extends JBossTestCase
+{
+   public ContextEJBTestCase(String name)
+   {
+      super(name);
+      // TODO Auto-generated constructor stub
+   }
+
+   public static Test suite() throws Exception
+   {
+      return getDeploySetup(ContextEJBTestCase.class, "jaxws-context.jar");
+   }
+
+   public void testWSDLAccess() throws MalformedURLException
+   {
+      
+      URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-context?wsdl");
+      WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+      WSDLDefinitions wsdlDefinitions = factory.parse(wsdlURL);
+      assertNotNull(wsdlDefinitions);
+   }
+   
+   public void testClientAccess() throws Exception
+   {
+      log.info("In case of connection exception, there is a host name defined in the wsdl, which used to be '@jbosstest.host.name@'");
+      URL wsdlURL = new File("../src/resources/test/jaxws/TestService.wsdl").toURL();
+      QName qname = new QName("http://org.jboss.ws/jaxws/context", "TestService");
+      Service service = Service.create(wsdlURL, qname);
+      EndpointInterface port = (EndpointInterface)service.getPort(EndpointInterface.class);
+      
+      String helloWorld = "Hello world!";
+      Object retObj = port.echo(helloWorld);
+      assertEquals(helloWorld + "/" + helloWorld, retObj);
+   }
+}




More information about the jboss-cvs-commits mailing list