Author: heiko.braun(a)jboss.com
Date: 2007-03-21 08:19:10 -0400 (Wed, 21 Mar 2007)
New Revision: 2651
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/client/ServiceRefHandlerImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ServiceRefHandlerJAXWS.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedPortComponentRefMetaData.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/EJBClient.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefClientTestCase.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefEJBTestCase.java
Log:
Fix JBWS-1576
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/client/ServiceRefHandlerImpl.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/client/ServiceRefHandlerImpl.java 2007-03-20
22:24:54 UTC (rev 2650)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/client/ServiceRefHandlerImpl.java 2007-03-21
12:19:10 UTC (rev 2651)
@@ -65,7 +65,7 @@
{
if (sref.isProcessed())
{
- log.warn("Attempt to rebind service-ref: " + sref);
+ // Attempt to rebind service-ref
return;
}
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ServiceRefHandlerJAXWS.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ServiceRefHandlerJAXWS.java 2007-03-20
22:24:54 UTC (rev 2650)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ServiceRefHandlerJAXWS.java 2007-03-21
12:19:10 UTC (rev 2651)
@@ -99,7 +99,7 @@
else if (anElement instanceof Method)
targetClass = ((Method)anElement).getParameterTypes()[0];
- String targetClassName = (targetClass != null ? targetClass.getName() : null);
+ String targetClassName = (targetClass != null ? targetClass.getName() : null);
String externalName = encCtx.getNameInNamespace() + "/" + encName;
log.info("setupServiceRef [jndi=" + externalName + ",target=" +
targetClassName + "]");
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedPortComponentRefMetaData.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedPortComponentRefMetaData.java 2007-03-20
22:24:54 UTC (rev 2650)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedPortComponentRefMetaData.java 2007-03-21
12:19:10 UTC (rev 2651)
@@ -188,14 +188,20 @@
public boolean matches(String seiName, QName portName)
{
- boolean match;
- if (seiName != null && portName != null)
- match = seiName.equals(getServiceEndpointInterface()) &&
portName.equals(getPortQName());
- else if (seiName != null)
- match = seiName.equals(getServiceEndpointInterface());
- else
+ if(seiName==null && portName == null)
+ throw new IllegalArgumentException("Cannot match " + this + "
against seiName=null && portName=null."+
+ "Looks like a broken service-ref setup");
+
+ boolean match = false;
+
+ // match against portName first
+ if(portName!=null)
match = portName.equals(getPortQName());
+ // if it fails try seiName
+ if (!match)
+ match = seiName.equals(getServiceEndpointInterface());
+
return match;
}
}
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/EJBClient.java
===================================================================
---
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/EJBClient.java 2007-03-20
22:24:54 UTC (rev 2650)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/EJBClient.java 2007-03-21
12:19:10 UTC (rev 2651)
@@ -26,9 +26,10 @@
import javax.ejb.Remote;
import javax.ejb.Stateless;
+import javax.naming.InitialContext;
import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
import javax.xml.ws.WebServiceException;
-import javax.xml.ws.WebServiceRef;
import javax.xml.ws.soap.SOAPBinding;
import java.rmi.RemoteException;
import java.util.ArrayList;
@@ -42,31 +43,22 @@
// Provide logging
private static Logger log = Logger.getLogger(EJBClient.class);
- @WebServiceRef(name = "port1")
- TestEndpoint port1;
-
- @WebServiceRef(name = "port2")
- TestEndpoint port2;
-
public String echo(String inStr) throws RemoteException
{
log.info("echo: " + inStr);
ArrayList ports = new ArrayList(2);
- ports.add(port1);
- ports.add(port2);
- /*try
+ try
{
InitialContext iniCtx = new InitialContext();
-
ports.add((TestEndpoint)((Service)iniCtx.lookup("java:comp/env/port1")).getPort(TestEndpoint.class));
-
ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/port2")).getTestEndpointPort());
+
ports.add((TestEndpoint)((Service)iniCtx.lookup("java:comp/env/service1")).getPort(TestEndpoint.class));
+
ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/service2")).getTestEndpointPort());
}
catch (Exception ex)
{
- log.error("Cannot add port", ex);
- //throw new WebServiceException(ex);
- } */
+ throw new WebServiceException(ex);
+ }
for (int i = 0; i < ports.size(); i++)
{
Modified:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefClientTestCase.java
===================================================================
---
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefClientTestCase.java 2007-03-20
22:24:54 UTC (rev 2650)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefClientTestCase.java 2007-03-21
12:19:10 UTC (rev 2651)
@@ -27,6 +27,8 @@
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.soap.SOAPBinding;
import javax.naming.InitialContext;
import junit.framework.Test;
@@ -73,16 +75,17 @@
public void testApplicationClient() throws Exception
{
- System.out.println("FIXME: [JBWS-1576] Implement jaxws <service-ref>
from deployment descriptor");
-
- /*InitialContext iniCtx = getInitialContext("jbossws-client");
+ InitialContext iniCtx = getInitialContext("jbossws-client");
TestEndpoint port =
((Service)iniCtx.lookup("java:comp/env/service2")).getPort(TestEndpoint.class);
assertNotNull(port);
+ BindingProvider bp = (BindingProvider)port;
+ boolean mtomEnabled = ((SOAPBinding)bp.getBinding()).isMTOMEnabled();
+ assertTrue("MTOM should be enabled on port", mtomEnabled);
+
String request = "testApplicationClient";
String response = port.echo(request);
assertEquals(response, request);
- */
}
Modified:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefEJBTestCase.java
===================================================================
---
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefEJBTestCase.java 2007-03-20
22:24:54 UTC (rev 2650)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefEJBTestCase.java 2007-03-21
12:19:10 UTC (rev 2651)
@@ -73,13 +73,7 @@
public void testEJBClient() throws Exception
- {
- if (true)
- {
- System.out.println("FIXME: [JBWS-1576] Implement jaxws <service-ref>
from deployment descriptor");
- return;
- }
-
+ {
InitialContext iniCtx = getInitialContext();
EJBRemote ejbRemote = (EJBRemote)iniCtx.lookup("/ejb/EJBClient");
Show replies by date