JBossWS SVN: r9029 - stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2009-01-14 11:33:25 -0500 (Wed, 14 Jan 2009)
New Revision: 9029
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
Log:
[JBWS-2368] JAX-WS Deployments Fail For AOP Instrumented Endpoints.
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2009-01-14 16:00:35 UTC (rev 9028)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2009-01-14 16:33:25 UTC (rev 9029)
@@ -559,6 +559,10 @@
{
String javaName = method.getName();
+ // Methods added by JBoss AOP will be marked as synthetic and should be skipped.
+ if (method.isSynthetic() == true)
+ return;
+
// skip asnyc methods, they dont need meta data representation
if (method.getName().endsWith(Constants.ASYNC_METHOD_SUFFIX))
return;
15 years, 11 months
JBossWS SVN: r9028 - stack/native/branches/jbossws-native-2.0.1.SP2_CP.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2009-01-14 11:00:35 -0500 (Wed, 14 Jan 2009)
New Revision: 9028
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/version.properties
Log:
[JBPAPP-1560] Upgrade glassfish-jaxb to 2.1.4.patch01.
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/version.properties
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/version.properties 2009-01-14 15:39:51 UTC (rev 9027)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/version.properties 2009-01-14 16:00:35 UTC (rev 9028)
@@ -18,7 +18,7 @@
ibm-wsdl4j=1.6.2
jbpm-bpel=1.1.0.Beta5
stax-api=1.0
-sun-jaxb=2.1.4
+sun-jaxb=2.1.4.patch01-brew
sun-jaxws=2.1.1
woodstox=3.1.1
wscommons-policy=1.0
15 years, 11 months
JBossWS SVN: r9027 - stack/native/branches/dlofthouse.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2009-01-14 10:39:51 -0500 (Wed, 14 Jan 2009)
New Revision: 9027
Removed:
stack/native/branches/dlofthouse/JBWS-2304/
Log:
Delete old working branch.
15 years, 11 months
JBossWS SVN: r9026 - in stack/native/branches/jaxws21/modules: testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/epr and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-01-14 07:39:11 -0500 (Wed, 14 Jan 2009)
New Revision: 9026
Modified:
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java
stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/epr/EndpointReferenceTestCase.java
Log:
[JBWS-2452] Implementing Provider.readEndpointReference(...)
Modified: stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java
===================================================================
--- stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java 2009-01-13 18:25:02 UTC (rev 9025)
+++ stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java 2009-01-14 12:39:11 UTC (rev 9026)
@@ -30,6 +30,7 @@
import javax.xml.ws.Endpoint;
import javax.xml.ws.EndpointReference;
import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceException;
import javax.xml.ws.WebServiceFeature;
import javax.xml.ws.soap.SOAPBinding;
import javax.xml.ws.spi.Provider;
@@ -37,7 +38,6 @@
import javax.xml.ws.wsaddressing.W3CEndpointReference;
import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
-import org.jboss.util.NotImplementedException;
import org.jboss.wsf.common.DOMUtils;
import org.w3c.dom.Element;
@@ -139,6 +139,16 @@
@Override
public EndpointReference readEndpointReference(Source eprInfoset)
{
- throw new NotImplementedException();
+ if (eprInfoset == null)
+ throw new NullPointerException("Provided eprInfoset cannot be null");
+ try
+ {
+ //we currently support W3CEndpointReference only
+ return new W3CEndpointReference(eprInfoset);
+ }
+ catch (Exception e)
+ {
+ throw new WebServiceException(e);
+ }
}
}
Modified: stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/epr/EndpointReferenceTestCase.java
===================================================================
--- stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/epr/EndpointReferenceTestCase.java 2009-01-13 18:25:02 UTC (rev 9025)
+++ stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/epr/EndpointReferenceTestCase.java 2009-01-14 12:39:11 UTC (rev 9026)
@@ -24,6 +24,9 @@
import java.net.URL;
import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.EndpointReference;
import javax.xml.ws.Service;
import javax.xml.ws.wsaddressing.W3CEndpointReference;
import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
@@ -80,4 +83,29 @@
String retStr = port.echo("hello");
assertEquals("hello|123456789|ABCDEFG", retStr);
}
+
+ public void testEndpointReferenceFromSource() throws Exception
+ {
+ String address = "http://" + getServerHost() + ":8080/jaxws-epr/TestEndpointImpl";
+ URL wsdlURL = new URL(address + "?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/epr", "TestEndpointService");
+
+ StringBuilder sb = new StringBuilder();
+ sb.append("<EndpointReference xmlns=\"http://www.w3.org/2005/08/addressing\">");
+ sb.append("<Address>").append(address).append("</Address>");
+ sb.append("<ServiceName>").append(serviceName).append("</ServiceName>");
+ sb.append("<ReferenceParameters>");
+ sb.append("<fabrikam:CustomerKey xmlns:fabrikam='http://example.com/fabrikam'>123456789</fabrikam:CustomerKey>");
+ sb.append("<fabrikam:ShoppingCart xmlns:fabrikam='http://example.com/fabrikam'>ABCDEFG</fabrikam:ShoppingCart>");
+ sb.append("</ReferenceParameters>");
+ sb.append("</EndpointReference>");
+ Source eprInfoset = new StreamSource(new java.io.StringReader(sb.toString()));
+ EndpointReference epr = EndpointReference.readFrom(eprInfoset);
+
+ Service service = Service.create(wsdlURL, serviceName);
+ TestEndpoint port = service.getPort(epr, TestEndpoint.class);
+ ((StubExt)port).setConfigName("Standard WSAddressing Client");
+ String retStr = port.echo("hello");
+ assertEquals("hello|123456789|ABCDEFG", retStr);
+ }
}
15 years, 11 months
JBossWS SVN: r9025 - in stack/native/branches/jaxws21/modules: core/src/main/java/org/jboss/ws/core/jaxws/spi and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-01-13 13:25:02 -0500 (Tue, 13 Jan 2009)
New Revision: 9025
Modified:
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/CommonBindingProvider.java
stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java
Log:
[JBWS-2452] Implementing getEndpointReference methods in EndpointImpl
Modified: stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/CommonBindingProvider.java
===================================================================
--- stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/CommonBindingProvider.java 2009-01-13 17:31:35 UTC (rev 9024)
+++ stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/CommonBindingProvider.java 2009-01-13 18:25:02 UTC (rev 9025)
@@ -123,10 +123,17 @@
throw new UnsupportedOperationException("Cannot get epr for BindingProvider instances using the XML/HTTP binding");
}
W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
- builder.address(epMetaData.getEndpointAddress());
- builder.serviceName(epMetaData.getServiceMetaData().getServiceName());
- builder.endpointName(epMetaData.getPortName());
- builder.wsdlDocumentLocation(epMetaData.getEndpointAddress() + "?wsdl");
+ if (epMetaData != null)
+ {
+ builder.address(epMetaData.getEndpointAddress());
+ builder.serviceName(epMetaData.getServiceMetaData().getServiceName());
+ builder.endpointName(epMetaData.getPortName());
+ builder.wsdlDocumentLocation(epMetaData.getEndpointAddress() + "?wsdl");
+ }
+ else
+ {
+ log.warn("Cannot get endpoint reference info from endpoint metadata!");
+ }
return EndpointReferenceUtil.transform(clazz, builder.build());
}
Modified: stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
===================================================================
--- stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java 2009-01-13 17:31:35 UTC (rev 9024)
+++ stack/native/branches/jaxws21/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java 2009-01-13 18:25:02 UTC (rev 9025)
@@ -21,30 +21,36 @@
*/
package org.jboss.ws.core.jaxws.spi;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.StringTokenizer;
+import java.util.concurrent.Executor;
+
+import javax.xml.transform.Source;
+import javax.xml.ws.Binding;
+import javax.xml.ws.Endpoint;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServicePermission;
+import javax.xml.ws.http.HTTPBinding;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
+
import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
import org.jboss.ws.core.jaxws.binding.BindingProviderImpl;
+import org.jboss.ws.core.jaxws.binding.EndpointReferenceUtil;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.http.HttpContext;
import org.jboss.wsf.spi.http.HttpServer;
import org.jboss.wsf.spi.http.HttpServerFactory;
+import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.management.ServerConfigFactory;
import org.w3c.dom.Element;
-import javax.xml.transform.Source;
-import javax.xml.ws.Binding;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Endpoint;
-import javax.xml.ws.EndpointReference;
-import javax.xml.ws.WebServicePermission;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-import java.util.concurrent.Executor;
-
/**
* A Web service endpoint implementation.
*
@@ -62,11 +68,12 @@
private Object implementor;
private Executor executor;
private List<Source> metadata;
- private BindingProvider bindingProvider;
+ private BindingProviderImpl bindingProvider;
private Map<String, Object> properties = new HashMap<String, Object>();
private HttpContext serverContext;
private boolean isPublished;
private boolean isDestroyed;
+ private URI address;
public EndpointImpl(String bindingId, Object implementor)
{
@@ -99,18 +106,17 @@
* @param address specifying the address to use. The address must be compatible with the binding specified at the time the endpoint was created.
*/
@Override
- public void publish(String address)
+ public void publish(String addr)
{
- log.debug("publish: " + address);
+ log.debug("publish: " + addr);
- URI addrURI;
try
{
- addrURI = new URI(address);
+ this.address = new URI(addr);
}
catch (URISyntaxException e)
{
- throw new IllegalArgumentException("Invalid address: " + address);
+ throw new IllegalArgumentException("Invalid address: " + addr);
}
// Check with the security manger
@@ -122,7 +128,7 @@
httpServer.setProperties(properties);
httpServer.start();
- String path = addrURI.getPath();
+ String path = address.getPath();
String contextRoot = "/" + new StringTokenizer(path, "/").nextToken();
HttpContext context = httpServer.createContext(contextRoot);
@@ -168,11 +174,30 @@
if (context instanceof HttpContext)
{
serverContext = (HttpContext)context;
+ address = getAddressFromConfigAndContext(serverContext);
HttpServer httpServer = serverContext.getHttpServer();
httpServer.publish(serverContext, this);
isPublished = true;
}
}
+
+ private static URI getAddressFromConfigAndContext(HttpContext context)
+ {
+ try
+ {
+ SPIProvider provider = SPIProviderResolver.getInstance().getProvider();
+ ServerConfigFactory spi = provider.getSPI(ServerConfigFactory.class);
+ ServerConfig serverConfig = spi.getServerConfig();
+ String host = serverConfig.getWebServiceHost();
+ int port = serverConfig.getWebServicePort();
+ String hostAndPort = host + (port > 0 ? ":" + port : "");
+ return new URI("http://" + hostAndPort + context.getContextRoot());
+ }
+ catch (URISyntaxException e)
+ {
+ throw new WebServiceException("Error while getting endpoint address from context!", e);
+ }
+ }
@Override
public void stop()
@@ -261,12 +286,27 @@
@Override
public EndpointReference getEndpointReference(Element... referenceParameters)
{
- throw new NotImplementedException();
+ return getEndpointReference(W3CEndpointReference.class, referenceParameters);
}
@Override
public <T extends EndpointReference> T getEndpointReference(Class<T> clazz, Element... referenceParameters)
{
- throw new NotImplementedException();
+ if (isDestroyed || !isPublished)
+ throw new WebServiceException("Cannot get EPR for an unpubblished or already destroyed endpoint!");
+ if (getBinding() instanceof HTTPBinding )
+ {
+ throw new UnsupportedOperationException("Cannot get epr when using the XML/HTTP binding");
+ }
+ W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
+ builder.address(address.toString());
+ builder.wsdlDocumentLocation(address.toString() + "?wsdl");
+ //TODO set other parameters in the builder
+ if (referenceParameters != null && W3CEndpointReference.class.getName().equals(clazz.getName()))
+ {
+ for (Element el : referenceParameters)
+ builder.referenceParameter(el);
+ }
+ return EndpointReferenceUtil.transform(clazz, builder.build());
}
}
Modified: stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java
===================================================================
--- stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java 2009-01-13 17:31:35 UTC (rev 9024)
+++ stack/native/branches/jaxws21/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java 2009-01-13 18:25:02 UTC (rev 9025)
@@ -32,14 +32,20 @@
import javax.servlet.http.HttpServletResponse;
import javax.xml.namespace.QName;
import javax.xml.ws.Endpoint;
+import javax.xml.ws.EndpointReference;
import javax.xml.ws.Service;
import javax.xml.ws.soap.SOAPBinding;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import org.jboss.logging.Logger;
+import org.jboss.wsf.common.DOMUtils;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.http.HttpContext;
import org.jboss.wsf.spi.http.HttpServer;
import org.jboss.wsf.spi.http.HttpServerFactory;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
/**
* Test Endpoint deployment
@@ -50,6 +56,7 @@
public class EndpointServlet extends HttpServlet
{
private Endpoint endpoint;
+ private static final String TEST_ELEMENT = "<fabrikam:CustomerKey xmlns:fabrikam='http://example.com/fabrikam'>123456789</fabrikam:CustomerKey>";
@Override
public void init(ServletConfig config) throws ServletException
@@ -90,9 +97,32 @@
// Invoke the endpoint
String param = req.getParameter("param");
String retStr = port.echo(param);
+
+ //Test epr
+ assertEndpointReference(endpoint.getEndpointReference(DOMUtils.parse(TEST_ELEMENT)), TEST_ELEMENT);
+ assertEndpointReference(endpoint.getEndpointReference(W3CEndpointReference.class, (Element[])null), null);
// Return the result
PrintWriter pw = new PrintWriter(res.getWriter());
pw.print(retStr);
}
+
+
+
+ private void assertEndpointReference(EndpointReference epr, String refPar) throws IOException
+ {
+ Logger.getLogger(this.getClass()).info("epr: "+epr);
+ assert(W3CEndpointReference.class.getName().equals(epr.getClass().getName()));
+ Element endpointReference = DOMUtils.parse(epr.toString());
+ assert("EndpointReference".equals(endpointReference.getNodeName()));
+ assert("http://www.w3.org/2005/08/addressing".equals(endpointReference.getAttribute("xmlns")));
+ NodeList addresses = endpointReference.getElementsByTagName("Address");
+ assert(addresses.getLength() == 1);
+ assert("http://127.0.0.1:8080/jaxws-endpoint".equals(addresses.item(0).getFirstChild().getNodeValue()));
+ if (refPar != null)
+ {
+ //TODO enhance this check
+ assert(epr.toString().contains(refPar));
+ }
+ }
}
15 years, 11 months