Author: thomas.diesler(a)jboss.com
Date: 2007-03-17 20:27:03 -0400 (Sat, 17 Mar 2007)
New Revision: 2636
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/client/ServiceRefObjectFactory.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093/ServletTest.java
trunk/jbossws-tests/src/resources/jaxrpc/jbws1093/WEB-INF/web.xml
Log:
Fix <port-component-ref> handling for ejb/servlet
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/client/ServiceRefObjectFactory.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/client/ServiceRefObjectFactory.java 2007-03-17
18:07:34 UTC (rev 2635)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/client/ServiceRefObjectFactory.java 2007-03-18
00:27:03 UTC (rev 2636)
@@ -72,9 +72,10 @@
setValue((UnifiedPortComponentRefMetaData)ref, navigator, namespaceURI,
localName, value);
else if (ref instanceof UnifiedServiceRefMetaData)
setValue((UnifiedServiceRefMetaData)ref, navigator, namespaceURI, localName,
value);
+ else if (ref instanceof UnifiedCallPropertyMetaData)
+ setValue((UnifiedCallPropertyMetaData)ref, navigator, namespaceURI, localName,
value);
else if (ref instanceof UnifiedStubPropertyMetaData)
setValue((UnifiedStubPropertyMetaData)ref, navigator, namespaceURI, localName,
value);
-
}
private void setValue(UnifiedServiceRefMetaData ref, UnmarshallingContext navigator,
String namespaceURI, String localName, String value)
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java 2007-03-17
18:07:34 UTC (rev 2635)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java 2007-03-18
00:27:03 UTC (rev 2636)
@@ -23,24 +23,18 @@
// $Id$
-import java.lang.reflect.AnnotatedElement;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
import java.util.List;
-import java.util.Map;
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.integration.ServiceRefMetaData;
import org.jboss.ws.integration.UnifiedVirtualFile;
-import org.jboss.xb.QNameBuilder;
import org.w3c.dom.Element;
/**
@@ -70,8 +64,8 @@
private String mappingFile;
// The optional <service-qname> element
private QName serviceQName;
- // The LinkedHashMap<String, PortComponentRefMetaData> for
<port-component-ref> elements
- private Map<String, UnifiedPortComponentRefMetaData> portComponentRefs = new
LinkedHashMap<String, UnifiedPortComponentRefMetaData>();
+ // The list <port-component-ref> elements
+ private List<UnifiedPortComponentRefMetaData> portComponentRefs = new
ArrayList<UnifiedPortComponentRefMetaData>();
// The optional <handler> elements. JAX-RPC handlers declared in the standard
J2EE1.4 descriptor
private List<UnifiedHandlerMetaData> handlers = new
ArrayList<UnifiedHandlerMetaData>();
// The optional <handler-chains> elements. JAX-WS handlers declared in the
standard JavaEE5 descriptor
@@ -129,7 +123,7 @@
continue;
}
- UnifiedPortComponentRefMetaData targetPCRef = portComponentRefs.get(seiName);
+ UnifiedPortComponentRefMetaData targetPCRef = getPortComponentRef(seiName);
if (targetPCRef == null)
{
log.warn("Cannot find port component ref with SEI name: " +
seiName);
@@ -190,18 +184,24 @@
public Collection<UnifiedPortComponentRefMetaData> getPortComponentRefs()
{
- return portComponentRefs.values();
+ return portComponentRefs;
}
public UnifiedPortComponentRefMetaData getPortComponentRef(String seiName)
{
- UnifiedPortComponentRefMetaData ref = portComponentRefs.get(seiName);
- return ref;
+ if (seiName == null)
+ throw new IllegalArgumentException("SEI name cannot be null");
+ for (UnifiedPortComponentRefMetaData ref : portComponentRefs)
+ {
+ if (seiName.equals(ref.getServiceEndpointInterface()))
+ return ref;
+ }
+ return null;
}
public void addPortComponentRef(UnifiedPortComponentRefMetaData pcRef)
{
- portComponentRefs.put(pcRef.getServiceEndpointInterface(), pcRef);
+ portComponentRefs.add(pcRef);
}
public List<UnifiedHandlerMetaData> getHandlers()
Modified:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java
===================================================================
---
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java 2007-03-17
18:07:34 UTC (rev 2635)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java 2007-03-18
00:27:03 UTC (rev 2636)
@@ -85,8 +85,7 @@
public void testAccessServlet() throws Exception
{
- String host = System.getProperty("jbosstest.host.name");
- URL servletURL = new URL("http://" + host + ":8080" +
"/jaxrpc-jbws1093/ServletTest");
+ URL servletURL = new URL("http://" + getServerHost() + ":8080"
+ "/jaxrpc-jbws1093/ServletTest");
InputStream is = servletURL.openStream();
InputStreamReader isr = new InputStreamReader(is);
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093/ServletTest.java
===================================================================
---
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093/ServletTest.java 2007-03-17
18:07:34 UTC (rev 2635)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093/ServletTest.java 2007-03-18
00:27:03 UTC (rev 2636)
@@ -38,9 +38,6 @@
*/
public class ServletTest extends HttpServlet
{
-
- private static final long serialVersionUID = 8465532467878198647L;
-
public static final String MESSAGE = "Success!!";
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException
Modified: trunk/jbossws-tests/src/resources/jaxrpc/jbws1093/WEB-INF/web.xml
===================================================================
--- trunk/jbossws-tests/src/resources/jaxrpc/jbws1093/WEB-INF/web.xml 2007-03-17 18:07:34
UTC (rev 2635)
+++ trunk/jbossws-tests/src/resources/jaxrpc/jbws1093/WEB-INF/web.xml 2007-03-18 00:27:03
UTC (rev 2636)
@@ -6,24 +6,24 @@
version="2.4">
<servlet>
+ <servlet-name>TestEndpoint</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxrpc.jbws1093.TestEndpointImpl</servlet-class>
+ </servlet>
+
+ <servlet>
<servlet-name>ServletTest</servlet-name>
<servlet-class>org.jboss.test.ws.jaxrpc.jbws1093.ServletTest</servlet-class>
</servlet>
- <servlet>
+ <servlet-mapping>
<servlet-name>TestEndpoint</servlet-name>
-
<servlet-class>org.jboss.test.ws.jaxrpc.jbws1093.TestEndpointImpl</servlet-class>
- </servlet>
+ <url-pattern>/TestEndpoint</url-pattern>
+ </servlet-mapping>
<servlet-mapping>
<servlet-name>ServletTest</servlet-name>
<url-pattern>/ServletTest</url-pattern>
</servlet-mapping>
- <servlet-mapping>
- <servlet-name>TestEndpoint</servlet-name>
- <url-pattern>/TestEndpoint</url-pattern>
- </servlet-mapping>
-
</web-app>
Show replies by date