JBossWS SVN: r1986 - branches/hbraun.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-01-16 10:17:51 -0500 (Tue, 16 Jan 2007)
New Revision: 1986
Added:
branches/hbraun/trunk/
Log:
create user branch
Copied: branches/hbraun/trunk (from rev 1985, trunk)
18 years
JBossWS SVN: r1985 - branches/hbraun.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-01-16 10:16:56 -0500 (Tue, 16 Jan 2007)
New Revision: 1985
Removed:
branches/hbraun/jbossws-1.0/
Log:
delete user branch
18 years
JBossWS SVN: r1984 - branches/hbraun.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-01-16 10:16:19 -0500 (Tue, 16 Jan 2007)
New Revision: 1984
Removed:
branches/hbraun/trunk/
Log:
delete user branch
18 years
JBossWS SVN: r1983 - in trunk: jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws and 8 other directories.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-01-16 09:29:43 -0500 (Tue, 16 Jan 2007)
New Revision: 1983
Added:
trunk/jbossws-core/src/main/java/org/jboss/ws/annotation/EndpointConfig.java
trunk/jbossws-core/src/main/java/org/jboss/ws/annotation/WebContext.java
Removed:
trunk/jbossws-core/src/main/java/org/jboss/ws/annotation/PortComponent.java
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/context/EndpointEJB.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/eardeployment/EJB3Bean.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jbws981/EJB3Bean.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jbws981/EndpointInterface.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jsr181/webservice/EJB21Bean01.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jsr181/webservice/EJB21Bean02.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jsr181/webservice/EJB3Bean01.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jsr181/webservice/EJB3Bean02.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jsr181/webservice/EndpointInterface03.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/jsr181ejb/EJB3Bean01.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/wsaddressing/StatefulEndpoint.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/wsaddressing/StatefulEndpointImpl.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/wsaddressing/action/ActionRpcEndpointImpl.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/InitialEndpointImpl.java
Log:
Fix JBWS-1429
Added: trunk/jbossws-core/src/main/java/org/jboss/ws/annotation/EndpointConfig.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/annotation/EndpointConfig.java 2007-01-16 13:11:09 UTC (rev 1982)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/annotation/EndpointConfig.java 2007-01-16 14:29:43 UTC (rev 1983)
@@ -0,0 +1,34 @@
+package org.jboss.ws.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * @author Heiko.Braun(a)jboss.org
+ * @version $Id$
+ * @since 16.01.2007
+ */
+@Retention(value = RetentionPolicy.RUNTIME)
+@Target(value = { ElementType.TYPE })
+public @interface EndpointConfig {
+
+ /**
+ * The optional config-name element gives the client configuration name that must be present in
+ * the configuration given by element config-file.
+ *
+ * Server side default: Standard Endpoint
+ * Client side default: Standard Client
+ */
+ String configName() default "";
+
+ /**
+ * The optional config-file element gives the to a URL or resource name for the configuration.
+ *
+ * Server side default: standard-jaxrpc-endpoint-config.xml, standard-jaxws-endpoint-config.xml
+ * Client side default: standard-jaxrpc-client-config.xml, standard-jaxws-client-config.xml
+ */
+ String configFile() default "";
+
+}
Deleted: trunk/jbossws-core/src/main/java/org/jboss/ws/annotation/PortComponent.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/annotation/PortComponent.java 2007-01-16 13:11:09 UTC (rev 1982)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/annotation/PortComponent.java 2007-01-16 14:29:43 UTC (rev 1983)
@@ -1,112 +0,0 @@
-/*
-* 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.ws.annotation;
-
-// $Id$
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Provides web context specific meta data to EJB based web service endpoints.
- *
- * @author thomas.diesler(a)jboss.org
- * @since 26-Apr-2005
- */
-@Retention(value = RetentionPolicy.RUNTIME)
-@Target(value = { ElementType.TYPE })
-public @interface PortComponent {
-
- /**
- * The contextRoot element specifies the context root that the web service endpoint is deployed to.
- * If it is not specified it will be derived from the deployment short name.
- *
- * Applies to server side port components only.
- */
- String contextRoot() default "";
-
- /**
- * The virtual hosts that the web service endpoint is deployed to.
- *
- * Applies to server side port components only.
- */
- String[] virtualHosts() default {};
-
- /**
- * Relative path that is appended to the contextRoot to form fully qualified
- * endpoint address for the web service endpoint.
- *
- * Applies to server side port components only.
- */
- String urlPattern() default "";
-
- /**
- * The authMethod is used to configure the authentication mechanism for the web service.
- * As a prerequisite to gaining access to any web service which are protected by an authorization
- * constraint, a user must have authenticated using the configured mechanism.
- *
- * Legal values for this element are "BASIC", or "CLIENT-CERT".
- */
- String authMethod() default "";
-
- /**
- * The transportGuarantee specifies that the communication
- * between client and server should be NONE, INTEGRAL, or
- * CONFIDENTIAL. NONE means that the application does not require any
- * transport guarantees. A value of INTEGRAL means that the application
- * requires that the data sent between the client and server be sent in
- * such a way that it can't be changed in transit. CONFIDENTIAL means
- * that the application requires that the data be transmitted in a
- * fashion that prevents other entities from observing the contents of
- * the transmission. In most cases, the presence of the INTEGRAL or
- * CONFIDENTIAL flag will indicate that the use of SSL is required.
- */
- String transportGuarantee() default "";
-
- /**
- * A secure endpoint does not by default publish it's wsdl on an unsecure transport.
- * You can override this behaviour by explicitly setting the secureWSDLAccess flag to false.
- *
- * Protect access to WSDL
- * http://jira.jboss.org/jira/browse/JBWS-723
- */
- boolean secureWSDLAccess() default true;
-
- /**
- * The optional config-name element gives the client configuration name that must be present in
- * the configuration given by element config-file.
- *
- * Server side default: Standard Endpoint
- * Client side default: Standard Client
- */
- String configName() default "";
-
- /**
- * The optional config-file element gives the to a URL or resource name for the configuration.
- *
- * Server side default: standard-jaxrpc-endpoint-config.xml, standard-jaxws-endpoint-config.xml
- * Client side default: standard-jaxrpc-client-config.xml, standard-jaxws-client-config.xml
- */
- String configFile() default "";
-}
Copied: trunk/jbossws-core/src/main/java/org/jboss/ws/annotation/WebContext.java (from rev 1979, trunk/jbossws-core/src/main/java/org/jboss/ws/annotation/PortComponent.java)
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/annotation/PortComponent.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/annotation/WebContext.java 2007-01-16 14:29:43 UTC (rev 1983)
@@ -0,0 +1,96 @@
+/*
+* 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.ws.annotation;
+
+// $Id$
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Provides web context specific meta data to EJB based web service endpoints.
+ *
+ * @author thomas.diesler(a)jboss.org
+ * @since 26-Apr-2005
+ */
+@Retention(value = RetentionPolicy.RUNTIME)
+@Target(value = { ElementType.TYPE })
+public @interface WebContext {
+
+ /**
+ * The contextRoot element specifies the context root that the web service endpoint is deployed to.
+ * If it is not specified it will be derived from the deployment short name.
+ *
+ * Applies to server side port components only.
+ */
+ String contextRoot() default "";
+
+ /**
+ * The virtual hosts that the web service endpoint is deployed to.
+ *
+ * Applies to server side port components only.
+ */
+ String[] virtualHosts() default {};
+
+ /**
+ * Relative path that is appended to the contextRoot to form fully qualified
+ * endpoint address for the web service endpoint.
+ *
+ * Applies to server side port components only.
+ */
+ String urlPattern() default "";
+
+ /**
+ * The authMethod is used to configure the authentication mechanism for the web service.
+ * As a prerequisite to gaining access to any web service which are protected by an authorization
+ * constraint, a user must have authenticated using the configured mechanism.
+ *
+ * Legal values for this element are "BASIC", or "CLIENT-CERT".
+ */
+ String authMethod() default "";
+
+ /**
+ * The transportGuarantee specifies that the communication
+ * between client and server should be NONE, INTEGRAL, or
+ * CONFIDENTIAL. NONE means that the application does not require any
+ * transport guarantees. A value of INTEGRAL means that the application
+ * requires that the data sent between the client and server be sent in
+ * such a way that it can't be changed in transit. CONFIDENTIAL means
+ * that the application requires that the data be transmitted in a
+ * fashion that prevents other entities from observing the contents of
+ * the transmission. In most cases, the presence of the INTEGRAL or
+ * CONFIDENTIAL flag will indicate that the use of SSL is required.
+ */
+ String transportGuarantee() default "";
+
+ /**
+ * A secure endpoint does not by default publish it's wsdl on an unsecure transport.
+ * You can override this behaviour by explicitly setting the secureWSDLAccess flag to false.
+ *
+ * Protect access to WSDL
+ * http://jira.jboss.org/jira/browse/JBWS-723
+ */
+ boolean secureWSDLAccess() default true;
+
+}
Property changes on: trunk/jbossws-core/src/main/java/org/jboss/ws/annotation/WebContext.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java 2007-01-16 13:11:09 UTC (rev 1982)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java 2007-01-16 14:29:43 UTC (rev 1983)
@@ -126,8 +126,11 @@
serviceMetaData.setWsdlLocation(wsdlURL);
}
+ // process config
+ processEndpointConfig(udi, sepClass, linkName, sepMetaData);
+
// Set the endpoint address
- processPortComponent(udi, sepClass, linkName, sepMetaData);
+ processWebContext(udi, sepClass, linkName, sepMetaData);
// Init the endpoint address
MetaDataBuilder.initEndpointAddress(udi, sepMetaData, linkName);
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2007-01-16 13:11:09 UTC (rev 1982)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2007-01-16 14:29:43 UTC (rev 1983)
@@ -23,15 +23,16 @@
// $Id$
-import javax.jws.WebService;
-import javax.xml.ws.WebServiceProvider;
-
-import org.jboss.ws.annotation.PortComponent;
+import org.jboss.ws.annotation.EndpointConfig;
+import org.jboss.ws.annotation.WebContext;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+import javax.jws.WebService;
+import javax.xml.ws.WebServiceProvider;
+
/**
* Builds ServiceEndpointMetaData for a JAX-WS endpoint.
*
@@ -54,37 +55,46 @@
}
}
- protected void processPortComponent(UnifiedDeploymentInfo udi, Class<?> wsClass, String linkName, ServerEndpointMetaData sepMetaData)
+ protected void processEndpointConfig(UnifiedDeploymentInfo udi, Class<?> wsClass, String linkName, ServerEndpointMetaData sepMetaData)
{
- PortComponent anPortComponent = wsClass.getAnnotation(PortComponent.class);
- if (anPortComponent == null)
+ EndpointConfig anEndpointConfig = wsClass.getAnnotation(EndpointConfig.class);
+
+ if (anEndpointConfig== null)
return;
// setup config name
- if (anPortComponent.configName().length() > 0)
+ if (anEndpointConfig.configName().length() > 0)
{
- String configName = anPortComponent.configName();
+ String configName = anEndpointConfig.configName();
sepMetaData.setConfigName(configName);
}
// setup config file
- if (anPortComponent.configFile().length() > 0)
+ if (anEndpointConfig.configFile().length() > 0)
{
- String configFile = anPortComponent.configFile();
+ String configFile = anEndpointConfig.configFile();
sepMetaData.setConfigFile(configFile);
}
+ }
+ protected void processWebContext(UnifiedDeploymentInfo udi, Class<?> wsClass, String linkName, ServerEndpointMetaData sepMetaData)
+ {
+ WebContext anWebContext = wsClass.getAnnotation(WebContext.class);
+
+ if (anWebContext == null)
+ return;
+
boolean isJSEEndpoint = (udi.type == DeploymentType.JAXWS_JSE);
// context-root
- if (anPortComponent.contextRoot().length() > 0)
+ if (anWebContext.contextRoot().length() > 0)
{
if (isJSEEndpoint)
- log.warn("@PortComponent.contextRoot is only valid on EJB endpoints");
+ log.warn("@WebContext.contextRoot is only valid on EJB endpoints");
if (isJSEEndpoint == false)
{
- String contextRoot = anPortComponent.contextRoot();
+ String contextRoot = anWebContext.contextRoot();
if (contextRoot.startsWith("/") == false)
contextRoot = "/" + contextRoot;
@@ -93,49 +103,49 @@
}
// url-pattern
- if (anPortComponent.urlPattern().length() > 0)
+ if (anWebContext.urlPattern().length() > 0)
{
if (isJSEEndpoint)
- log.warn("@PortComponent.urlPattern is only valid on EJB endpoints");
+ log.warn("@WebContext.urlPattern is only valid on EJB endpoints");
if (isJSEEndpoint == false)
{
- String urlPattern = anPortComponent.urlPattern();
+ String urlPattern = anWebContext.urlPattern();
sepMetaData.setURLPattern(urlPattern);
}
}
// auth-method
- if (anPortComponent.authMethod().length() > 0)
+ if (anWebContext.authMethod().length() > 0)
{
if (isJSEEndpoint)
- log.warn("@PortComponent.authMethod is only valid on EJB endpoints");
+ log.warn("@WebContext.authMethod is only valid on EJB endpoints");
if (isJSEEndpoint == false)
{
- String authMethod = anPortComponent.authMethod();
+ String authMethod = anWebContext.authMethod();
sepMetaData.setAuthMethod(authMethod);
}
}
// transport-guarantee
- if (anPortComponent.transportGuarantee().length() > 0)
+ if (anWebContext.transportGuarantee().length() > 0)
{
if (isJSEEndpoint)
- log.warn("@PortComponent.transportGuarantee is only valid on EJB endpoints");
+ log.warn("@WebContext.transportGuarantee is only valid on EJB endpoints");
if (isJSEEndpoint == false)
{
- String transportGuarantee = anPortComponent.transportGuarantee();
+ String transportGuarantee = anWebContext.transportGuarantee();
sepMetaData.setTransportGuarantee(transportGuarantee);
}
}
// secure wsdl access
- sepMetaData.setSecureWSDLAccess(anPortComponent.secureWSDLAccess());
+ sepMetaData.setSecureWSDLAccess(anWebContext.secureWSDLAccess());
// virtual hosts
- String[] virtualHosts = anPortComponent.virtualHosts();
+ String[] virtualHosts = anWebContext.virtualHosts();
if (virtualHosts != null & virtualHosts.length > 0)
{
sepMetaData.setVirtualHosts(virtualHosts);
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-01-16 13:11:09 UTC (rev 1982)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-01-16 14:29:43 UTC (rev 1983)
@@ -110,10 +110,12 @@
// Process or generate WSDL
processOrGenerateWSDL(seiClass, serviceMetaData, result.wsdlLocation, sepMetaData);
- // process config name and config file amongst others
- // Note, that @PortComponent needs to be defined on the endpoint not the SEI
- processPortComponent(udi, sepClass, linkName, sepMetaData);
+ // process config
+ processEndpointConfig(udi, sepClass, linkName, sepMetaData);
+ // Note, that @WebContext needs to be defined on the endpoint not the SEI
+ processWebContext(udi, sepClass, linkName, sepMetaData);
+
// setup handler chain from config
sepMetaData.configure(sepMetaData);
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/context/EndpointEJB.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/context/EndpointEJB.java 2007-01-16 13:11:09 UTC (rev 1982)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/context/EndpointEJB.java 2007-01-16 14:29:43 UTC (rev 1983)
@@ -33,10 +33,10 @@
import javax.xml.ws.WebServiceContext;
import javax.xml.ws.WebServiceException;
-import org.jboss.ws.annotation.PortComponent;
+import org.jboss.ws.annotation.WebContext;
@WebService(endpointInterface = "org.jboss.test.ws.jaxws.context.EndpointInterface", serviceName = "TestService", targetNamespace = "http://org.jboss.ws/jaxws/context")
-@PortComponent(contextRoot = "/jaxws-context", urlPattern = "/*")
+@WebContext(contextRoot = "/jaxws-context", urlPattern = "/*")
@Stateless
public class EndpointEJB
{
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/eardeployment/EJB3Bean.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/eardeployment/EJB3Bean.java 2007-01-16 13:11:09 UTC (rev 1982)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/eardeployment/EJB3Bean.java 2007-01-16 14:29:43 UTC (rev 1983)
@@ -27,12 +27,12 @@
import javax.jws.soap.SOAPBinding;
import org.jboss.logging.Logger;
-import org.jboss.ws.annotation.PortComponent;
+import org.jboss.ws.annotation.WebContext;
// Test that the wsdl can be read from the nested deployment
@WebService(name="TestEndpoint", wsdlLocation="META-INF/wsdl/TestEndpoint.wsdl")
@SOAPBinding(style = SOAPBinding.Style.RPC)
-@PortComponent(contextRoot="/earejb3")
+@WebContext(contextRoot="/earejb3")
@Stateless
public class EJB3Bean
{
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jbws981/EJB3Bean.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jbws981/EJB3Bean.java 2007-01-16 13:11:09 UTC (rev 1982)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jbws981/EJB3Bean.java 2007-01-16 14:29:43 UTC (rev 1983)
@@ -52,7 +52,7 @@
catch (Exception e)
{
log.error(e);
- return "Unable to get WebModule MBean for virtual host - virtual-host not handled from @PortComponent";
+ return "Unable to get WebModule MBean for virtual host - virtual-host not handled from @WebContext";
}
return message;
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jbws981/EndpointInterface.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jbws981/EndpointInterface.java 2007-01-16 13:11:09 UTC (rev 1982)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jbws981/EndpointInterface.java 2007-01-16 14:29:43 UTC (rev 1983)
@@ -12,11 +12,11 @@
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
-import org.jboss.ws.annotation.PortComponent;
+import org.jboss.ws.annotation.WebContext;
@WebService(targetNamespace = "http://www.jboss.org/test/ws/jaxws/jbws981")
@SOAPBinding(style = SOAPBinding.Style.RPC)
-@PortComponent(virtualHosts = { "localhost", "www.jboss.org" })
+@WebContext(virtualHosts = { "localhost", "www.jboss.org" })
public interface EndpointInterface
{
String hello(String msg);
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jsr181/webservice/EJB21Bean01.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jsr181/webservice/EJB21Bean01.java 2007-01-16 13:11:09 UTC (rev 1982)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jsr181/webservice/EJB21Bean01.java 2007-01-16 14:29:43 UTC (rev 1983)
@@ -21,7 +21,7 @@
*/
package org.jboss.test.ws.jaxws.jsr181.webservice;
-import org.jboss.ws.annotation.PortComponent;
+import org.jboss.ws.annotation.WebContext;
import javax.ejb.EJBException;
import javax.ejb.SessionBean;
@@ -39,7 +39,7 @@
*/
@WebService(name = "EndpointInterface", targetNamespace = "http://www.openuri.org/2004/04/HelloWorld", serviceName = "TestService")
@SOAPBinding(style = SOAPBinding.Style.RPC)
-@PortComponent(contextRoot="/jsr181", urlPattern="/*")
+@WebContext(contextRoot="/jsr181", urlPattern="/*")
public class EJB21Bean01 implements SessionBean
{
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jsr181/webservice/EJB21Bean02.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jsr181/webservice/EJB21Bean02.java 2007-01-16 13:11:09 UTC (rev 1982)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jsr181/webservice/EJB21Bean02.java 2007-01-16 14:29:43 UTC (rev 1983)
@@ -21,7 +21,7 @@
*/
package org.jboss.test.ws.jaxws.jsr181.webservice;
-import org.jboss.ws.annotation.PortComponent;
+import org.jboss.ws.annotation.WebContext;
import javax.ejb.EJBException;
import javax.ejb.SessionBean;
@@ -41,7 +41,7 @@
*/
@WebService(name = "EndpointInterface", targetNamespace = "http://www.openuri.org/2004/04/HelloWorld", serviceName = "TestService", wsdlLocation = "META-INF/wsdl/TestService.wsdl")
@SOAPBinding(style = SOAPBinding.Style.RPC)
-@PortComponent(contextRoot="/jsr181", urlPattern="/*")
+@WebContext(contextRoot="/jsr181", urlPattern="/*")
public class EJB21Bean02 implements SessionBean
{
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jsr181/webservice/EJB3Bean01.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jsr181/webservice/EJB3Bean01.java 2007-01-16 13:11:09 UTC (rev 1982)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jsr181/webservice/EJB3Bean01.java 2007-01-16 14:29:43 UTC (rev 1983)
@@ -22,7 +22,7 @@
package org.jboss.test.ws.jaxws.jsr181.webservice;
import org.jboss.annotation.ejb.RemoteBinding;
-import org.jboss.ws.annotation.PortComponent;
+import org.jboss.ws.annotation.WebContext;
import javax.jws.WebMethod;
import javax.jws.WebService;
@@ -37,7 +37,7 @@
* @since 29-Apr-2005
*/
@WebService(name = "EndpointInterface", targetNamespace = "http://www.openuri.org/2004/04/HelloWorld", serviceName = "TestService")
-@PortComponent(contextRoot="/jsr181", urlPattern="/*")
+@WebContext(contextRoot="/jsr181", urlPattern="/*")
@SOAPBinding(style = SOAPBinding.Style.RPC)
@Remote(EJB3RemoteInterface.class)
@RemoteBinding(jndiBinding = "/ejb3/EJB3EndpointInterface")
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jsr181/webservice/EJB3Bean02.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jsr181/webservice/EJB3Bean02.java 2007-01-16 13:11:09 UTC (rev 1982)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jsr181/webservice/EJB3Bean02.java 2007-01-16 14:29:43 UTC (rev 1983)
@@ -22,7 +22,7 @@
package org.jboss.test.ws.jaxws.jsr181.webservice;
import org.jboss.annotation.ejb.RemoteBinding;
-import org.jboss.ws.annotation.PortComponent;
+import org.jboss.ws.annotation.WebContext;
import javax.jws.WebMethod;
import javax.jws.WebService;
@@ -41,7 +41,7 @@
* @since 29-Apr-2005
*/
@WebService(name = "EndpointInterface", targetNamespace = "http://www.openuri.org/2004/04/HelloWorld", serviceName = "TestService", wsdlLocation = "META-INF/wsdl/TestService.wsdl")
-@PortComponent(contextRoot="/jsr181", urlPattern="/*")
+@WebContext(contextRoot="/jsr181", urlPattern="/*")
@SOAPBinding(style = SOAPBinding.Style.RPC)
@Remote(EJB3RemoteInterface.class)
@RemoteBinding(jndiBinding = "/ejb3/EJB3EndpointInterface")
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jsr181/webservice/EndpointInterface03.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jsr181/webservice/EndpointInterface03.java 2007-01-16 13:11:09 UTC (rev 1982)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/jsr181/webservice/EndpointInterface03.java 2007-01-16 14:29:43 UTC (rev 1983)
@@ -27,7 +27,7 @@
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
-import org.jboss.ws.annotation.PortComponent;
+import org.jboss.ws.annotation.WebContext;
/**
* Test the JSR-181 javax.jws.WebService annotation on an SEI
@@ -36,7 +36,7 @@
* @since 29-Apr-2005
*/
@WebService(targetNamespace = "http://foo")
-@PortComponent(contextRoot="/jsr181", urlPattern="/*")
+@WebContext(contextRoot="/jsr181", urlPattern="/*")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public interface EndpointInterface03 extends Remote
{
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/jsr181ejb/EJB3Bean01.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/jsr181ejb/EJB3Bean01.java 2007-01-16 13:11:09 UTC (rev 1982)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/jsr181ejb/EJB3Bean01.java 2007-01-16 14:29:43 UTC (rev 1983)
@@ -32,7 +32,8 @@
import org.jboss.annotation.ejb.RemoteBinding;
import org.jboss.annotation.security.SecurityDomain;
-import org.jboss.ws.annotation.PortComponent;
+import org.jboss.ws.annotation.WebContext;
+import org.jboss.ws.annotation.EndpointConfig;
/**
* Test the JSR-181 annotation: javax.jws.WebService
@@ -52,7 +53,8 @@
// jboss propriatary annotations
@RemoteBinding(jndiBinding = "/ejb3/EJB3Bean01")
-@PortComponent(authMethod="BASIC", transportGuarantee="NONE", secureWSDLAccess=false, configName="Standard WSSecurity Endpoint")
+@WebContext(authMethod="BASIC", transportGuarantee="NONE", secureWSDLAccess=false)
+@EndpointConfig(configName="Standard WSSecurity Endpoint")
@SecurityDomain("JBossWS")
public class EJB3Bean01 implements EJB3RemoteInterface
{
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/wsaddressing/StatefulEndpoint.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/wsaddressing/StatefulEndpoint.java 2007-01-16 13:11:09 UTC (rev 1982)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/wsaddressing/StatefulEndpoint.java 2007-01-16 14:29:43 UTC (rev 1983)
@@ -26,14 +26,12 @@
import java.rmi.Remote;
import java.rmi.RemoteException;
-import javax.jws.HandlerChain;
import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
-import org.jboss.ws.annotation.PortComponent;
+import org.jboss.ws.annotation.WebContext;
+import org.jboss.ws.annotation.EndpointConfig;
/**
* WS-Addressing stateful service endpoint interface
@@ -44,7 +42,7 @@
*/
@WebService(name = "StatefulEndpoint", targetNamespace = "http://org.jboss.ws/samples/wsaddressing", serviceName = "TestService")
@SOAPBinding(style = SOAPBinding.Style.RPC)
-@PortComponent(configName = "Standard WSAddressing Endpoint")
+@EndpointConfig(configName = "Standard WSAddressing Endpoint")
public interface StatefulEndpoint extends Remote
{
@WebMethod
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/wsaddressing/StatefulEndpointImpl.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/wsaddressing/StatefulEndpointImpl.java 2007-01-16 13:11:09 UTC (rev 1982)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/samples/wsaddressing/StatefulEndpointImpl.java 2007-01-16 14:29:43 UTC (rev 1983)
@@ -23,10 +23,8 @@
//$Id$
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import org.jboss.logging.Logger;
+import org.jboss.ws.annotation.EndpointConfig;
import javax.annotation.Resource;
import javax.jws.HandlerChain;
@@ -36,10 +34,11 @@
import javax.xml.namespace.QName;
import javax.xml.ws.WebServiceContext;
import javax.xml.ws.handler.MessageContext;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
-import org.jboss.logging.Logger;
-import org.jboss.ws.annotation.PortComponent;
-
/**
* WS-Addressing stateful service endpoint
*
@@ -47,7 +46,7 @@
* @since 24-Nov-2005
*/
@WebService(name = "StatefulEndpoint", targetNamespace = "http://org.jboss.ws/samples/wsaddressing", serviceName = "TestService")
-@PortComponent(configName = "Standard WSAddressing Endpoint")
+@EndpointConfig(configName = "Standard WSAddressing Endpoint")
@HandlerChain(file = "WEB-INF/jaxws-handlers.xml")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class StatefulEndpointImpl implements StatefulEndpoint
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/wsaddressing/action/ActionRpcEndpointImpl.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/wsaddressing/action/ActionRpcEndpointImpl.java 2007-01-16 13:11:09 UTC (rev 1982)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/wsaddressing/action/ActionRpcEndpointImpl.java 2007-01-16 14:29:43 UTC (rev 1983)
@@ -30,7 +30,8 @@
import javax.jws.soap.SOAPBinding;
import org.jboss.logging.Logger;
-import org.jboss.ws.annotation.PortComponent;
+import org.jboss.ws.annotation.WebContext;
+import org.jboss.ws.annotation.EndpointConfig;
/**
* WS-Addressing service endpoint
@@ -41,7 +42,7 @@
*/
@SOAPBinding(style = SOAPBinding.Style.RPC)
@WebService(name = "ActionEndpoint", targetNamespace = "http://org.jboss.ws/addressing/action", wsdlLocation = "WEB-INF/wsdl/ActionRpcService.wsdl")
-@PortComponent(configName = "Standard WSAddressing Endpoint")
+@EndpointConfig(configName = "Standard WSAddressing Endpoint")
public class ActionRpcEndpointImpl implements ActionEndpoint
{
// provide logging
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/InitialEndpointImpl.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/InitialEndpointImpl.java 2007-01-16 13:11:09 UTC (rev 1982)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/wsaddressing/replyto/InitialEndpointImpl.java 2007-01-16 14:29:43 UTC (rev 1983)
@@ -30,7 +30,8 @@
import javax.jws.soap.SOAPBinding;
import org.jboss.logging.Logger;
-import org.jboss.ws.annotation.PortComponent;
+import org.jboss.ws.annotation.WebContext;
+import org.jboss.ws.annotation.EndpointConfig;
/**
* WS-Addressing service endpoint
@@ -41,7 +42,7 @@
*/
@SOAPBinding(style = SOAPBinding.Style.RPC)
@WebService(name = "InitialEndpoint", targetNamespace = "http://org.jboss.ws/addressing/replyto")
-@PortComponent(configName = "Standard WSAddressing Endpoint")
+@EndpointConfig(configName = "Standard WSAddressing Endpoint")
public class InitialEndpointImpl implements InitialEndpoint
{
// provide logging
18 years
JBossWS SVN: r1982 - trunk/jbossws-core/src/main/java/javax/xml/soap.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-01-16 08:11:09 -0500 (Tue, 16 Jan 2007)
New Revision: 1982
Modified:
trunk/jbossws-core/src/main/java/javax/xml/soap/FactoryLoader.java
Log:
Change logger
Modified: trunk/jbossws-core/src/main/java/javax/xml/soap/FactoryLoader.java
===================================================================
--- trunk/jbossws-core/src/main/java/javax/xml/soap/FactoryLoader.java 2007-01-16 12:47:11 UTC (rev 1981)
+++ trunk/jbossws-core/src/main/java/javax/xml/soap/FactoryLoader.java 2007-01-16 13:11:09 UTC (rev 1982)
@@ -44,7 +44,7 @@
public class FactoryLoader
{
// provide logging
- private static Logger log = Logger.getLogger(MessageFactory.class);
+ private static Logger log = Logger.getLogger(FactoryLoader.class);
private FactoryLoader()
{
18 years
JBossWS SVN: r1981 - trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-01-16 07:47:11 -0500 (Tue, 16 Jan 2007)
New Revision: 1981
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
Log:
JBCTS-443: Fix jaxws/api/javax_xml_ws/Service
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2007-01-16 12:18:26 UTC (rev 1980)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2007-01-16 12:47:11 UTC (rev 1981)
@@ -153,10 +153,10 @@
// TODO: default name mapping when annotations not used
QName portTypeName = new QName(ns, name);
- for(EndpointMetaData epmd : serviceMetaData.getEndpoints())
+ for (EndpointMetaData epmd : serviceMetaData.getEndpoints())
{
QName interfaceQName = epmd.getPortTypeName(); // skip namespaces here
- if( interfaceQName.getLocalPart().equals( portTypeName.getLocalPart() ) )
+ if (interfaceQName.getLocalPart().equals(portTypeName.getLocalPart()))
{
epmd.setServiceEndpointInterfaceName(seiClass.getName());
epMetaData = epmd;
@@ -185,12 +185,13 @@
return (T)createProxy(seiClass, epMetaData);
}
- private void assertSEIConstraints(Class seiClass) {
+ private void assertSEIConstraints(Class seiClass)
+ {
if (seiClass == null)
throw new IllegalArgumentException("Service endpoint interface cannot be null");
- if(!seiClass.isAnnotationPresent(WebService.class))
+ if (!seiClass.isAnnotationPresent(WebService.class))
throw new WebServiceException("SEI is missing @WebService annotation: " + seiClass);
}
@@ -202,10 +203,14 @@
*/
public void addPort(QName portName, String bindingId, String epAddress)
{
- EndpointMetaData epMetaData = new ClientEndpointMetaData(serviceMetaData, portName, null, Type.JAXWS);
+ EndpointMetaData epMetaData = serviceMetaData.getEndpoint(portName);
+ if (epMetaData == null)
+ {
+ epMetaData = new ClientEndpointMetaData(serviceMetaData, portName, null, Type.JAXWS);
+ serviceMetaData.addEndpoint(epMetaData);
+ }
epMetaData.setBindingId(bindingId);
epMetaData.setEndpointAddress(epAddress);
- serviceMetaData.addEndpoint(epMetaData);
}
@Override
@@ -231,7 +236,7 @@
EndpointMetaData epMetaData = serviceMetaData.getEndpoint(portName);
if (epMetaData == null)
throw new WebServiceException("Cannot find port: " + portName);
-
+
return epMetaData;
}
18 years
JBossWS SVN: r1980 - in trunk: jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc and 14 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-01-16 07:18:26 -0500 (Tue, 16 Jan 2007)
New Revision: 1980
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonClient.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ParameterWrapping.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/handler/PortInfoImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/metadata/ReflectiveMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/provider/ProviderJAXBTestCase.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/provider/ProviderMessageTestCase.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/provider/ProviderPayloadTestCase.java
Log:
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonClient.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonClient.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonClient.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -249,7 +249,7 @@
setOutboundContextProperties();
// Call the request handlers
- QName portName = epMetaData.getQName();
+ QName portName = epMetaData.getPortName();
boolean handlerPass = callRequestHandlerChain(portName, HandlerType.PRE);
handlerPass = handlerPass && callRequestHandlerChain(portName, HandlerType.ENDPOINT);
handlerPass = handlerPass && callRequestHandlerChain(portName, HandlerType.POST);
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ParameterWrapping.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ParameterWrapping.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ParameterWrapping.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -281,7 +281,7 @@
String serviceName = serviceMetaData.getServiceName().getLocalPart();
String parameterName = pmd.getXmlName().getLocalPart();
- String endpointName = endpointMetaData.getQName().getLocalPart();
+ String endpointName = endpointMetaData.getPortName().getLocalPart();
String packageName = endpointMetaData.getServiceEndpointInterface().getPackage().getName();
String wrapperName = packageName + "._JBossWS_" + serviceName + "_" + endpointName + "_" + parameterName;
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ServiceImpl.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -295,7 +295,7 @@
{
for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
{
- list.add(epMetaData.getQName());
+ list.add(epMetaData.getPortName());
}
}
return list.iterator();
@@ -415,7 +415,7 @@
void setupHandlerChain(EndpointMetaData epMetaData)
{
- QName portName = epMetaData.getQName();
+ QName portName = epMetaData.getPortName();
Set<String> handlerRoles = new HashSet<String>();
ArrayList handlerInfos = new ArrayList();
for (HandlerMetaData handlerMetaData : epMetaData.getHandlerMetaData(HandlerType.ALL))
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -171,7 +171,7 @@
hConfig.put(HandlerType.class.getName(), jaxrpcMetaData.getHandlerType());
HandlerInfo info = new HandlerInfo(hClass, hConfig, headerArr);
- log.debug("Adding server side handler to service '" + sepMetaData.getQName() + "': " + info);
+ log.debug("Adding server side handler to service '" + sepMetaData.getPortName() + "': " + info);
hInfos.add(info);
}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -40,6 +40,7 @@
import javax.xml.soap.SOAPMessage;
import javax.xml.transform.Source;
import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import javax.xml.ws.AsyncHandler;
@@ -283,8 +284,7 @@
{
SOAPBodyImpl soapBody = (SOAPBodyImpl)resMsg.getSOAPBody();
SOAPElement soapElement = (SOAPElement)soapBody.getChildElements().next();
- String xmlPayload = DOMWriter.printNode(soapElement, false);
- retObj = new StreamSource(new StringReader(xmlPayload));
+ retObj = new DOMSource(soapElement);
}
if (mode == Mode.MESSAGE)
{
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerDelegateJAXWS.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -136,7 +136,7 @@
private PortInfo getPortInfo(EndpointMetaData epMetaData)
{
QName serviceName = epMetaData.getServiceMetaData().getServiceName();
- QName portName = epMetaData.getQName();
+ QName portName = epMetaData.getPortName();
String bindingId = epMetaData.getBindingId();
PortInfo info = new PortInfoImpl(serviceName, portName, bindingId);
return info;
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/handler/HandlerResolverImpl.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -238,7 +238,7 @@
ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
for (EndpointMetaData epmd : serviceMetaData.getEndpoints())
{
- QName qname = epmd.getQName();
+ QName qname = epmd.getPortName();
String nsURI = qname.getNamespaceURI();
String localPart = qname.getLocalPart();
if (nsURI.equals(namespaceURI) && localPart.startsWith(localPattern))
@@ -252,7 +252,7 @@
ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
for (EndpointMetaData epmd : serviceMetaData.getEndpoints())
{
- QName qname = epmd.getQName();
+ QName qname = epmd.getPortName();
if (ports.equals(qname))
{
infos.add(new PortInfoImpl(null, qname, null));
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/handler/PortInfoImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/handler/PortInfoImpl.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/handler/PortInfoImpl.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -46,7 +46,7 @@
public PortInfoImpl(EndpointMetaData epMetaData)
{
this.serviceName = epMetaData.getServiceMetaData().getServiceName();
- this.portName = epMetaData.getQName();
+ this.portName = epMetaData.getPortName();
this.bindingID = epMetaData.getBindingId();
}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -26,7 +26,6 @@
import java.lang.reflect.Proxy;
import java.net.URL;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.Executor;
@@ -47,7 +46,6 @@
import org.jboss.logging.Logger;
import org.jboss.util.NotImplementedException;
-import org.jboss.ws.Constants;
import org.jboss.ws.core.jaxws.StubExt;
import org.jboss.ws.core.jaxws.client.ClientImpl;
import org.jboss.ws.core.jaxws.client.ClientProxy;
@@ -57,6 +55,7 @@
import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
@@ -79,8 +78,6 @@
// The service meta data that is associated with this JAXWS Service
private ServiceMetaData serviceMetaData;
- // The ports known by this service
- private HashMap<QName, Port> ports = new HashMap<QName,Port>();
// The handler resolver
private HandlerResolver handlerResolver = new HandlerResolverImpl();
// The executor service
@@ -91,18 +88,17 @@
public ServiceDelegateImpl(URL wsdlURL, QName serviceName)
{
- JAXWSClientMetaDataBuilder builder = new JAXWSClientMetaDataBuilder();
-
- serviceMetaData = builder.buildMetaData(serviceName, wsdlURL);
-
- for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
+ if (wsdlURL != null)
{
- QName portName = epMetaData.getQName();
- String bindingId = epMetaData.getBindingId();
- String epAddress = epMetaData.getEndpointAddress();
- Port port = new Port (portName, bindingId, epAddress);
- ports.put(portName, port);
+ JAXWSClientMetaDataBuilder builder = new JAXWSClientMetaDataBuilder();
+ serviceMetaData = builder.buildMetaData(serviceName, wsdlURL);
}
+ else
+ {
+ UnifiedMetaData wsMetaData = new UnifiedMetaData();
+ serviceMetaData = new ServiceMetaData(wsMetaData, serviceName);
+ wsMetaData.addService(serviceMetaData);
+ }
}
/**
@@ -159,7 +155,7 @@
for(EndpointMetaData epmd : serviceMetaData.getEndpoints())
{
- QName interfaceQName = epmd.getInterfaceQName(); // skip namespaces here
+ QName interfaceQName = epmd.getPortTypeName(); // skip namespaces here
if( interfaceQName.getLocalPart().equals( portTypeName.getLocalPart() ) )
{
epmd.setServiceEndpointInterfaceName(seiClass.getName());
@@ -177,7 +173,7 @@
private <T> T getPortInternal(EndpointMetaData epMetaData, Class<T> seiClass)
{
- QName portName = epMetaData.getQName();
+ QName portName = epMetaData.getPortName();
// Adjust the endpoint meta data according to the annotations
if (annotatedPorts.contains(portName) == false)
@@ -204,11 +200,12 @@
* Ports created in this way contain no WSDL port type information
* and can only be used for creating Dispatchinstances.
*/
-
public void addPort(QName portName, String bindingId, String epAddress)
{
- Port port = new Port (portName, bindingId, epAddress);
- ports.put(portName, port);
+ EndpointMetaData epMetaData = new ClientEndpointMetaData(serviceMetaData, portName, null, Type.JAXWS);
+ epMetaData.setBindingId(bindingId);
+ epMetaData.setEndpointAddress(epAddress);
+ serviceMetaData.addEndpoint(epMetaData);
}
@Override
@@ -231,18 +228,10 @@
private EndpointMetaData getEndpointMetaData(QName portName)
{
- Port port = ports.get(portName);
- if (port == null)
- throw new WebServiceException("Cannot find port: " + portName);
-
- // Create an anonymous endpoint
EndpointMetaData epMetaData = serviceMetaData.getEndpoint(portName);
if (epMetaData == null)
- {
- epMetaData = new ClientEndpointMetaData(serviceMetaData, new QName(Constants.NS_JBOSSWS_URI, "AnonymousPort"), new QName(Constants.NS_JBOSSWS_URI, "Anonymous"), Type.JAXWS);
- epMetaData.setEndpointAddress(port.getEndpointAddress());
- epMetaData.setBindingId(port.getBindingId());
- }
+ throw new WebServiceException("Cannot find port: " + portName);
+
return epMetaData;
}
@@ -258,9 +247,9 @@
public Iterator<QName> getPorts()
{
ArrayList<QName> portNames = new ArrayList<QName>();
- for (Port port : ports.values())
+ for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
{
- portNames.add(port.getQName());
+ portNames.add(epMetaData.getPortName());
}
return portNames.iterator();
}
@@ -330,35 +319,6 @@
}
}
- private static class Port
- {
- private QName qname;
- private String bindingId;
- private String endpointAddress;
-
- public Port(QName qname, String bindingId, String endpointAddress)
- {
- this.qname = qname;
- this.bindingId = bindingId;
- this.endpointAddress = endpointAddress;
- }
-
- public String getBindingId()
- {
- return bindingId;
- }
-
- public String getEndpointAddress()
- {
- return endpointAddress;
- }
-
- public QName getQName()
- {
- return qname;
- }
- }
-
@Override
public <T> Dispatch<T> createDispatch(QName portName, Class<T> type, Mode mode, WebServiceFeature... features)
{
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -241,11 +241,11 @@
{
SOAPBodyElement soapBodyElement = (SOAPBodyElement)soapBody.getChildElements().next();
Name soapName = soapBodyElement.getElementName();
- faultString = "Endpoint " + epMetaData.getQName() + " does not contain operation meta data for: " + soapName;
+ faultString = "Endpoint " + epMetaData.getPortName() + " does not contain operation meta data for: " + soapName;
}
else
{
- faultString = "Endpoint " + epMetaData.getQName() + " does not contain operation meta data for empty soap body";
+ faultString = "Endpoint " + epMetaData.getPortName() + " does not contain operation meta data for empty soap body";
}
// R2724 If an INSTANCE receives a message that is inconsistent with its WSDL description, it SHOULD generate a soap:Fault
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -77,7 +77,7 @@
// Dispatch to JAXWS Provider
if (opMetaData == null && epMetaData.getServiceMode() != null)
{
- QName xmlName = new QName(epMetaData.getQName().getNamespaceURI(), "invoke");
+ QName xmlName = new QName(epMetaData.getPortName().getNamespaceURI(), "invoke");
opMetaData = epMetaData.getOperation(xmlName);
}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/security/WSSecurityDispatcher.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -128,7 +128,7 @@
}
String operation = opMetaData.getQName().toString();
- String port = opMetaData.getEndpointMetaData().getQName().getLocalPart();
+ String port = opMetaData.getEndpointMetaData().getPortName().getLocalPart();
if (hasRequirements(config, operation, port))
throw convertToFault(new InvalidSecurityHeaderException("This service requires <wsse:Security>, which is missing."));
@@ -155,7 +155,7 @@
}
String operation = opMetaData.getQName().toString();
- String port = opMetaData.getEndpointMetaData().getQName().getLocalPart();
+ String port = opMetaData.getEndpointMetaData().getPortName().getLocalPart();
List<OperationDescription<RequireOperation>> operations = buildRequireOperations(config, operation, port);
@@ -228,7 +228,7 @@
OperationMetaData opMetaData = ctx.getOperationMetaData();
String operation = opMetaData.getQName().toString();
- String port = opMetaData.getEndpointMetaData().getQName().getLocalPart();
+ String port = opMetaData.getEndpointMetaData().getPortName().getLocalPart();
Config operationConfig = getConfig(config, port, operation);
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -89,7 +89,7 @@
{
for (WSDLEndpoint wsdlEndpoint : wsdlService.getEndpoints())
{
- if (epMetaData.getQName().equals(wsdlEndpoint.getQName()))
+ if (epMetaData.getPortName().equals(wsdlEndpoint.getQName()))
{
QName bindQName = wsdlEndpoint.getBinding();
NCName ncName = new NCName(bindQName.getLocalPart());
@@ -282,7 +282,7 @@
public static void replaceAddressLocation(ServerEndpointMetaData sepMetaData)
{
WSDLDefinitions wsdlDefinitions = sepMetaData.getServiceMetaData().getWsdlDefinitions();
- QName portName = sepMetaData.getQName();
+ QName portName = sepMetaData.getPortName();
boolean endpointFound = false;
for (WSDLService wsdlService : wsdlDefinitions.getServices())
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -179,7 +179,7 @@
// Nuke parameterStyle
epMetaData.setParameterStyle(null);
-
+
// Process an optional @BindingType annotation
if (wsClass.isAnnotationPresent(BindingType.class))
processBindingType(epMetaData, wsClass);
@@ -202,6 +202,9 @@
createJAXBContext(epMetaData);
populateXmlTypes(epMetaData);
+ // Set SEI name
+ epMetaData.setServiceEndpointInterfaceName(wsClass.getName());
+
// Eager initialization
epMetaData.eagerInitialize();
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -1,24 +1,24 @@
/*
-* 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.
-*/
+ * 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.ws.metadata.builder.jaxws;
// $Id$
@@ -105,37 +105,34 @@
protected void processBindingType(EndpointMetaData epMetaData, Class<?> wsClass)
{
- if (! wsClass.isAnnotationPresent(BindingType.class))
- return;
-
- BindingType anBindingType = (BindingType)wsClass.getAnnotation(BindingType.class);
- String uri = anBindingType.value();
- if (uri.length() > 0)
+ if (wsClass.isAnnotationPresent(BindingType.class))
{
- epMetaData.setBindingId(uri);
+ log.debug("processBindingType on: " + wsClass.getName());
+ BindingType anBindingType = (BindingType)wsClass.getAnnotation(BindingType.class);
+ epMetaData.setBindingId(anBindingType.value());
}
}
protected void processSOAPBinding(EndpointMetaData epMetaData, Class<?> wsClass)
{
-
- if (!wsClass.isAnnotationPresent(SOAPBinding.class))
- return;
-
- SOAPBinding anSoapBinding = wsClass.getAnnotation(SOAPBinding.class);
-
- SOAPBinding.Style attrStyle = anSoapBinding.style();
- Style style = (attrStyle == SOAPBinding.Style.RPC ? Style.RPC : Style.DOCUMENT);
- epMetaData.setStyle(style);
-
- SOAPBinding.Use attrUse = anSoapBinding.use();
- if (attrUse == SOAPBinding.Use.ENCODED)
- throw new WSException("SOAP encoding is not supported for JSR-181 deployments");
-
- epMetaData.setEncodingStyle(Use.LITERAL);
-
- ParameterStyle paramStyle = anSoapBinding.parameterStyle();
- epMetaData.setParameterStyle(paramStyle);
+ if (wsClass.isAnnotationPresent(SOAPBinding.class))
+ {
+ log.debug("processSOAPBinding on: " + wsClass.getName());
+ SOAPBinding anSoapBinding = wsClass.getAnnotation(SOAPBinding.class);
+
+ SOAPBinding.Style attrStyle = anSoapBinding.style();
+ Style style = (attrStyle == SOAPBinding.Style.RPC ? Style.RPC : Style.DOCUMENT);
+ epMetaData.setStyle(style);
+
+ SOAPBinding.Use attrUse = anSoapBinding.use();
+ if (attrUse == SOAPBinding.Use.ENCODED)
+ throw new WSException("SOAP encoding is not supported for JSR-181 deployments");
+
+ epMetaData.setEncodingStyle(Use.LITERAL);
+
+ ParameterStyle paramStyle = anSoapBinding.parameterStyle();
+ epMetaData.setParameterStyle(paramStyle);
+ }
}
/**
@@ -153,12 +150,13 @@
{
if (wsClass.isAnnotationPresent(SOAPMessageHandlers.class))
throw new WSException("Cannot combine @HandlerChain with @SOAPMessageHandlers");
-
+
HandlerChain anHandlerChain = wsClass.getAnnotation(HandlerChain.class);
-
+
URL fileURL = null;
String filename = anHandlerChain.file();
-
+ log.debug("processHandlerChain [" + filename + "] on: " + wsClass.getName());
+
// Try the filename as URL
try
{
@@ -168,7 +166,7 @@
{
// ignore
}
-
+
// Try the filename as File
if (fileURL == null)
{
@@ -183,23 +181,23 @@
// ignore
}
}
-
+
// Try the filename as Resource
if (fileURL == null)
{
fileURL = epMetaData.getClassLoader().getResource(filename);
}
-
+
// Try the filename relative to class
if (fileURL == null)
{
String packagePath = wsClass.getPackage().getName().replace('.', '/');
fileURL = epMetaData.getClassLoader().getResource(packagePath + "/" + filename);
}
-
+
if (fileURL == null)
throw new WSException("Cannot resolve handler file '" + filename + "' on " + wsClass.getName());
-
+
try
{
HandlerChainsMetaData handlerChainsMetaData = null;
@@ -217,7 +215,7 @@
{
is.close();
}
-
+
// Setup the endpoint handlers
for (HandlerChainMetaData handlerChainMetaData : handlerChainsMetaData.getHandlerChains())
{
@@ -242,16 +240,16 @@
if (omd.isOneWay())
throw new IllegalStateException("JSR-181 4.3.1 - A JSR-181 processor is REQUIRED to report an error if an operation marked "
+ "@Oneway has a return value, declares any checked exceptions or has any INOUT or OUT parameters.");
-
+
WebFault annotation = exception.getAnnotation(WebFault.class);
-
+
String name;
String namespace;
String faultBeanName = null;
-
+
// Only the element name is effected by @WebFault, the type uses the same convention
QName xmlType = new QName(omd.getQName().getNamespaceURI(), exception.getSimpleName());
-
+
/*
* If @WebFault is present, and the exception contains getFaultInfo, the
* return value should be used. Otherwise we need to generate the bean.
@@ -263,7 +261,7 @@
namespace = annotation.targetNamespace();
if (namespace.length() == 0)
namespace = omd.getQName().getNamespaceURI();
-
+
Class<?> faultBean = getFaultInfo(exception);
if (faultBean != null)
{
@@ -276,21 +274,21 @@
name = xmlType.getLocalPart();
namespace = xmlType.getNamespaceURI();
}
-
+
if (faultBeanName == null)
faultBeanName = JavaUtils.getPackageName(omd.getEndpointMetaData().getServiceEndpointInterface()) + ".jaxws." + exception.getSimpleName() + "Bean";
-
+
QName xmlName = new QName(namespace, name);
-
+
FaultMetaData fmd = new FaultMetaData(omd, xmlName, xmlType, exception.getName());
fmd.setFaultBeanName(faultBeanName);
-
+
if (generate)
wrapperGenerator.generate(fmd);
-
+
javaTypes.add(fmd.getFaultBean());
typeRefs.add(new TypeReference(fmd.getXmlName(), fmd.getFaultBean()));
-
+
omd.addFault(fmd);
}
@@ -303,16 +301,16 @@
{
if (!Collection.class.isAssignableFrom(rawType) && !Map.class.isAssignableFrom(rawType))
return null;
-
+
if (!(type instanceof ParameterizedType))
return null;
-
+
ParameterizedType paramType = (ParameterizedType)type;
Type[] arguments = paramType.getActualTypeArguments();
String[] ret = new String[arguments.length];
for (int i = 0; i < arguments.length; i++)
ret[i] = JavaUtils.erasure(arguments[i]).getName();
-
+
return ret;
}
@@ -324,27 +322,27 @@
if (method.isAnnotationPresent(RequestWrapper.class))
{
RequestWrapper anReqWrapper = method.getAnnotation(RequestWrapper.class);
-
+
String localName = anReqWrapper.localName().length() > 0 ? anReqWrapper.localName() : xmlName.getLocalPart();
String targetNamespace = anReqWrapper.targetNamespace().length() > 0 ? anReqWrapper.targetNamespace() : xmlName.getNamespaceURI();
xmlName = new QName(targetNamespace, localName);
-
+
if (anReqWrapper.className().length() > 0)
requestWrapperType = anReqWrapper.className();
}
-
+
// Conformance 3.18, the default value must be the same as the method name
if (requestWrapperType == null)
{
String packageName = JavaUtils.getPackageName(method.getDeclaringClass()) + ".jaxws";
requestWrapperType = packageName + "." + JavaUtils.capitalize(method.getName());
}
-
+
// JAX-WS p.37 pg.1, the annotation only affects the element name, not the type name
ParameterMetaData wrapperParameter = new ParameterMetaData(operation, xmlName, xmlType, requestWrapperType);
wrapperParameter.setAccessorFactoryCreator(JAXBAccessor.FACTORY_CREATOR);
operation.addParameter(wrapperParameter);
-
+
return wrapperParameter;
}
@@ -353,30 +351,30 @@
QName operationQName = operation.getQName();
QName xmlName = new QName(operationQName.getNamespaceURI(), operationQName.getLocalPart() + "Response");
QName xmlType = xmlName;
-
+
String responseWrapperType = null;
if (method.isAnnotationPresent(ResponseWrapper.class))
{
ResponseWrapper anResWrapper = method.getAnnotation(ResponseWrapper.class);
-
+
String localName = anResWrapper.localName().length() > 0 ? anResWrapper.localName() : xmlName.getLocalPart();
String targetNamespace = anResWrapper.targetNamespace().length() > 0 ? anResWrapper.targetNamespace() : xmlName.getNamespaceURI();
xmlName = new QName(targetNamespace, localName);
-
+
if (anResWrapper.className().length() > 0)
responseWrapperType = anResWrapper.className();
}
-
+
if (responseWrapperType == null)
{
String packageName = JavaUtils.getPackageName(method.getDeclaringClass()) + ".jaxws";
responseWrapperType = packageName + "." + JavaUtils.capitalize(method.getName()) + "Response";
}
-
+
ParameterMetaData retMetaData = new ParameterMetaData(operation, xmlName, xmlType, responseWrapperType);
retMetaData.setAccessorFactoryCreator(JAXBAccessor.FACTORY_CREATOR);
operation.setReturnParameter(retMetaData);
-
+
return retMetaData;
}
@@ -388,7 +386,7 @@
Class<?> returnType = method.getReturnType();
if (returnType == void.class)
return null;
-
+
return returnType;
}
catch (SecurityException e)
@@ -410,7 +408,7 @@
if (anWebParam.mode() == WebParam.Mode.OUT)
return ParameterMode.OUT;
}
-
+
return HolderUtils.isHolderType(javaType) ? ParameterMode.INOUT : ParameterMode.IN;
}
@@ -419,7 +417,7 @@
for (Annotation annotation : method.getParameterAnnotations()[pos])
if (annotation instanceof WebParam)
return (WebParam)annotation;
-
+
return null;
}
@@ -428,33 +426,33 @@
String namespace = null;
String name = null;
boolean header = false;
-
+
if (webParam != null)
{
if (webParam.targetNamespace().length() > 0)
namespace = webParam.targetNamespace();
-
+
// RPC types use the partName for their XML name
if (webParam.partName().length() > 0 && opMetaData.isRPCLiteral())
name = webParam.partName();
else if (webParam.name().length() > 0)
name = webParam.name();
-
+
header = webParam.header();
}
-
+
// Bare and headers must be qualified
if (namespace == null && (opMetaData.isDocumentBare() || header))
namespace = opMetaData.getQName().getNamespaceURI();
-
+
// RPC body parts must have no namespace
else if (opMetaData.isRPCLiteral() && !header)
namespace = null;
-
+
// Bare uses the operation name as the default, everything else is generated
if (name == null)
name = opMetaData.isDocumentBare() && !header ? opMetaData.getQName().getLocalPart() : "arg" + index;
-
+
return (namespace != null) ? new QName(namespace, name) : new QName(name);
}
@@ -463,33 +461,33 @@
String name = null;
String namespace = null;
boolean header = false;
-
+
if (anWebResult != null)
{
if (anWebResult.targetNamespace().length() > 0)
namespace = anWebResult.targetNamespace();
-
+
// RPC types use the partName for their XML name
if (anWebResult.partName().length() > 0 && opMetaData.isRPCLiteral())
name = anWebResult.partName();
else if (anWebResult.name().length() > 0)
name = anWebResult.name();
-
+
header = anWebResult.header();
}
-
+
// Bare and headers must be qualified
if (namespace == null && (opMetaData.isDocumentBare() || header))
namespace = opMetaData.getQName().getNamespaceURI();
-
+
// RPC body parts must have no namespace
else if (opMetaData.isRPCLiteral() && !header)
namespace = null;
-
+
// Bare uses the operation name as the default, everything else is generated
if (name == null)
name = opMetaData.isDocumentBare() && !header ? opMetaData.getResponseName().getLocalPart() : "return";
-
+
return (namespace != null) ? new QName(namespace, name) : new QName(name);
}
@@ -500,31 +498,31 @@
{
// Until there is a addressing annotion we fallback to implicit action association
// TODO: figure out a way to assign message name instead of IN and OUT
- String tns = epMetaData.getQName().getNamespaceURI();
- String portTypeName = epMetaData.getQName().getLocalPart();
-
+ String tns = epMetaData.getPortName().getNamespaceURI();
+ String portTypeName = epMetaData.getPortName().getLocalPart();
+
AddressingProperties ADDR = new AddressingPropertiesImpl();
AddressingOpMetaExt addrExt = new AddressingOpMetaExt(ADDR.getNamespaceURI());
addrExt.setInboundAction(tns + "/" + portTypeName + "/IN");
-
+
if (!opMetaData.isOneWay())
addrExt.setOutboundAction(tns + "/" + portTypeName + "/OUT");
-
+
opMetaData.addExtension(addrExt);
}
private void processWebMethod(EndpointMetaData epMetaData, Method method)
{
String javaName = method.getName();
-
+
// skip asnyc methods, they dont need meta data representation
if (method.getName().endsWith(Constants.ASYNC_METHOD_SUFFIX))
return;
-
+
// reflection defaults
String soapAction = "";
String operationName = method.getName();
-
+
// annotation values that override defaults
if (method.isAnnotationPresent(WebMethod.class))
{
@@ -535,12 +533,12 @@
operationName = anWebMethod.operationName();
}
}
-
- String targetNS = epMetaData.getInterfaceQName().getNamespaceURI();
+
+ String targetNS = epMetaData.getPortTypeName().getNamespaceURI();
OperationMetaData opMetaData = new OperationMetaData(epMetaData, new QName(targetNS, operationName), javaName);
opMetaData.setOneWay(method.isAnnotationPresent(Oneway.class));
opMetaData.setSOAPAction(soapAction);
-
+
if (method.isAnnotationPresent(SOAPBinding.class))
{
SOAPBinding anBinding = method.getAnnotation(SOAPBinding.class);
@@ -548,28 +546,28 @@
throw new IllegalArgumentException("@SOAPBinding must be specified using DOCUMENT style when placed on a method");
opMetaData.setParameterStyle(anBinding.parameterStyle());
}
-
+
epMetaData.addOperation(opMetaData);
-
+
// Build parameter meta data
Class[] parameterTypes = method.getParameterTypes();
Type[] genericTypes = method.getGenericParameterTypes();
Annotation[][] parameterAnnotations = method.getParameterAnnotations();
ParameterMetaData wrapperParameter = null, wrapperOutputParameter = null;
List<WrappedParameter> wrappedParameters = null, wrappedOutputParameters = null;
-
+
// Force paramter style to wrapped
if (method.isAnnotationPresent(RequestWrapper.class) || method.isAnnotationPresent(ResponseWrapper.class))
{
epMetaData.setParameterStyle(ParameterStyle.WRAPPED);
}
-
+
if (opMetaData.isDocumentWrapped())
{
wrapperParameter = createRequestWrapper(opMetaData, method);
wrappedParameters = new ArrayList<WrappedParameter>(parameterTypes.length);
wrapperParameter.setWrappedParameters(wrappedParameters);
-
+
if (!opMetaData.isOneWay())
{
wrapperOutputParameter = createResponseWrapper(opMetaData, method);
@@ -577,7 +575,7 @@
wrapperOutputParameter.setWrappedParameters(wrappedOutputParameters);
}
}
-
+
for (int i = 0; i < parameterTypes.length; i++)
{
Class javaType = parameterTypes[i];
@@ -587,26 +585,26 @@
boolean isHeader = anWebParam != null && anWebParam.header();
boolean isWrapped = opMetaData.isDocumentWrapped() && !isHeader;
ParameterMode mode = getParameterMode(anWebParam, javaType);
-
+
// Assert one-way
if (opMetaData.isOneWay() && mode != ParameterMode.IN)
throw new IllegalArgumentException("A one-way operation can not have output parameters [" + "method = " + method.getName() + ", parameter = " + i + "]");
-
+
if (HolderUtils.isHolderType(javaType))
{
genericType = HolderUtils.getGenericValueType(genericType);
javaType = JavaUtils.erasure(genericType);
javaTypeName = javaType.getName();
}
-
+
if (isWrapped)
{
QName wrappedElementName = getWebParamName(opMetaData, i, anWebParam);
String variable = convertToVariable(wrappedElementName.getLocalPart());
-
+
WrappedParameter wrappedParameter = new WrappedParameter(wrappedElementName, javaTypeName, variable, i);
wrappedParameter.setTypeArguments(convertTypeArguments(javaType, genericType));
-
+
if (mode != ParameterMode.OUT)
wrappedParameters.add(wrappedParameter);
if (mode != ParameterMode.IN)
@@ -618,12 +616,12 @@
else
{
QName xmlName = getWebParamName(opMetaData, i, anWebParam);
-
+
ParameterMetaData paramMetaData = new ParameterMetaData(opMetaData, xmlName, javaTypeName);
paramMetaData.setInHeader(isHeader);
paramMetaData.setIndex(i);
paramMetaData.setMode(mode);
-
+
/*
* Note: The TCK enforces the following rule in the spec regarding
* partName: "This is only used if the operation is rpc style or if
@@ -638,13 +636,13 @@
*/
if (anWebParam != null && !opMetaData.isDocumentWrapped() && anWebParam.partName().length() > 0)
paramMetaData.setPartName(anWebParam.partName());
-
+
opMetaData.addParameter(paramMetaData);
javaTypes.add(javaType);
typeRefs.add(new TypeReference(xmlName, genericType, parameterAnnotations[i]));
}
}
-
+
// Build result meta data
Class returnType = method.getReturnType();
Type genericReturnType = method.getGenericReturnType();
@@ -653,17 +651,17 @@
{
if (opMetaData.isOneWay())
throw new IllegalArgumentException("[JSR-181 2.5.1] The method '" + method.getName() + "' can not have a return value if it is marked OneWay");
-
+
WebResult anWebResult = method.getAnnotation(WebResult.class);
boolean isHeader = anWebResult != null && anWebResult.header();
boolean isWrappedBody = opMetaData.isDocumentWrapped() && !isHeader;
QName xmlName = getWebResultName(opMetaData, anWebResult);
-
+
if (isWrappedBody)
{
WrappedParameter wrapped = new WrappedParameter(xmlName, returnTypeName, convertToVariable(xmlName.getLocalPart()), -1);
wrapped.setTypeArguments(convertTypeArguments(returnType, genericReturnType));
-
+
// insert at the beginning just for prettiness
wrappedOutputParameters.add(0, wrapped);
}
@@ -673,7 +671,7 @@
retMetaData.setInHeader(isHeader);
retMetaData.setIndex(-1);
retMetaData.setMode(ParameterMode.OUT);
-
+
// Special case: If we have a document/literal wrapped message, then
// the return metadata must be the wrapper type that is sent in the
// body. So, in order to handle headers that are mapped to the java
@@ -691,15 +689,15 @@
// header parameters.
if (anWebResult != null && anWebResult.partName().length() > 0)
retMetaData.setPartName(anWebResult.partName());
-
+
opMetaData.setReturnParameter(retMetaData);
}
-
+
javaTypes.add(returnType);
typeRefs.add(new TypeReference(xmlName, genericReturnType, method.getAnnotations()));
}
}
-
+
// Generate wrapper beans
if (opMetaData.isDocumentWrapped())
{
@@ -717,12 +715,12 @@
typeRefs.add(new TypeReference(wrapperOutputParameter.getXmlName(), wrapperClass));
}
}
-
+
// Add faults
for (Class exClass : method.getExceptionTypes())
if (!RemoteException.class.isAssignableFrom(exClass))
addFault(opMetaData, exClass);
-
+
// process op meta data extension
processMetaExtensions(epMetaData, opMetaData);
}
@@ -730,7 +728,7 @@
protected void processWebMethods(EndpointMetaData epMetaData, Class wsClass)
{
epMetaData.clearOperations();
-
+
// Process @WebMethod annotations
int webMethodCount = 0;
for (Method method : wsClass.getMethods())
@@ -743,7 +741,7 @@
webMethodCount++;
}
}
-
+
// @WebService should expose all inherited methods if @WebMethod is never specified
if (webMethodCount == 0 && !wsClass.isInterface())
{
@@ -758,7 +756,7 @@
}
}
}
-
+
if (webMethodCount == 0)
throw new WSException("No exposable methods found");
}
@@ -775,7 +773,7 @@
{
try
{
- String targetNS = epMetaData.getInterfaceQName().getNamespaceURI();
+ String targetNS = epMetaData.getPortTypeName().getNamespaceURI();
log.debug("JAXBContext [types=" + javaTypes + ",tns=" + targetNS + "]");
jaxbCtx = JAXBRIContext.newInstance(javaTypes.toArray(new Class[0]), typeRefs, targetNS, false);
}
@@ -789,10 +787,10 @@
{
EndpointMetaData epMetaData = faultMetaData.getOperationMetaData().getEndpointMetaData();
TypesMetaData types = epMetaData.getServiceMetaData().getTypesMetaData();
-
+
QName xmlType = faultMetaData.getXmlType();
String faultBeanName = faultMetaData.getFaultBeanName();
-
+
types.addTypeMapping(new TypeMappingMetaData(types, xmlType, faultBeanName));
}
@@ -800,12 +798,12 @@
{
EndpointMetaData epMetaData = paramMetaData.getOperationMetaData().getEndpointMetaData();
TypesMetaData types = epMetaData.getServiceMetaData().getTypesMetaData();
-
+
QName xmlName = paramMetaData.getXmlName();
QName xmlType = paramMetaData.getXmlType();
Class javaType = paramMetaData.getJavaType();
String javaName = paramMetaData.getJavaTypeName();
-
+
if (xmlType == null)
{
try
@@ -816,7 +814,7 @@
{
throw new IllegalStateException("Cannot obtain xml type for: [xmlName=" + xmlName + ",javaName=" + javaName + "]");
}
-
+
/* Anonymous type.
*
* Currently the design of our stack is based on the
@@ -826,10 +824,10 @@
*/
if (xmlType == null)
xmlType = new QName(xmlName.getNamespaceURI(), ">" + xmlName.getLocalPart());
-
+
paramMetaData.setXmlType(xmlType);
}
-
+
types.addTypeMapping(new TypeMappingMetaData(types, xmlType, javaName));
}
@@ -842,12 +840,12 @@
{
populateXmlType(paramMetaData);
}
-
+
// return value
ParameterMetaData returnParameter = operation.getReturnParameter();
if (returnParameter != null)
populateXmlType(returnParameter);
-
+
// faults
for (FaultMetaData faultMetaData : operation.getFaults())
{
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -146,7 +146,7 @@
private void processInvokeMethod(ServerEndpointMetaData epMetaData)
{
String javaName = "invoke";
- String targetNS = epMetaData.getQName().getNamespaceURI();
+ String targetNS = epMetaData.getPortName().getNamespaceURI();
OperationMetaData opMetaData = new OperationMetaData(epMetaData, new QName(targetNS, javaName), javaName);
epMetaData.addOperation(opMetaData);
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -247,7 +247,7 @@
WSDLDefinitions wsdlDefinitions = generator.generate(serviceMetaData);
// Ensure that types are only in the interface qname
- wsdlDefinitions.getWsdlTypes().setNamespace(epMetaData.getInterfaceQName().getNamespaceURI());
+ wsdlDefinitions.getWsdlTypes().setNamespace(epMetaData.getPortTypeName().getNamespaceURI());
final File tmpdir = IOUtils.createTempDirectory();
File wsdlTmpFile = File.createTempFile(serviceName, ".wsdl", tmpdir);
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -36,12 +36,13 @@
*/
public class ClientEndpointMetaData extends EndpointMetaData
{
- public ClientEndpointMetaData(ServiceMetaData service, QName qname, QName interfaceQName, Type type)
+ public ClientEndpointMetaData(ServiceMetaData service, QName qname, QName portTypeName, Type type)
{
- super(service, qname, interfaceQName, type);
+ super(service, qname, portTypeName, type);
}
- public String getConfigName() {
+ public String getConfigName()
+ {
String configName = super.getConfigName();
if (configName == null)
{
@@ -51,7 +52,8 @@
return configName;
}
- public String getConfigFile() {
+ public String getConfigFile()
+ {
String configFile = super.getConfigFile();
if (configFile == null)
{
@@ -72,22 +74,22 @@
{
StringBuilder buffer = new StringBuilder("\nClientEndpointMetaData:");
buffer.append("\n type=").append(getType());
- buffer.append("\n qname=").append(getQName());
- buffer.append("\n address=" ).append(getEndpointAddress());
- buffer.append("\n binding=" ).append( getBindingId());
- buffer.append("\n seiName=" ).append( getServiceEndpointInterfaceName());
- buffer.append("\n configFile=" ).append( getConfigFile());
- buffer.append("\n configName=" ).append( getConfigName());
- buffer.append("\n authMethod=" ).append( getAuthMethod());
- buffer.append("\n properties=" ).append( getProperties());
+ buffer.append("\n qname=").append(getPortName());
+ buffer.append("\n address=").append(getEndpointAddress());
+ buffer.append("\n binding=").append(getBindingId());
+ buffer.append("\n seiName=").append(getServiceEndpointInterfaceName());
+ buffer.append("\n configFile=").append(getConfigFile());
+ buffer.append("\n configName=").append(getConfigName());
+ buffer.append("\n authMethod=").append(getAuthMethod());
+ buffer.append("\n properties=").append(getProperties());
for (OperationMetaData opMetaData : getOperations())
{
- buffer.append("\n" ).append( opMetaData);
+ buffer.append("\n").append(opMetaData);
}
for (HandlerMetaData hdlMetaData : getHandlerMetaData(HandlerType.ALL))
{
- buffer.append("\n" ).append( hdlMetaData);
+ buffer.append("\n").append(hdlMetaData);
}
return buffer.toString();
}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -81,7 +81,7 @@
// The REQUIRED binding id
private String bindingId;
// The REQUIRED name of the WSDL interface/portType
- private QName interfaceQName;
+ private QName portTypeName;
// The REQUIRED config-name
private String configName;
// The REQUIRED config-file
@@ -117,11 +117,11 @@
private ConfigObservable configObservable = new ConfigObservable();
- public EndpointMetaData(ServiceMetaData service, QName qname, QName interfaceQName, Type type)
+ public EndpointMetaData(ServiceMetaData service, QName portName, QName portTypeName, Type type)
{
this.serviceMetaData = service;
- this.portName = qname;
- this.interfaceQName = interfaceQName;
+ this.portName = portName;
+ this.portTypeName = portTypeName;
this.type = type;
// The default binding
@@ -133,14 +133,14 @@
return serviceMetaData;
}
- public QName getQName()
+ public QName getPortName()
{
return portName;
}
- public QName getInterfaceQName()
+ public QName getPortTypeName()
{
- return interfaceQName;
+ return portTypeName;
}
public String getEndpointAddress()
@@ -595,7 +595,7 @@
{
CommonBindingProvider provider = (CommonBindingProvider)configurable;
((CommonSOAPBinding)provider.getCommonBinding()).setMTOMEnabled(true);
- log.debug("Enable MTOM on endpoint " + this.getQName());
+ log.debug("Enable MTOM on endpoint " + this.getPortName());
}
}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -63,9 +63,9 @@
// The bean that registers with the ServiceEndpointManager
private String managedEndpointBean = "org.jboss.ws.core.server.ServiceEndpoint";
- public ServerEndpointMetaData(ServiceMetaData service, QName qname, QName interfaceQName, Type type)
+ public ServerEndpointMetaData(ServiceMetaData service, QName portName, QName portTypeName, Type type)
{
- super(service, qname, interfaceQName, type);
+ super(service, portName, portTypeName, type);
}
public String getLinkName()
@@ -206,7 +206,7 @@
{
StringBuilder buffer = new StringBuilder("\nServerEndpointMetaData:");
buffer.append("\n type=").append(getType());
- buffer.append("\n qname=").append(getQName());
+ buffer.append("\n qname=").append(getPortName());
buffer.append("\n id=").append(getServiceEndpointID().getCanonicalName());
buffer.append("\n address=").append(getEndpointAddress());
buffer.append("\n binding=").append(getBindingId());
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -185,7 +185,7 @@
public void addEndpoint(EndpointMetaData epMetaData)
{
- QName portName = epMetaData.getQName();
+ QName portName = epMetaData.getPortName();
// This happends when we have multiple port components in sharing the same wsdl port
// The EndpointMetaData name is the wsdl port, so we cannot have multiple meta data for the same port.
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/helpers/JavaToWSDLHelper.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -183,7 +183,7 @@
serviceMapping.setServiceInterface(serviceInterfaceName);
serviceMapping.setWsdlServiceName(serviceQName);
- String endpointName = endpoint.getQName().getLocalPart();
+ String endpointName = endpoint.getPortName().getLocalPart();
PortMapping portMapping = new PortMapping(serviceMapping);
portMapping.setJavaPortName(endpointName);
portMapping.setPortName(endpointName);
@@ -191,7 +191,7 @@
javaWsdlMapping.addServiceInterfaceMappings(serviceMapping);
- String interfaceName = endpoint.getInterfaceQName().getLocalPart();
+ String interfaceName = endpoint.getPortTypeName().getLocalPart();
ServiceEndpointInterfaceMapping seiMapping = new ServiceEndpointInterfaceMapping(javaWsdlMapping);
seiMapping.setServiceEndpointInterface(endpoint.getServiceEndpointInterfaceName());
seiMapping.setWsdlPortType(new QName(wsdl.getTargetNamespace(), interfaceName, "portTypeNS"));
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/jaxws/WSDLGenerator.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -70,14 +70,14 @@
protected void processEndpoint(WSDLService service, EndpointMetaData endpoint)
{
WSDLEndpoint wsdlEndpoint = new WSDLEndpoint(service);
- wsdlEndpoint.setQName(endpoint.getQName());
- wsdlEndpoint.setName(new NCName(endpoint.getQName().getLocalPart()));
+ wsdlEndpoint.setQName(endpoint.getPortName());
+ wsdlEndpoint.setName(new NCName(endpoint.getPortName().getLocalPart()));
String address = endpoint.getEndpointAddress();
wsdlEndpoint.setAddress(address == null ? "REPLACE_WITH_ACTUAL_URL" : address);
service.addEndpoint(wsdlEndpoint);
WSDLInterface wsdlInterface = new WSDLInterface(wsdl);
- QName interfaceQName = endpoint.getInterfaceQName();
+ QName interfaceQName = endpoint.getPortTypeName();
wsdlInterface.setQName(interfaceQName);
wsdlInterface.setName(new NCName(interfaceQName));
wsdl.addInterface(wsdlInterface);
@@ -325,7 +325,7 @@
if (endpoint == null)
throw new IllegalStateException("A service must have an endpoint");
- wsdlService.setInterfaceName(endpoint.getQName());
+ wsdlService.setInterfaceName(endpoint.getPortName());
}
/**
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/metadata/ReflectiveMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/metadata/ReflectiveMetaDataBuilder.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/metadata/ReflectiveMetaDataBuilder.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -68,7 +68,7 @@
{
this.seiClass = tmd.getServiceEndpointInterface();
checkServiceEndpointInterface();
- this.targetNamespace = tmd.getQName().getNamespaceURI();
+ this.targetNamespace = tmd.getPortName().getNamespaceURI();
this.tmd = tmd;
}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -37,8 +37,8 @@
{
public String typeNamespace;
- public ToolsEndpointMetaData(ServiceMetaData service, QName name, QName interfaceQName)
+ public ToolsEndpointMetaData(ServiceMetaData service, QName portName, QName portTypeName)
{
- super(service, name, interfaceQName, Type.JAXRPC);
+ super(service, portName, portTypeName, Type.JAXRPC);
}
}
\ No newline at end of file
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/provider/ProviderJAXBTestCase.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/provider/ProviderJAXBTestCase.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/provider/ProviderJAXBTestCase.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -40,6 +40,7 @@
import javax.xml.ws.Dispatch;
import javax.xml.ws.Service;
import javax.xml.ws.Service.Mode;
+import javax.xml.ws.soap.SOAPBinding;
import junit.framework.Test;
@@ -104,7 +105,9 @@
QName portName = new QName(targetNS, "ProviderPort");
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-provider-jaxb/" + target + "?wsdl");
- Service service = Service.create(wsdlURL, serviceName);
+ Service service = Service.create(serviceName);
+ service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, wsdlURL.toExternalForm());
+
JAXBContext jbc = JAXBContext.newInstance(new Class[] { UserType.class });
Dispatch<Object> dispatch = service.createDispatch(portName, jbc, Mode.PAYLOAD);
return dispatch;
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/provider/ProviderMessageTestCase.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/provider/ProviderMessageTestCase.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/provider/ProviderMessageTestCase.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -24,18 +24,28 @@
// $Id$
import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.net.MalformedURLException;
import java.net.URL;
+import javax.xml.bind.JAXBException;
+import javax.xml.namespace.QName;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPConnection;
import javax.xml.soap.SOAPConnectionFactory;
import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.Service;
+import javax.xml.ws.Service.Mode;
+import javax.xml.ws.soap.SOAPBinding;
import junit.framework.Test;
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
@@ -47,6 +57,14 @@
*/
public class ProviderMessageTestCase extends JBossWSTest
{
+ private String msgString =
+ "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
+ " <env:Header/>" +
+ " <env:Body>" +
+ " <ns1:somePayload xmlns:ns1='http://org.jboss.ws/provider'/>" +
+ " </env:Body>" +
+ "</env:Envelope>";
+
public static Test suite()
{
return JBossWSTestSetup.newTestSetup(ProviderMessageTestCase.class, "jaxws-provider-message.war");
@@ -60,25 +78,48 @@
assertNotNull(wsdlDefinitions);
}
+ public void testProviderDispatch() throws Exception
+ {
+ Dispatch<SOAPMessage> dispatch = createDispatch("ProviderEndpoint");
+ SOAPMessage reqMsg = getRequestMessage();
+
+ SOAPMessage resMsg = dispatch.invoke(reqMsg);
+ SOAPEnvelope resEnv = resMsg.getSOAPPart().getEnvelope();
+
+ assertEquals(DOMUtils.parse(msgString), resEnv);
+ }
+
+ private Dispatch<SOAPMessage> createDispatch(String target) throws MalformedURLException, JAXBException
+ {
+ String targetNS = "http://org.jboss.ws/provider";
+ QName serviceName = new QName(targetNS, "ProviderService");
+ QName portName = new QName(targetNS, "ProviderPort");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-provider-message/" + target + "?wsdl");
+
+ Service service = Service.create(serviceName);
+ service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, wsdlURL.toExternalForm());
+
+ Dispatch<SOAPMessage> dispatch = service.createDispatch(portName, SOAPMessage.class, Mode.MESSAGE);
+ return dispatch;
+ }
+
public void testProviderMessage() throws Exception
{
- String msgString =
- "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
- " <env:Header/>" +
- " <env:Body>" +
- " <ns1:somePayload xmlns:ns1='http://org.jboss.ws/provider'/>" +
- " </env:Body>" +
- "</env:Envelope>";
-
- MessageFactory msgFactory = MessageFactory.newInstance();
- SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
- SOAPMessage reqMsg = msgFactory.createMessage(null, new ByteArrayInputStream(msgString.getBytes()));
+ SOAPMessage reqMsg = getRequestMessage();
SOAPEnvelope reqEnv = reqMsg.getSOAPPart().getEnvelope();
URL epURL = new URL("http://" + getServerHost() + ":8080/jaxws-provider-message");
+ SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
SOAPMessage resMsg = con.call(reqMsg, epURL);
SOAPEnvelope resEnv = resMsg.getSOAPPart().getEnvelope();
assertEquals(reqEnv, resEnv);
}
+
+ private SOAPMessage getRequestMessage() throws SOAPException, IOException
+ {
+ MessageFactory msgFactory = MessageFactory.newInstance();
+ SOAPMessage reqMsg = msgFactory.createMessage(null, new ByteArrayInputStream(msgString.getBytes()));
+ return reqMsg;
+ }
}
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/provider/ProviderPayloadTestCase.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/provider/ProviderPayloadTestCase.java 2007-01-16 11:33:23 UTC (rev 1979)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/provider/ProviderPayloadTestCase.java 2007-01-16 12:18:26 UTC (rev 1980)
@@ -24,20 +24,33 @@
// $Id$
import java.io.ByteArrayInputStream;
+import java.net.MalformedURLException;
import java.net.URL;
+import javax.xml.bind.JAXBException;
+import javax.xml.namespace.QName;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPConnection;
import javax.xml.soap.SOAPConnectionFactory;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPMessage;
+import javax.xml.transform.Source;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.Service;
+import javax.xml.ws.Service.Mode;
+import javax.xml.ws.soap.SOAPBinding;
import junit.framework.Test;
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.w3c.dom.Document;
/**
* Test a Provider<SOAPMessage>
@@ -47,6 +60,9 @@
*/
public class ProviderPayloadTestCase extends JBossWSTest
{
+ private String msgString =
+ "<ns1:somePayload xmlns:ns1='http://org.jboss.ws/provider'/>";
+
public static Test suite()
{
return JBossWSTestSetup.newTestSetup(ProviderPayloadTestCase.class, "jaxws-provider-payload.war");
@@ -60,11 +76,37 @@
assertNotNull(wsdlDefinitions);
}
+ public void testProviderDispatch() throws Exception
+ {
+ Dispatch<Source> dispatch = createDispatch("ProviderEndpoint");
+ Source resPayload = dispatch.invoke(new DOMSource(DOMUtils.parse(msgString)));
+
+ DOMResult domResult = new DOMResult();
+ TransformerFactory tf = TransformerFactory.newInstance();
+ tf.newTransformer().transform(resPayload, domResult);
+
+ Document doc = (Document)domResult.getNode();
+ assertEquals(DOMUtils.parse(msgString), doc.getDocumentElement());
+ }
+
+ private Dispatch<Source> createDispatch(String target) throws MalformedURLException, JAXBException
+ {
+ String targetNS = "http://org.jboss.ws/provider";
+ QName serviceName = new QName(targetNS, "ProviderService");
+ QName portName = new QName(targetNS, "ProviderPort");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-provider-payload/" + target + "?wsdl");
+
+ Service service = Service.create(serviceName);
+ service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, wsdlURL.toExternalForm());
+
+ Dispatch<Source> dispatch = service.createDispatch(portName, Source.class, Mode.PAYLOAD);
+ return dispatch;
+ }
+
public void testProviderMessage() throws Exception
{
String reqString =
"<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
- " <env:Header/>" +
" <env:Body>" +
" <ns1:somePayload xmlns:ns1='http://org.jboss.ws/provider'/>" +
" </env:Body>" +
18 years
JBossWS SVN: r1979 - trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/xop.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-01-16 06:33:23 -0500 (Tue, 16 Jan 2007)
New Revision: 1979
Modified:
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java
Log:
Reference JIRA issue
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java 2007-01-16 07:52:19 UTC (rev 1978)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/jaxws/xop/MimeDeclarationTestCase.java 2007-01-16 11:33:23 UTC (rev 1979)
@@ -70,7 +70,7 @@
if(true)
{
- System.out.println("FIXME: XmlMimeType on SEI parameter declarations");
+ System.out.println("FIXME (JBWS-1460): @XmlMimeType on SEI parameter declarations");
return;
}
18 years
JBossWS SVN: r1978 - in trunk: integration-jboss50 and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-01-16 02:52:19 -0500 (Tue, 16 Jan 2007)
New Revision: 1978
Added:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
Removed:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
Modified:
trunk/integration-jboss42/.classpath
trunk/integration-jboss50/.classpath
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
trunk/jbossws-tests/src/main/java/org/jboss/test/ws/tools/java2xsd/SchemaModelTestCase.java
Log:
Restructure JAXWS meta data builder
Modified: trunk/integration-jboss42/.classpath
===================================================================
--- trunk/integration-jboss42/.classpath 2007-01-16 04:10:04 UTC (rev 1977)
+++ trunk/integration-jboss42/.classpath 2007-01-16 07:52:19 UTC (rev 1978)
@@ -28,9 +28,6 @@
<classpathentry kind="lib" path="/build/thirdparty/xalan.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/xercesImpl.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/mail.jar"/>
- <classpathentry kind="lib" path="/home/tdiesler/svn/jbossas/branches/Branch_4_2/build/output/jboss-4.2.0.CR1-ejb3/server/default/deploy/ejb3.deployer/jboss-annotations-ejb3.jar"/>
- <classpathentry kind="lib" path="/home/tdiesler/svn/jbossas/branches/Branch_4_2/build/output/jboss-4.2.0.CR1-ejb3/server/default/deploy/ejb3.deployer/jboss-ejb3.jar"/>
- <classpathentry kind="lib" path="/home/tdiesler/svn/jbossas/branches/Branch_4_2/build/output/jboss-4.2.0.CR1-ejb3/server/default/deploy/ejb3.deployer/jboss-ejb3x.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/jbosssx-client.jar" sourcepath="/build/thirdparty/jbosssx-src.zip"/>
<classpathentry kind="output" path="output-eclipse"/>
</classpath>
Modified: trunk/integration-jboss50/.classpath
===================================================================
--- trunk/integration-jboss50/.classpath 2007-01-16 04:10:04 UTC (rev 1977)
+++ trunk/integration-jboss50/.classpath 2007-01-16 07:52:19 UTC (rev 1978)
@@ -30,10 +30,6 @@
<classpathentry kind="lib" path="/build/thirdparty/xercesImpl.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/mail.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/jboss-5.0.x"/>
- <classpathentry kind="lib" path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta2/server/default/deployers/ejb3.deployer/jboss-annotations-ejb3.jar"/>
- <classpathentry kind="lib" path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta2/server/default/deployers/ejb3.deployer/jboss-ejb3.jar" sourcepath="/home/tdiesler/svn/jbossas/trunk/ejb3/src/main"/>
- <classpathentry kind="lib" path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta2/server/default/deployers/ejb3.deployer/jboss-ejb3x.jar"/>
- <classpathentry kind="lib" path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta2/server/default/deployers/jboss-aop-jboss5.deployer/jboss-aspect-library-jdk50.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/jbosssx-client.jar" sourcepath="/build/thirdparty/jbosssx-src.zip"/>
<classpathentry kind="output" path="output-eclipse"/>
</classpath>
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java 2007-01-16 04:10:04 UTC (rev 1977)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java 2007-01-16 07:52:19 UTC (rev 1978)
@@ -36,7 +36,6 @@
import javax.xml.ws.BindingProvider;
import javax.xml.ws.Endpoint;
import javax.xml.ws.EndpointReference;
-import javax.xml.ws.WebServiceException;
import javax.xml.ws.WebServicePermission;
import org.jboss.logging.Logger;
@@ -44,6 +43,8 @@
import org.jboss.ws.core.jaxws.binding.BindingProviderImpl;
import org.jboss.ws.core.server.HttpContext;
import org.jboss.ws.core.server.HttpServer;
+import org.jboss.ws.core.server.ServiceEndpointManager;
+import org.jboss.ws.core.server.ServiceEndpointManagerFactory;
import org.w3c.dom.Element;
/**
@@ -61,6 +62,8 @@
private static final WebServicePermission ENDPOINT_PUBLISH_PERMISSION = new WebServicePermission("publishEndpoint");
private Object implementor;
+ private Executor executor;
+ private List<Source> metadata;
private BindingProvider bindingProvider;
private Map<String, Object> properties = new HashMap<String, Object>();
private HttpContext serverContext;
@@ -145,6 +148,23 @@
// Check with the security manger
checkPublishEndpointPermission();
+ // Check if we are standalone
+ boolean isStandalone;
+ try
+ {
+ ServiceEndpointManagerFactory factory = ServiceEndpointManagerFactory.getInstance();
+ factory.getServiceEndpointManager();
+ isStandalone = false;
+ }
+ catch (Exception ex)
+ {
+ // ignore, there should be no ServiceEndpointManager in VM
+ isStandalone = true;
+ }
+
+ if (isStandalone == false)
+ throw new IllegalStateException("Cannot publish endpoint from within server");
+
if (context instanceof HttpContext)
{
serverContext = (HttpContext)context;
@@ -188,25 +208,27 @@
@Override
public List<Source> getMetadata()
{
- throw new NotImplementedException();
+ return metadata;
}
@Override
public void setMetadata(List<Source> list)
{
- throw new NotImplementedException();
+ log.info("Ignore metadata, not implemented");
+ this.metadata = list;
}
@Override
public Executor getExecutor()
{
- throw new NotImplementedException();
+ return executor;
}
@Override
public void setExecutor(Executor executor)
{
- throw new NotImplementedException();
+ log.info("Ignore executor, not implemented");
+ this.executor = executor;
}
@Override
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2007-01-16 04:10:04 UTC (rev 1977)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/ServiceDelegateImpl.java 2007-01-16 07:52:19 UTC (rev 1978)
@@ -23,39 +23,43 @@
// $Id$
+import java.lang.reflect.Proxy;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import javax.jws.WebService;
+import javax.xml.bind.JAXBContext;
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.EndpointReference;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.Service.Mode;
+import javax.xml.ws.handler.HandlerResolver;
+import javax.xml.ws.spi.ServiceDelegate;
+
import org.jboss.logging.Logger;
import org.jboss.util.NotImplementedException;
import org.jboss.ws.Constants;
+import org.jboss.ws.core.jaxws.StubExt;
import org.jboss.ws.core.jaxws.client.ClientImpl;
import org.jboss.ws.core.jaxws.client.ClientProxy;
import org.jboss.ws.core.jaxws.client.DispatchImpl;
import org.jboss.ws.core.jaxws.handler.HandlerResolverImpl;
-import org.jboss.ws.core.jaxws.StubExt;
-import org.jboss.ws.metadata.builder.jaxws.JAXWSClientEndpointMetaDataBuilder;
import org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder;
import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-import org.jboss.ws.metadata.umdm.ServiceMetaData;
-import javax.jws.WebService;
-import javax.xml.bind.JAXBContext;
-import javax.xml.namespace.QName;
-import javax.xml.ws.*;
-import javax.xml.ws.Service.Mode;
-import javax.xml.ws.handler.HandlerResolver;
-import javax.xml.ws.spi.ServiceDelegate;
-import java.lang.reflect.Proxy;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.concurrent.Executor;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
/**
* Service delegates are used internally by Service objects to allow pluggability of JAX-WS implementations.
*
@@ -89,8 +93,7 @@
{
JAXWSClientMetaDataBuilder builder = new JAXWSClientMetaDataBuilder();
- ClassLoader ctxClassLoader = Thread.currentThread().getContextClassLoader();
- serviceMetaData = builder.buildMetaData(serviceName, wsdlURL, ctxClassLoader);
+ serviceMetaData = builder.buildMetaData(serviceName, wsdlURL);
for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
{
@@ -179,7 +182,7 @@
// Adjust the endpoint meta data according to the annotations
if (annotatedPorts.contains(portName) == false)
{
- JAXWSClientEndpointMetaDataBuilder metaDataBuilder = new JAXWSClientEndpointMetaDataBuilder();
+ JAXWSClientMetaDataBuilder metaDataBuilder = new JAXWSClientMetaDataBuilder();
metaDataBuilder.rebuildEndpointMetaData(epMetaData, seiClass);
}
Deleted: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java 2007-01-16 04:10:04 UTC (rev 1977)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientEndpointMetaDataBuilder.java 2007-01-16 07:52:19 UTC (rev 1978)
@@ -1,82 +0,0 @@
-/*
-* 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.
-*/
-// $Id$
-package org.jboss.ws.metadata.builder.jaxws;
-
-import javax.jws.HandlerChain;
-import javax.jws.soap.SOAPBinding;
-import javax.xml.ws.BindingType;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.config.jaxws.ClientConfigJAXWS;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
-
-/**
- * A client side meta data builder that is based on JSR-181 annotations
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 9-Aug-2006
- */
-public class JAXWSClientEndpointMetaDataBuilder extends JAXWSWebServiceMetaDataBuilder
-{
- // provide logging
- private final Logger log = Logger.getLogger(JAXWSClientEndpointMetaDataBuilder.class);
-
- public void rebuildEndpointMetaData(EndpointMetaData epMetaData, Class<?> wsClass)
- {
- log.debug("START: rebuildMetaData");
-
- // Clear the java types, etc.
- resetMetaDataBuilder(epMetaData.getClassLoader());
-
- // Nuke parameterStyle
- epMetaData.setParameterStyle(null);
-
- // Process an optional @BindingType annotation
- if (wsClass.isAnnotationPresent(BindingType.class))
- processBindingType(epMetaData, wsClass);
-
- // Process @SOAPBinding
- if (wsClass.isAnnotationPresent(SOAPBinding.class))
- processSOAPBinding(epMetaData, wsClass);
-
- // process config, this will as well setup the handler
- epMetaData.configure(epMetaData);
-
- // Process an optional @HandlerChain annotation
- if (wsClass.isAnnotationPresent(HandlerChain.class))
- processHandlerChain(epMetaData, wsClass);
-
- // Process @WebMethod
- processWebMethods(epMetaData, wsClass);
-
- // Initialize types
- createJAXBContext(epMetaData);
- populateXmlTypes(epMetaData);
-
- // Eager initialization
- epMetaData.eagerInitialize();
-
- log.debug("END: rebuildMetaData\n" + epMetaData.getServiceMetaData());
- }
-}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2007-01-16 04:10:04 UTC (rev 1977)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2007-01-16 07:52:19 UTC (rev 1978)
@@ -26,9 +26,11 @@
import java.io.IOException;
import java.net.URL;
+import javax.jws.HandlerChain;
+import javax.jws.soap.SOAPBinding;
import javax.xml.namespace.QName;
+import javax.xml.ws.BindingType;
-import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.core.jaxrpc.Style;
@@ -57,12 +59,9 @@
*/
public class JAXWSClientMetaDataBuilder extends JAXWSMetaDataBuilder
{
- // provide logging
- private final Logger log = Logger.getLogger(JAXWSClientMetaDataBuilder.class);
-
/** Build from WSDL and jaxrpc-mapping.xml
*/
- public ServiceMetaData buildMetaData(QName serviceName, URL wsdlURL, ClassLoader loader)
+ public ServiceMetaData buildMetaData(QName serviceName, URL wsdlURL)
{
if (wsdlURL == null)
throw new IllegalArgumentException("Invalid wsdlURL: " + wsdlURL);
@@ -170,4 +169,42 @@
opMetaData.setSOAPAction(wsdlBindingOperation.getSOAPAction());
}
}
+
+ public void rebuildEndpointMetaData(EndpointMetaData epMetaData, Class<?> wsClass)
+ {
+ log.debug("START: rebuildMetaData");
+
+ // Clear the java types, etc.
+ resetMetaDataBuilder(epMetaData.getClassLoader());
+
+ // Nuke parameterStyle
+ epMetaData.setParameterStyle(null);
+
+ // Process an optional @BindingType annotation
+ if (wsClass.isAnnotationPresent(BindingType.class))
+ processBindingType(epMetaData, wsClass);
+
+ // Process @SOAPBinding
+ if (wsClass.isAnnotationPresent(SOAPBinding.class))
+ processSOAPBinding(epMetaData, wsClass);
+
+ // process config, this will as well setup the handler
+ epMetaData.configure(epMetaData);
+
+ // Process an optional @HandlerChain annotation
+ if (wsClass.isAnnotationPresent(HandlerChain.class))
+ processHandlerChain(epMetaData, wsClass);
+
+ // Process @WebMethod
+ processWebMethods(epMetaData, wsClass);
+
+ // Initialize types
+ createJAXBContext(epMetaData);
+ populateXmlTypes(epMetaData);
+
+ // Eager initialization
+ epMetaData.eagerInitialize();
+
+ log.debug("END: rebuildMetaData\n" + epMetaData.getServiceMetaData());
+ }
}
Deleted: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java 2007-01-16 04:10:04 UTC (rev 1977)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java 2007-01-16 07:52:19 UTC (rev 1978)
@@ -1,150 +0,0 @@
-/*
-* 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.ws.metadata.builder.jaxws;
-
-import java.io.IOException;
-
-import javax.xml.ws.BindingType;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.annotation.PortComponent;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-
-/**
- * Builds ServiceEndpointMetaData for a JAX-WS endpoint.
- *
- * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
- */
-public abstract class JAXWSEndpointMetaDataBuilder extends JAXWSMetaDataBuilder
-{
- // provide logging
- private final Logger log = Logger.getLogger(JAXWSEndpointMetaDataBuilder.class);
-
- public abstract ServerEndpointMetaData buildEndpointMetaData(UnifiedMetaData wsMetaData, UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName) throws IOException;
-
- protected void processBindingType(EndpointMetaData epMetaData, Class<?> wsClass)
- {
- if (! wsClass.isAnnotationPresent(BindingType.class))
- return;
-
- BindingType anBindingType = (BindingType)wsClass.getAnnotation(BindingType.class);
- String uri = anBindingType.value();
- if (uri.length() > 0)
- {
- epMetaData.setBindingId(uri);
- }
- }
-
- protected void processPortComponent(UnifiedDeploymentInfo udi, Class<?> wsClass, String linkName, ServerEndpointMetaData sepMetaData)
- {
- PortComponent anPortComponent = wsClass.getAnnotation(PortComponent.class);
- if (anPortComponent == null)
- return;
-
- // setup config name
- if (anPortComponent.configName().length() > 0)
- {
- String configName = anPortComponent.configName();
- sepMetaData.setConfigName(configName);
- }
-
- // setup config file
- if (anPortComponent.configFile().length() > 0)
- {
- String configFile = anPortComponent.configFile();
- sepMetaData.setConfigFile(configFile);
- }
-
- boolean isJSEEndpoint = (udi.type == DeploymentType.JAXWS_JSE);
-
- // context-root
- if (anPortComponent.contextRoot().length() > 0)
- {
- if (isJSEEndpoint)
- log.warn("@PortComponent.contextRoot is only valid on EJB endpoints");
-
- if (isJSEEndpoint == false)
- {
- String contextRoot = anPortComponent.contextRoot();
- if (contextRoot.startsWith("/") == false)
- contextRoot = "/" + contextRoot;
-
- sepMetaData.setContextRoot(contextRoot);
- }
- }
-
- // url-pattern
- if (anPortComponent.urlPattern().length() > 0)
- {
- if (isJSEEndpoint)
- log.warn("@PortComponent.urlPattern is only valid on EJB endpoints");
-
- if (isJSEEndpoint == false)
- {
- String urlPattern = anPortComponent.urlPattern();
- sepMetaData.setURLPattern(urlPattern);
- }
- }
-
- // auth-method
- if (anPortComponent.authMethod().length() > 0)
- {
- if (isJSEEndpoint)
- log.warn("@PortComponent.authMethod is only valid on EJB endpoints");
-
- if (isJSEEndpoint == false)
- {
- String authMethod = anPortComponent.authMethod();
- sepMetaData.setAuthMethod(authMethod);
- }
- }
-
- // transport-guarantee
- if (anPortComponent.transportGuarantee().length() > 0)
- {
- if (isJSEEndpoint)
- log.warn("@PortComponent.transportGuarantee is only valid on EJB endpoints");
-
- if (isJSEEndpoint == false)
- {
- String transportGuarantee = anPortComponent.transportGuarantee();
- sepMetaData.setTransportGuarantee(transportGuarantee);
- }
- }
-
- // secure wsdl access
- sepMetaData.setSecureWSDLAccess(anPortComponent.secureWSDLAccess());
-
- // virtual hosts
- String[] virtualHosts = anPortComponent.virtualHosts();
- if (virtualHosts != null & virtualHosts.length > 0)
- {
- sepMetaData.setVirtualHosts(virtualHosts);
- }
-
- }
-}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2007-01-16 04:10:04 UTC (rev 1977)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilder.java 2007-01-16 07:52:19 UTC (rev 1978)
@@ -21,14 +21,838 @@
*/
package org.jboss.ws.metadata.builder.jaxws;
+// $Id$
+
+import java.io.File;
+import java.io.InputStream;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.rmi.RemoteException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import javax.jws.HandlerChain;
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPMessageHandlers;
+import javax.jws.soap.SOAPBinding.ParameterStyle;
+import javax.xml.bind.JAXBException;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.ParameterMode;
+import javax.xml.ws.BindingType;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+import javax.xml.ws.WebFault;
+import javax.xml.ws.addressing.AddressingProperties;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.Constants;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.jaxrpc.Use;
+import org.jboss.ws.core.jaxws.DynamicWrapperGenerator;
+import org.jboss.ws.core.jaxws.WrapperGenerator;
+import org.jboss.ws.core.utils.HolderUtils;
+import org.jboss.ws.core.utils.JBossWSEntityResolver;
+import org.jboss.ws.core.utils.JavaUtils;
+import org.jboss.ws.extensions.addressing.AddressingPropertiesImpl;
+import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
+import org.jboss.ws.metadata.acessor.JAXBAccessor;
import org.jboss.ws.metadata.builder.MetaDataBuilder;
+import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
+import org.jboss.ws.metadata.jsr181.HandlerChainFactory;
+import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
+import org.jboss.ws.metadata.jsr181.HandlerChainsMetaData;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.FaultMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.ws.metadata.umdm.TypeMappingMetaData;
+import org.jboss.ws.metadata.umdm.TypesMetaData;
+import org.jboss.ws.metadata.umdm.WrappedParameter;
+import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import com.sun.xml.bind.api.JAXBRIContext;
+import com.sun.xml.bind.api.TypeReference;
+
/**
* Abstract class that represents a JAX-WS metadata builder.
*
* @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
- * @version $Revision$
+ * @author Thomas.Diesler(a)jboss.com
*/
+@SuppressWarnings("deprecation")
public class JAXWSMetaDataBuilder extends MetaDataBuilder
{
+
+ protected static final Logger log = Logger.getLogger(JAXWSWebServiceMetaDataBuilder.class);
+ protected List<Class> javaTypes = new ArrayList<Class>();
+ protected JAXBRIContext jaxbCtx;
+ protected List<TypeReference> typeRefs = new ArrayList<TypeReference>();
+ protected WrapperGenerator wrapperGenerator;
+
+ protected void processBindingType(EndpointMetaData epMetaData, Class<?> wsClass)
+ {
+ if (! wsClass.isAnnotationPresent(BindingType.class))
+ return;
+
+ BindingType anBindingType = (BindingType)wsClass.getAnnotation(BindingType.class);
+ String uri = anBindingType.value();
+ if (uri.length() > 0)
+ {
+ epMetaData.setBindingId(uri);
+ }
+ }
+
+ protected void processSOAPBinding(EndpointMetaData epMetaData, Class<?> wsClass)
+ {
+
+ if (!wsClass.isAnnotationPresent(SOAPBinding.class))
+ return;
+
+ SOAPBinding anSoapBinding = wsClass.getAnnotation(SOAPBinding.class);
+
+ SOAPBinding.Style attrStyle = anSoapBinding.style();
+ Style style = (attrStyle == SOAPBinding.Style.RPC ? Style.RPC : Style.DOCUMENT);
+ epMetaData.setStyle(style);
+
+ SOAPBinding.Use attrUse = anSoapBinding.use();
+ if (attrUse == SOAPBinding.Use.ENCODED)
+ throw new WSException("SOAP encoding is not supported for JSR-181 deployments");
+
+ epMetaData.setEncodingStyle(Use.LITERAL);
+
+ ParameterStyle paramStyle = anSoapBinding.parameterStyle();
+ epMetaData.setParameterStyle(paramStyle);
+ }
+
+ /**
+ * Process an optional @HandlerChain annotation
+ *
+ * Location of the handler chain file. The location supports 2 formats.
+ *
+ * 1. An absolute java.net.URL in externalForm.
+ * (ex: http://myhandlers.foo.com/handlerfile1.xml)
+ *
+ * 2. A relative path from the source file or class file.
+ * (ex: bar/handlerfile1.xml)
+ */
+ protected void processHandlerChain(EndpointMetaData epMetaData, Class<?> wsClass)
+ {
+ if (wsClass.isAnnotationPresent(SOAPMessageHandlers.class))
+ throw new WSException("Cannot combine @HandlerChain with @SOAPMessageHandlers");
+
+ HandlerChain anHandlerChain = wsClass.getAnnotation(HandlerChain.class);
+
+ URL fileURL = null;
+ String filename = anHandlerChain.file();
+
+ // Try the filename as URL
+ try
+ {
+ fileURL = new URL(filename);
+ }
+ catch (MalformedURLException ex)
+ {
+ // ignore
+ }
+
+ // Try the filename as File
+ if (fileURL == null)
+ {
+ try
+ {
+ File file = new File(filename);
+ if (file.exists())
+ fileURL = file.toURL();
+ }
+ catch (MalformedURLException e)
+ {
+ // ignore
+ }
+ }
+
+ // Try the filename as Resource
+ if (fileURL == null)
+ {
+ fileURL = epMetaData.getClassLoader().getResource(filename);
+ }
+
+ // Try the filename relative to class
+ if (fileURL == null)
+ {
+ String packagePath = wsClass.getPackage().getName().replace('.', '/');
+ fileURL = epMetaData.getClassLoader().getResource(packagePath + "/" + filename);
+ }
+
+ if (fileURL == null)
+ throw new WSException("Cannot resolve handler file '" + filename + "' on " + wsClass.getName());
+
+ try
+ {
+ HandlerChainsMetaData handlerChainsMetaData = null;
+ InputStream is = fileURL.openStream();
+ try
+ {
+ Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ unmarshaller.setValidation(true);
+ unmarshaller.setSchemaValidation(true);
+ unmarshaller.setEntityResolver(new JBossWSEntityResolver());
+ ObjectModelFactory factory = new HandlerChainFactory();
+ handlerChainsMetaData = (HandlerChainsMetaData)unmarshaller.unmarshal(is, factory, null);
+ }
+ finally
+ {
+ is.close();
+ }
+
+ // Setup the endpoint handlers
+ for (HandlerChainMetaData handlerChainMetaData : handlerChainsMetaData.getHandlerChains())
+ {
+ for (UnifiedHandlerMetaData uhmd : handlerChainMetaData.getHandlers())
+ {
+ epMetaData.addHandler(uhmd.getHandlerMetaDataJAXWS(epMetaData, HandlerType.ENDPOINT));
+ }
+ }
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ catch (Exception ex)
+ {
+ throw new WSException("Cannot process handler chain: " + filename, ex);
+ }
+ }
+
+ private void addFault(OperationMetaData omd, Class<?> exception)
+ {
+ if (omd.isOneWay())
+ throw new IllegalStateException("JSR-181 4.3.1 - A JSR-181 processor is REQUIRED to report an error if an operation marked "
+ + "@Oneway has a return value, declares any checked exceptions or has any INOUT or OUT parameters.");
+
+ WebFault annotation = exception.getAnnotation(WebFault.class);
+
+ String name;
+ String namespace;
+ String faultBeanName = null;
+
+ // Only the element name is effected by @WebFault, the type uses the same convention
+ QName xmlType = new QName(omd.getQName().getNamespaceURI(), exception.getSimpleName());
+
+ /*
+ * If @WebFault is present, and the exception contains getFaultInfo, the
+ * return value should be used. Otherwise we need to generate the bean.
+ */
+ boolean generate = true;
+ if (annotation != null)
+ {
+ name = annotation.name();
+ namespace = annotation.targetNamespace();
+ if (namespace.length() == 0)
+ namespace = omd.getQName().getNamespaceURI();
+
+ Class<?> faultBean = getFaultInfo(exception);
+ if (faultBean != null)
+ {
+ generate = false;
+ faultBeanName = faultBean.getName();
+ }
+ }
+ else
+ {
+ name = xmlType.getLocalPart();
+ namespace = xmlType.getNamespaceURI();
+ }
+
+ if (faultBeanName == null)
+ faultBeanName = JavaUtils.getPackageName(omd.getEndpointMetaData().getServiceEndpointInterface()) + ".jaxws." + exception.getSimpleName() + "Bean";
+
+ QName xmlName = new QName(namespace, name);
+
+ FaultMetaData fmd = new FaultMetaData(omd, xmlName, xmlType, exception.getName());
+ fmd.setFaultBeanName(faultBeanName);
+
+ if (generate)
+ wrapperGenerator.generate(fmd);
+
+ javaTypes.add(fmd.getFaultBean());
+ typeRefs.add(new TypeReference(fmd.getXmlName(), fmd.getFaultBean()));
+
+ omd.addFault(fmd);
+ }
+
+ private String convertToVariable(String localName)
+ {
+ return JAXBRIContext.mangleNameToVariableName(localName);
+ }
+
+ private String[] convertTypeArguments(Class rawType, Type type)
+ {
+ if (!Collection.class.isAssignableFrom(rawType) && !Map.class.isAssignableFrom(rawType))
+ return null;
+
+ if (!(type instanceof ParameterizedType))
+ return null;
+
+ ParameterizedType paramType = (ParameterizedType)type;
+ Type[] arguments = paramType.getActualTypeArguments();
+ String[] ret = new String[arguments.length];
+ for (int i = 0; i < arguments.length; i++)
+ ret[i] = JavaUtils.erasure(arguments[i]).getName();
+
+ return ret;
+ }
+
+ private ParameterMetaData createRequestWrapper(OperationMetaData operation, Method method)
+ {
+ String requestWrapperType = null;
+ QName xmlName = operation.getQName();
+ QName xmlType = xmlName;
+ if (method.isAnnotationPresent(RequestWrapper.class))
+ {
+ RequestWrapper anReqWrapper = method.getAnnotation(RequestWrapper.class);
+
+ String localName = anReqWrapper.localName().length() > 0 ? anReqWrapper.localName() : xmlName.getLocalPart();
+ String targetNamespace = anReqWrapper.targetNamespace().length() > 0 ? anReqWrapper.targetNamespace() : xmlName.getNamespaceURI();
+ xmlName = new QName(targetNamespace, localName);
+
+ if (anReqWrapper.className().length() > 0)
+ requestWrapperType = anReqWrapper.className();
+ }
+
+ // Conformance 3.18, the default value must be the same as the method name
+ if (requestWrapperType == null)
+ {
+ String packageName = JavaUtils.getPackageName(method.getDeclaringClass()) + ".jaxws";
+ requestWrapperType = packageName + "." + JavaUtils.capitalize(method.getName());
+ }
+
+ // JAX-WS p.37 pg.1, the annotation only affects the element name, not the type name
+ ParameterMetaData wrapperParameter = new ParameterMetaData(operation, xmlName, xmlType, requestWrapperType);
+ wrapperParameter.setAccessorFactoryCreator(JAXBAccessor.FACTORY_CREATOR);
+ operation.addParameter(wrapperParameter);
+
+ return wrapperParameter;
+ }
+
+ private ParameterMetaData createResponseWrapper(OperationMetaData operation, Method method)
+ {
+ QName operationQName = operation.getQName();
+ QName xmlName = new QName(operationQName.getNamespaceURI(), operationQName.getLocalPart() + "Response");
+ QName xmlType = xmlName;
+
+ String responseWrapperType = null;
+ if (method.isAnnotationPresent(ResponseWrapper.class))
+ {
+ ResponseWrapper anResWrapper = method.getAnnotation(ResponseWrapper.class);
+
+ String localName = anResWrapper.localName().length() > 0 ? anResWrapper.localName() : xmlName.getLocalPart();
+ String targetNamespace = anResWrapper.targetNamespace().length() > 0 ? anResWrapper.targetNamespace() : xmlName.getNamespaceURI();
+ xmlName = new QName(targetNamespace, localName);
+
+ if (anResWrapper.className().length() > 0)
+ responseWrapperType = anResWrapper.className();
+ }
+
+ if (responseWrapperType == null)
+ {
+ String packageName = JavaUtils.getPackageName(method.getDeclaringClass()) + ".jaxws";
+ responseWrapperType = packageName + "." + JavaUtils.capitalize(method.getName()) + "Response";
+ }
+
+ ParameterMetaData retMetaData = new ParameterMetaData(operation, xmlName, xmlType, responseWrapperType);
+ retMetaData.setAccessorFactoryCreator(JAXBAccessor.FACTORY_CREATOR);
+ operation.setReturnParameter(retMetaData);
+
+ return retMetaData;
+ }
+
+ private Class<?> getFaultInfo(Class<?> exception)
+ {
+ try
+ {
+ Method method = exception.getMethod("getFaultInfo");
+ Class<?> returnType = method.getReturnType();
+ if (returnType == void.class)
+ return null;
+
+ return returnType;
+ }
+ catch (SecurityException e)
+ {
+ throw new WSException("Unexpected security exception: " + e.getMessage(), e);
+ }
+ catch (NoSuchMethodException e)
+ {
+ return null;
+ }
+ }
+
+ private ParameterMode getParameterMode(WebParam anWebParam, Class javaType)
+ {
+ if (anWebParam != null)
+ {
+ if (anWebParam.mode() == WebParam.Mode.INOUT)
+ return ParameterMode.INOUT;
+ if (anWebParam.mode() == WebParam.Mode.OUT)
+ return ParameterMode.OUT;
+ }
+
+ return HolderUtils.isHolderType(javaType) ? ParameterMode.INOUT : ParameterMode.IN;
+ }
+
+ private WebParam getWebParamAnnotation(Method method, int pos)
+ {
+ for (Annotation annotation : method.getParameterAnnotations()[pos])
+ if (annotation instanceof WebParam)
+ return (WebParam)annotation;
+
+ return null;
+ }
+
+ private QName getWebParamName(OperationMetaData opMetaData, int index, WebParam webParam)
+ {
+ String namespace = null;
+ String name = null;
+ boolean header = false;
+
+ if (webParam != null)
+ {
+ if (webParam.targetNamespace().length() > 0)
+ namespace = webParam.targetNamespace();
+
+ // RPC types use the partName for their XML name
+ if (webParam.partName().length() > 0 && opMetaData.isRPCLiteral())
+ name = webParam.partName();
+ else if (webParam.name().length() > 0)
+ name = webParam.name();
+
+ header = webParam.header();
+ }
+
+ // Bare and headers must be qualified
+ if (namespace == null && (opMetaData.isDocumentBare() || header))
+ namespace = opMetaData.getQName().getNamespaceURI();
+
+ // RPC body parts must have no namespace
+ else if (opMetaData.isRPCLiteral() && !header)
+ namespace = null;
+
+ // Bare uses the operation name as the default, everything else is generated
+ if (name == null)
+ name = opMetaData.isDocumentBare() && !header ? opMetaData.getQName().getLocalPart() : "arg" + index;
+
+ return (namespace != null) ? new QName(namespace, name) : new QName(name);
+ }
+
+ private QName getWebResultName(OperationMetaData opMetaData, WebResult anWebResult)
+ {
+ String name = null;
+ String namespace = null;
+ boolean header = false;
+
+ if (anWebResult != null)
+ {
+ if (anWebResult.targetNamespace().length() > 0)
+ namespace = anWebResult.targetNamespace();
+
+ // RPC types use the partName for their XML name
+ if (anWebResult.partName().length() > 0 && opMetaData.isRPCLiteral())
+ name = anWebResult.partName();
+ else if (anWebResult.name().length() > 0)
+ name = anWebResult.name();
+
+ header = anWebResult.header();
+ }
+
+ // Bare and headers must be qualified
+ if (namespace == null && (opMetaData.isDocumentBare() || header))
+ namespace = opMetaData.getQName().getNamespaceURI();
+
+ // RPC body parts must have no namespace
+ else if (opMetaData.isRPCLiteral() && !header)
+ namespace = null;
+
+ // Bare uses the operation name as the default, everything else is generated
+ if (name == null)
+ name = opMetaData.isDocumentBare() && !header ? opMetaData.getResponseName().getLocalPart() : "return";
+
+ return (namespace != null) ? new QName(namespace, name) : new QName(name);
+ }
+
+ /**
+ * Process operation meta data extensions.
+ */
+ private void processMetaExtensions(EndpointMetaData epMetaData, OperationMetaData opMetaData)
+ {
+ // Until there is a addressing annotion we fallback to implicit action association
+ // TODO: figure out a way to assign message name instead of IN and OUT
+ String tns = epMetaData.getQName().getNamespaceURI();
+ String portTypeName = epMetaData.getQName().getLocalPart();
+
+ AddressingProperties ADDR = new AddressingPropertiesImpl();
+ AddressingOpMetaExt addrExt = new AddressingOpMetaExt(ADDR.getNamespaceURI());
+ addrExt.setInboundAction(tns + "/" + portTypeName + "/IN");
+
+ if (!opMetaData.isOneWay())
+ addrExt.setOutboundAction(tns + "/" + portTypeName + "/OUT");
+
+ opMetaData.addExtension(addrExt);
+ }
+
+ private void processWebMethod(EndpointMetaData epMetaData, Method method)
+ {
+ String javaName = method.getName();
+
+ // skip asnyc methods, they dont need meta data representation
+ if (method.getName().endsWith(Constants.ASYNC_METHOD_SUFFIX))
+ return;
+
+ // reflection defaults
+ String soapAction = "";
+ String operationName = method.getName();
+
+ // annotation values that override defaults
+ if (method.isAnnotationPresent(WebMethod.class))
+ {
+ WebMethod anWebMethod = method.getAnnotation(WebMethod.class);
+ soapAction = anWebMethod.action();
+ if (anWebMethod.operationName().length() > 0)
+ {
+ operationName = anWebMethod.operationName();
+ }
+ }
+
+ String targetNS = epMetaData.getInterfaceQName().getNamespaceURI();
+ OperationMetaData opMetaData = new OperationMetaData(epMetaData, new QName(targetNS, operationName), javaName);
+ opMetaData.setOneWay(method.isAnnotationPresent(Oneway.class));
+ opMetaData.setSOAPAction(soapAction);
+
+ if (method.isAnnotationPresent(SOAPBinding.class))
+ {
+ SOAPBinding anBinding = method.getAnnotation(SOAPBinding.class);
+ if (anBinding.style() != SOAPBinding.Style.DOCUMENT || epMetaData.getStyle() != Style.DOCUMENT)
+ throw new IllegalArgumentException("@SOAPBinding must be specified using DOCUMENT style when placed on a method");
+ opMetaData.setParameterStyle(anBinding.parameterStyle());
+ }
+
+ epMetaData.addOperation(opMetaData);
+
+ // Build parameter meta data
+ Class[] parameterTypes = method.getParameterTypes();
+ Type[] genericTypes = method.getGenericParameterTypes();
+ Annotation[][] parameterAnnotations = method.getParameterAnnotations();
+ ParameterMetaData wrapperParameter = null, wrapperOutputParameter = null;
+ List<WrappedParameter> wrappedParameters = null, wrappedOutputParameters = null;
+
+ // Force paramter style to wrapped
+ if (method.isAnnotationPresent(RequestWrapper.class) || method.isAnnotationPresent(ResponseWrapper.class))
+ {
+ epMetaData.setParameterStyle(ParameterStyle.WRAPPED);
+ }
+
+ if (opMetaData.isDocumentWrapped())
+ {
+ wrapperParameter = createRequestWrapper(opMetaData, method);
+ wrappedParameters = new ArrayList<WrappedParameter>(parameterTypes.length);
+ wrapperParameter.setWrappedParameters(wrappedParameters);
+
+ if (!opMetaData.isOneWay())
+ {
+ wrapperOutputParameter = createResponseWrapper(opMetaData, method);
+ wrappedOutputParameters = new ArrayList<WrappedParameter>(parameterTypes.length + 1);
+ wrapperOutputParameter.setWrappedParameters(wrappedOutputParameters);
+ }
+ }
+
+ for (int i = 0; i < parameterTypes.length; i++)
+ {
+ Class javaType = parameterTypes[i];
+ Type genericType = genericTypes[i];
+ String javaTypeName = javaType.getName();
+ WebParam anWebParam = getWebParamAnnotation(method, i);
+ boolean isHeader = anWebParam != null && anWebParam.header();
+ boolean isWrapped = opMetaData.isDocumentWrapped() && !isHeader;
+ ParameterMode mode = getParameterMode(anWebParam, javaType);
+
+ // Assert one-way
+ if (opMetaData.isOneWay() && mode != ParameterMode.IN)
+ throw new IllegalArgumentException("A one-way operation can not have output parameters [" + "method = " + method.getName() + ", parameter = " + i + "]");
+
+ if (HolderUtils.isHolderType(javaType))
+ {
+ genericType = HolderUtils.getGenericValueType(genericType);
+ javaType = JavaUtils.erasure(genericType);
+ javaTypeName = javaType.getName();
+ }
+
+ if (isWrapped)
+ {
+ QName wrappedElementName = getWebParamName(opMetaData, i, anWebParam);
+ String variable = convertToVariable(wrappedElementName.getLocalPart());
+
+ WrappedParameter wrappedParameter = new WrappedParameter(wrappedElementName, javaTypeName, variable, i);
+ wrappedParameter.setTypeArguments(convertTypeArguments(javaType, genericType));
+
+ if (mode != ParameterMode.OUT)
+ wrappedParameters.add(wrappedParameter);
+ if (mode != ParameterMode.IN)
+ {
+ wrappedOutputParameters.add(wrappedParameter);
+ wrappedParameter.setHolder(true);
+ }
+ }
+ else
+ {
+ QName xmlName = getWebParamName(opMetaData, i, anWebParam);
+
+ ParameterMetaData paramMetaData = new ParameterMetaData(opMetaData, xmlName, javaTypeName);
+ paramMetaData.setInHeader(isHeader);
+ paramMetaData.setIndex(i);
+ paramMetaData.setMode(mode);
+
+ /*
+ * Note: The TCK enforces the following rule in the spec regarding
+ * partName: "This is only used if the operation is rpc style or if
+ * the operation is document style and the parameter style is BARE."
+ *
+ * This seems to be a flaw in the spec, because the intention is
+ * obviously to prevent the ambiguity of wrapped parameters that
+ * specify different partName values. There is, however, no reason
+ * that this limitation should apply to header parameters since they
+ * are never wrapped. In order to comply we adhere to this confusing
+ * rule, although I will ask for clarification.
+ */
+ if (anWebParam != null && !opMetaData.isDocumentWrapped() && anWebParam.partName().length() > 0)
+ paramMetaData.setPartName(anWebParam.partName());
+
+ opMetaData.addParameter(paramMetaData);
+ javaTypes.add(javaType);
+ typeRefs.add(new TypeReference(xmlName, genericType, parameterAnnotations[i]));
+ }
+ }
+
+ // Build result meta data
+ Class returnType = method.getReturnType();
+ Type genericReturnType = method.getGenericReturnType();
+ String returnTypeName = returnType.getName();
+ if (!(returnType == void.class))
+ {
+ if (opMetaData.isOneWay())
+ throw new IllegalArgumentException("[JSR-181 2.5.1] The method '" + method.getName() + "' can not have a return value if it is marked OneWay");
+
+ WebResult anWebResult = method.getAnnotation(WebResult.class);
+ boolean isHeader = anWebResult != null && anWebResult.header();
+ boolean isWrappedBody = opMetaData.isDocumentWrapped() && !isHeader;
+ QName xmlName = getWebResultName(opMetaData, anWebResult);
+
+ if (isWrappedBody)
+ {
+ WrappedParameter wrapped = new WrappedParameter(xmlName, returnTypeName, convertToVariable(xmlName.getLocalPart()), -1);
+ wrapped.setTypeArguments(convertTypeArguments(returnType, genericReturnType));
+
+ // insert at the beginning just for prettiness
+ wrappedOutputParameters.add(0, wrapped);
+ }
+ else
+ {
+ ParameterMetaData retMetaData = new ParameterMetaData(opMetaData, xmlName, returnTypeName);
+ retMetaData.setInHeader(isHeader);
+ retMetaData.setIndex(-1);
+ retMetaData.setMode(ParameterMode.OUT);
+
+ // Special case: If we have a document/literal wrapped message, then
+ // the return metadata must be the wrapper type that is sent in the
+ // body. So, in order to handle headers that are mapped to the java
+ // return value, we have to add them to a parameter with an index of
+ // -1 to signify the return value. All other binding styles use the
+ // expected return value mechanism.
+ if (opMetaData.isDocumentWrapped())
+ {
+ opMetaData.addParameter(retMetaData);
+ }
+ else
+ {
+ // See above comment in the parameter for loop section as to why
+ // we prevent customization of part names on document wrapped
+ // header parameters.
+ if (anWebResult != null && anWebResult.partName().length() > 0)
+ retMetaData.setPartName(anWebResult.partName());
+
+ opMetaData.setReturnParameter(retMetaData);
+ }
+
+ javaTypes.add(returnType);
+ typeRefs.add(new TypeReference(xmlName, genericReturnType, method.getAnnotations()));
+ }
+ }
+
+ // Generate wrapper beans
+ if (opMetaData.isDocumentWrapped())
+ {
+ wrapperGenerator.generate(wrapperParameter);
+ Class wrapperClass = wrapperParameter.getJavaType();
+ javaTypes.add(wrapperClass);
+ // In case there is no @XmlRootElement
+ typeRefs.add(new TypeReference(wrapperParameter.getXmlName(), wrapperClass));
+ if (!opMetaData.isOneWay())
+ {
+ wrapperGenerator.generate(wrapperOutputParameter);
+ wrapperClass = wrapperOutputParameter.getJavaType();
+ javaTypes.add(wrapperClass);
+ // In case there is no @XmlRootElement
+ typeRefs.add(new TypeReference(wrapperOutputParameter.getXmlName(), wrapperClass));
+ }
+ }
+
+ // Add faults
+ for (Class exClass : method.getExceptionTypes())
+ if (!RemoteException.class.isAssignableFrom(exClass))
+ addFault(opMetaData, exClass);
+
+ // process op meta data extension
+ processMetaExtensions(epMetaData, opMetaData);
+ }
+
+ protected void processWebMethods(EndpointMetaData epMetaData, Class wsClass)
+ {
+ epMetaData.clearOperations();
+
+ // Process @WebMethod annotations
+ int webMethodCount = 0;
+ for (Method method : wsClass.getMethods())
+ {
+ WebMethod annotation = method.getAnnotation(WebMethod.class);
+ boolean exclude = annotation != null && annotation.exclude();
+ if (!exclude && (annotation != null || wsClass.isInterface()))
+ {
+ processWebMethod(epMetaData, method);
+ webMethodCount++;
+ }
+ }
+
+ // @WebService should expose all inherited methods if @WebMethod is never specified
+ if (webMethodCount == 0 && !wsClass.isInterface())
+ {
+ for (Method method : wsClass.getMethods())
+ {
+ WebMethod annotation = method.getAnnotation(WebMethod.class);
+ boolean exclude = annotation != null && annotation.exclude();
+ if (!exclude && method.getDeclaringClass() != Object.class)
+ {
+ processWebMethod(epMetaData, method);
+ webMethodCount++;
+ }
+ }
+ }
+
+ if (webMethodCount == 0)
+ throw new WSException("No exposable methods found");
+ }
+
+ protected void resetMetaDataBuilder(ClassLoader loader)
+ {
+ wrapperGenerator = new DynamicWrapperGenerator(loader);
+ javaTypes.clear();
+ typeRefs.clear();
+ jaxbCtx = null;
+ }
+
+ protected void createJAXBContext(EndpointMetaData epMetaData)
+ {
+ try
+ {
+ String targetNS = epMetaData.getInterfaceQName().getNamespaceURI();
+ log.debug("JAXBContext [types=" + javaTypes + ",tns=" + targetNS + "]");
+ jaxbCtx = JAXBRIContext.newInstance(javaTypes.toArray(new Class[0]), typeRefs, targetNS, false);
+ }
+ catch (JAXBException ex)
+ {
+ throw new IllegalStateException("Cannot build JAXB context", ex);
+ }
+ }
+
+ private void populateXmlType(FaultMetaData faultMetaData)
+ {
+ EndpointMetaData epMetaData = faultMetaData.getOperationMetaData().getEndpointMetaData();
+ TypesMetaData types = epMetaData.getServiceMetaData().getTypesMetaData();
+
+ QName xmlType = faultMetaData.getXmlType();
+ String faultBeanName = faultMetaData.getFaultBeanName();
+
+ types.addTypeMapping(new TypeMappingMetaData(types, xmlType, faultBeanName));
+ }
+
+ private void populateXmlType(ParameterMetaData paramMetaData)
+ {
+ EndpointMetaData epMetaData = paramMetaData.getOperationMetaData().getEndpointMetaData();
+ TypesMetaData types = epMetaData.getServiceMetaData().getTypesMetaData();
+
+ QName xmlName = paramMetaData.getXmlName();
+ QName xmlType = paramMetaData.getXmlType();
+ Class javaType = paramMetaData.getJavaType();
+ String javaName = paramMetaData.getJavaTypeName();
+
+ if (xmlType == null)
+ {
+ try
+ {
+ xmlType = jaxbCtx.getTypeName(new TypeReference(xmlName, javaType));
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw new IllegalStateException("Cannot obtain xml type for: [xmlName=" + xmlName + ",javaName=" + javaName + "]");
+ }
+
+ /* Anonymous type.
+ *
+ * Currently the design of our stack is based on the
+ * notion of their always being a unique type. In order to lookup the
+ * appropriate (de)serializer you must have a type. So we use a fake
+ * name. This is an illegal NCName, so it shouldn't collide.
+ */
+ if (xmlType == null)
+ xmlType = new QName(xmlName.getNamespaceURI(), ">" + xmlName.getLocalPart());
+
+ paramMetaData.setXmlType(xmlType);
+ }
+
+ types.addTypeMapping(new TypeMappingMetaData(types, xmlType, javaName));
+ }
+
+ protected void populateXmlTypes(EndpointMetaData epMetaData)
+ {
+ for (OperationMetaData operation : epMetaData.getOperations())
+ {
+ // parameters
+ for (ParameterMetaData paramMetaData : operation.getParameters())
+ {
+ populateXmlType(paramMetaData);
+ }
+
+ // return value
+ ParameterMetaData returnParameter = operation.getReturnParameter();
+ if (returnParameter != null)
+ populateXmlType(returnParameter);
+
+ // faults
+ for (FaultMetaData faultMetaData : operation.getFaults())
+ {
+ populateXmlType(faultMetaData);
+ }
+ }
+ }
}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java 2007-01-16 04:10:04 UTC (rev 1977)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB21.java 2007-01-16 07:52:19 UTC (rev 1978)
@@ -42,7 +42,7 @@
* @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
* @since 19-May-2005
*/
-public class JAXWSMetaDataBuilderEJB21 extends JAXWSServerMetaDataBuilder
+public class JAXWSMetaDataBuilderEJB21
{
// provide logging
private final Logger log = Logger.getLogger(JAXWSMetaDataBuilderEJB21.class);
@@ -73,7 +73,7 @@
if (beanClass.isAnnotationPresent(WebService.class) || beanClass.isAnnotationPresent(WebServiceProvider.class))
{
String ejbLink = beanMetaData.getEjbName();
- setupEndpoint(wsMetaData, udi, beanClass, ejbLink);
+ JAXWSServerMetaDataBuilder.setupProviderOrWebService(wsMetaData, udi, beanClass, ejbLink);
// setup the security domain
if (beanClass.isAnnotationPresent(SecurityDomain.class))
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java 2007-01-16 04:10:04 UTC (rev 1977)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderEJB3.java 2007-01-16 07:52:19 UTC (rev 1978)
@@ -42,7 +42,7 @@
* @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
* @since 19-May-2005
*/
-public class JAXWSMetaDataBuilderEJB3 extends JAXWSServerMetaDataBuilder
+public class JAXWSMetaDataBuilderEJB3
{
// provide logging
private final Logger log = Logger.getLogger(JAXWSMetaDataBuilderEJB3.class);
@@ -74,7 +74,7 @@
if (beanClass.isAnnotationPresent(WebService.class) || beanClass.isAnnotationPresent(WebServiceProvider.class))
{
String ejbLink = beanMetaData.getEjbName();
- setupEndpoint(wsMetaData, udi, beanClass, ejbLink);
+ JAXWSServerMetaDataBuilder.setupProviderOrWebService(wsMetaData, udi, beanClass, ejbLink);
// setup the security domain
if (beanClass.isAnnotationPresent(SecurityDomain.class))
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java 2007-01-16 04:10:04 UTC (rev 1977)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSMetaDataBuilderJSE.java 2007-01-16 07:52:19 UTC (rev 1978)
@@ -37,7 +37,7 @@
* @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
* @since 23-Jul-2005
*/
-public class JAXWSMetaDataBuilderJSE extends JAXWSServerMetaDataBuilder
+public class JAXWSMetaDataBuilderJSE
{
// provide logging
private final Logger log = Logger.getLogger(JAXWSMetaDataBuilderJSE.class);
@@ -65,7 +65,7 @@
try
{
Class beanClass = udi.classLoader.loadClass(servletClassName);
- setupEndpoint(wsMetaData, udi, beanClass, servletName);
+ JAXWSServerMetaDataBuilder.setupProviderOrWebService(wsMetaData, udi, beanClass, servletName);
}
catch (ClassNotFoundException ex)
{
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java 2007-01-16 04:10:04 UTC (rev 1977)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSProviderMetaDataBuilder.java 2007-01-16 07:52:19 UTC (rev 1978)
@@ -37,7 +37,6 @@
import javax.xml.ws.WebServiceProvider;
import javax.xml.ws.Service.Mode;
-import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
@@ -58,16 +57,9 @@
* @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
* @since 23-Jul-2005
*/
-public class JAXWSProviderMetaDataBuilder extends JAXWSEndpointMetaDataBuilder
+public class JAXWSProviderMetaDataBuilder extends JAXWSServerMetaDataBuilder
{
- // provide logging
- private final Logger log = Logger.getLogger(JAXWSProviderMetaDataBuilder.class);
-
- /** Build from annotations
- */
-
- @Override
- public ServerEndpointMetaData buildEndpointMetaData(UnifiedMetaData wsMetaData, UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName) throws IOException
+ public ServerEndpointMetaData buildProviderMetaData(UnifiedMetaData wsMetaData, UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName) throws IOException
{
// 5.3 Conformance (Provider implementation): A Provider based service endpoint implementation MUST
// implement a typed Provider interface.
Deleted: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2007-01-16 04:10:04 UTC (rev 1977)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2007-01-16 07:52:19 UTC (rev 1978)
@@ -1,52 +0,0 @@
-/*
- * 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.ws.metadata.builder.jaxws;
-
-// $Id$
-
-import javax.jws.WebService;
-import javax.xml.ws.WebServiceProvider;
-
-import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-
-/** An abstract annotation meta data builder.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 27-Jun-2006
- */
-public abstract class JAXWSServerMetaDataBuilder extends JAXWSMetaDataBuilder
-{
- protected void setupEndpoint(UnifiedMetaData umd, UnifiedDeploymentInfo udi, Class<?> beanClass, String beanName) throws Exception
- {
- if (beanClass.isAnnotationPresent(WebService.class))
- {
- JAXWSEndpointMetaDataBuilder builder = new JAXWSWebServiceMetaDataBuilder();
- builder.buildEndpointMetaData(umd, udi, beanClass, beanName);
- }
- else if (beanClass.isAnnotationPresent(WebServiceProvider.class))
- {
- JAXWSEndpointMetaDataBuilder builder = new JAXWSProviderMetaDataBuilder();
- builder.buildEndpointMetaData(umd, udi, beanClass, beanName);
- }
- }
-}
Copied: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java (from rev 1975, trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java)
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSEndpointMetaDataBuilder.java 2007-01-15 20:34:13 UTC (rev 1975)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSServerMetaDataBuilder.java 2007-01-16 07:52:19 UTC (rev 1978)
@@ -0,0 +1,145 @@
+/*
+* 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.ws.metadata.builder.jaxws;
+
+// $Id$
+
+import javax.jws.WebService;
+import javax.xml.ws.WebServiceProvider;
+
+import org.jboss.ws.annotation.PortComponent;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo;
+import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
+import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+
+/**
+ * Builds ServiceEndpointMetaData for a JAX-WS endpoint.
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @author Thomas.Diesler(a)jboss.com
+ */
+public abstract class JAXWSServerMetaDataBuilder extends JAXWSMetaDataBuilder
+{
+ static void setupProviderOrWebService(UnifiedMetaData umd, UnifiedDeploymentInfo udi, Class<?> beanClass, String beanName) throws Exception
+ {
+ if (beanClass.isAnnotationPresent(WebService.class))
+ {
+ JAXWSWebServiceMetaDataBuilder builder = new JAXWSWebServiceMetaDataBuilder();
+ builder.buildWebServiceMetaData(umd, udi, beanClass, beanName);
+ }
+ else if (beanClass.isAnnotationPresent(WebServiceProvider.class))
+ {
+ JAXWSProviderMetaDataBuilder builder = new JAXWSProviderMetaDataBuilder();
+ builder.buildProviderMetaData(umd, udi, beanClass, beanName);
+ }
+ }
+
+ protected void processPortComponent(UnifiedDeploymentInfo udi, Class<?> wsClass, String linkName, ServerEndpointMetaData sepMetaData)
+ {
+ PortComponent anPortComponent = wsClass.getAnnotation(PortComponent.class);
+ if (anPortComponent == null)
+ return;
+
+ // setup config name
+ if (anPortComponent.configName().length() > 0)
+ {
+ String configName = anPortComponent.configName();
+ sepMetaData.setConfigName(configName);
+ }
+
+ // setup config file
+ if (anPortComponent.configFile().length() > 0)
+ {
+ String configFile = anPortComponent.configFile();
+ sepMetaData.setConfigFile(configFile);
+ }
+
+ boolean isJSEEndpoint = (udi.type == DeploymentType.JAXWS_JSE);
+
+ // context-root
+ if (anPortComponent.contextRoot().length() > 0)
+ {
+ if (isJSEEndpoint)
+ log.warn("@PortComponent.contextRoot is only valid on EJB endpoints");
+
+ if (isJSEEndpoint == false)
+ {
+ String contextRoot = anPortComponent.contextRoot();
+ if (contextRoot.startsWith("/") == false)
+ contextRoot = "/" + contextRoot;
+
+ sepMetaData.setContextRoot(contextRoot);
+ }
+ }
+
+ // url-pattern
+ if (anPortComponent.urlPattern().length() > 0)
+ {
+ if (isJSEEndpoint)
+ log.warn("@PortComponent.urlPattern is only valid on EJB endpoints");
+
+ if (isJSEEndpoint == false)
+ {
+ String urlPattern = anPortComponent.urlPattern();
+ sepMetaData.setURLPattern(urlPattern);
+ }
+ }
+
+ // auth-method
+ if (anPortComponent.authMethod().length() > 0)
+ {
+ if (isJSEEndpoint)
+ log.warn("@PortComponent.authMethod is only valid on EJB endpoints");
+
+ if (isJSEEndpoint == false)
+ {
+ String authMethod = anPortComponent.authMethod();
+ sepMetaData.setAuthMethod(authMethod);
+ }
+ }
+
+ // transport-guarantee
+ if (anPortComponent.transportGuarantee().length() > 0)
+ {
+ if (isJSEEndpoint)
+ log.warn("@PortComponent.transportGuarantee is only valid on EJB endpoints");
+
+ if (isJSEEndpoint == false)
+ {
+ String transportGuarantee = anPortComponent.transportGuarantee();
+ sepMetaData.setTransportGuarantee(transportGuarantee);
+ }
+ }
+
+ // secure wsdl access
+ sepMetaData.setSecureWSDLAccess(anPortComponent.secureWSDLAccess());
+
+ // virtual hosts
+ String[] virtualHosts = anPortComponent.virtualHosts();
+ if (virtualHosts != null & virtualHosts.length > 0)
+ {
+ sepMetaData.setVirtualHosts(virtualHosts);
+ }
+
+ }
+}
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-01-16 04:10:04 UTC (rev 1977)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-01-16 07:52:19 UTC (rev 1978)
@@ -23,30 +23,12 @@
// $Id$
-import com.sun.xml.bind.api.JAXBRIContext;
-import com.sun.xml.bind.api.TypeReference;
-import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
-import org.jboss.ws.core.jaxrpc.Style;
-import org.jboss.ws.core.jaxrpc.Use;
-import org.jboss.ws.core.jaxws.DynamicWrapperGenerator;
-import org.jboss.ws.core.jaxws.WrapperGenerator;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.core.utils.HolderUtils;
import org.jboss.ws.core.utils.IOUtils;
-import org.jboss.ws.core.utils.JBossWSEntityResolver;
-import org.jboss.ws.core.utils.JavaUtils;
-import org.jboss.ws.extensions.addressing.AddressingPropertiesImpl;
-import org.jboss.ws.extensions.addressing.metadata.AddressingOpMetaExt;
-import org.jboss.ws.metadata.acessor.JAXBAccessor;
import org.jboss.ws.metadata.builder.MetaDataBuilder;
-import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
-import org.jboss.ws.metadata.jsr181.HandlerChainFactory;
-import org.jboss.ws.metadata.jsr181.HandlerChainMetaData;
-import org.jboss.ws.metadata.jsr181.HandlerChainsMetaData;
import org.jboss.ws.metadata.umdm.*;
-import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
@@ -56,37 +38,15 @@
import org.jboss.ws.tools.jaxws.WSDLGenerator;
import org.jboss.ws.tools.wsdl.WSDLWriter;
import org.jboss.ws.tools.wsdl.WSDLWriterResolver;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
import javax.jws.*;
-import javax.jws.soap.SOAPBinding;
-import javax.jws.soap.SOAPBinding.ParameterStyle;
import javax.jws.soap.SOAPMessageHandlers;
import javax.management.ObjectName;
-import javax.xml.bind.JAXBException;
import javax.xml.namespace.QName;
-import javax.xml.rpc.ParameterMode;
-import javax.xml.ws.RequestWrapper;
-import javax.xml.ws.ResponseWrapper;
-import javax.xml.ws.WebFault;
-import javax.xml.ws.addressing.AddressingProperties;
import java.io.File;
import java.io.IOException;
-import java.io.InputStream;
import java.io.Writer;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.net.MalformedURLException;
import java.net.URL;
-import java.rmi.RemoteException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
/**
* An abstract annotation meta data builder.
@@ -98,7 +58,7 @@
* @since 15-Oct-2005
*/
@SuppressWarnings("deprecation")
-public class JAXWSWebServiceMetaDataBuilder extends JAXWSEndpointMetaDataBuilder
+public class JAXWSWebServiceMetaDataBuilder extends JAXWSServerMetaDataBuilder
{
private static class EndpointResult
{
@@ -108,556 +68,96 @@
private URL wsdlLocation;
}
- // provide logging
- private static final Logger log = Logger.getLogger(JAXWSWebServiceMetaDataBuilder.class);
- private List<Class> javaTypes = new ArrayList<Class>();
- private JAXBRIContext jaxbCtx;
- private List<TypeReference> typeRefs = new ArrayList<TypeReference>();
- private WrapperGenerator wrapperGenerator;
-
- public JAXWSWebServiceMetaDataBuilder()
+ public ServerEndpointMetaData buildWebServiceMetaData(UnifiedMetaData wsMetaData, UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName)
{
- }
-
- private void addFault(OperationMetaData omd, Class<?> exception)
- {
- if (omd.isOneWay())
- throw new IllegalStateException("JSR-181 4.3.1 - A JSR-181 processor is REQUIRED to report an error if an operation marked "
- + "@Oneway has a return value, declares any checked exceptions or has any INOUT or OUT parameters.");
-
- WebFault annotation = exception.getAnnotation(WebFault.class);
-
- String name;
- String namespace;
- String faultBeanName = null;
-
- // Only the element name is effected by @WebFault, the type uses the same convention
- QName xmlType = new QName(omd.getQName().getNamespaceURI(), exception.getSimpleName());
-
- /*
- * If @WebFault is present, and the exception contains getFaultInfo, the
- * return value should be used. Otherwise we need to generate the bean.
- */
- boolean generate = true;
- if (annotation != null)
- {
- name = annotation.name();
- namespace = annotation.targetNamespace();
- if (namespace.length() == 0)
- namespace = omd.getQName().getNamespaceURI();
-
- Class<?> faultBean = getFaultInfo(exception);
- if (faultBean != null)
- {
- generate = false;
- faultBeanName = faultBean.getName();
- }
- }
- else
- {
- name = xmlType.getLocalPart();
- namespace = xmlType.getNamespaceURI();
- }
-
- if (faultBeanName == null)
- faultBeanName = JavaUtils.getPackageName(omd.getEndpointMetaData().getServiceEndpointInterface()) + ".jaxws." + exception.getSimpleName() + "Bean";
-
- QName xmlName = new QName(namespace, name);
-
- FaultMetaData fmd = new FaultMetaData(omd, xmlName, xmlType, exception.getName());
- fmd.setFaultBeanName(faultBeanName);
-
- if (generate)
- wrapperGenerator.generate(fmd);
-
- javaTypes.add(fmd.getFaultBean());
- typeRefs.add(new TypeReference(fmd.getXmlName(), fmd.getFaultBean()));
-
- omd.addFault(fmd);
- }
-
- private String convertToVariable(String localName)
- {
- return JAXBRIContext.mangleNameToVariableName(localName);
- }
-
- private String[] convertTypeArguments(Class rawType, Type type)
- {
- if (!Collection.class.isAssignableFrom(rawType) && !Map.class.isAssignableFrom(rawType))
- return null;
-
- if (!(type instanceof ParameterizedType))
- return null;
-
- ParameterizedType paramType = (ParameterizedType)type;
- Type[] arguments = paramType.getActualTypeArguments();
- String[] ret = new String[arguments.length];
- for (int i = 0; i < arguments.length; i++)
- ret[i] = JavaUtils.erasure(arguments[i]).getName();
-
- return ret;
- }
-
- private ParameterMetaData createRequestWrapper(OperationMetaData operation, Method method)
- {
- String requestWrapperType = null;
- QName xmlName = operation.getQName();
- QName xmlType = xmlName;
- if (method.isAnnotationPresent(RequestWrapper.class))
- {
- RequestWrapper anReqWrapper = method.getAnnotation(RequestWrapper.class);
-
- String localName = anReqWrapper.localName().length() > 0 ? anReqWrapper.localName() : xmlName.getLocalPart();
- String targetNamespace = anReqWrapper.targetNamespace().length() > 0 ? anReqWrapper.targetNamespace() : xmlName.getNamespaceURI();
- xmlName = new QName(targetNamespace, localName);
-
- if (anReqWrapper.className().length() > 0)
- requestWrapperType = anReqWrapper.className();
- }
-
- // Conformance 3.18, the default value must be the same as the method name
- if (requestWrapperType == null)
- {
- String packageName = JavaUtils.getPackageName(method.getDeclaringClass()) + ".jaxws";
- requestWrapperType = packageName + "." + JavaUtils.capitalize(method.getName());
- }
-
- // JAX-WS p.37 pg.1, the annotation only affects the element name, not the type name
- ParameterMetaData wrapperParameter = new ParameterMetaData(operation, xmlName, xmlType, requestWrapperType);
- wrapperParameter.setAccessorFactoryCreator(JAXBAccessor.FACTORY_CREATOR);
- operation.addParameter(wrapperParameter);
-
- return wrapperParameter;
- }
-
- private ParameterMetaData createResponseWrapper(OperationMetaData operation, Method method)
- {
- QName operationQName = operation.getQName();
- QName xmlName = new QName(operationQName.getNamespaceURI(), operationQName.getLocalPart() + "Response");
- QName xmlType = xmlName;
-
- String responseWrapperType = null;
- if (method.isAnnotationPresent(ResponseWrapper.class))
- {
- ResponseWrapper anResWrapper = method.getAnnotation(ResponseWrapper.class);
-
- String localName = anResWrapper.localName().length() > 0 ? anResWrapper.localName() : xmlName.getLocalPart();
- String targetNamespace = anResWrapper.targetNamespace().length() > 0 ? anResWrapper.targetNamespace() : xmlName.getNamespaceURI();
- xmlName = new QName(targetNamespace, localName);
-
- if (anResWrapper.className().length() > 0)
- responseWrapperType = anResWrapper.className();
- }
-
- if (responseWrapperType == null)
- {
- String packageName = JavaUtils.getPackageName(method.getDeclaringClass()) + ".jaxws";
- responseWrapperType = packageName + "." + JavaUtils.capitalize(method.getName()) + "Response";
- }
-
- ParameterMetaData retMetaData = new ParameterMetaData(operation, xmlName, xmlType, responseWrapperType);
- retMetaData.setAccessorFactoryCreator(JAXBAccessor.FACTORY_CREATOR);
- operation.setReturnParameter(retMetaData);
-
- return retMetaData;
- }
-
- private Class<?> getFaultInfo(Class<?> exception)
- {
try
{
- Method method = exception.getMethod("getFaultInfo");
- Class<?> returnType = method.getReturnType();
- if (returnType == void.class)
- return null;
+ EndpointResult result = processWebService(wsMetaData, sepClass, udi);
- return returnType;
- }
- catch (SecurityException e)
- {
- throw new WSException("Unexpected security exception: " + e.getMessage(), e);
- }
- catch (NoSuchMethodException e)
- {
- return null;
- }
- }
+ // Clear the java types, etc.
+ resetMetaDataBuilder(udi.classLoader);
- private ParameterMode getParameterMode(WebParam anWebParam, Class javaType)
- {
- if (anWebParam != null)
- {
- if (anWebParam.mode() == WebParam.Mode.INOUT)
- return ParameterMode.INOUT;
- if (anWebParam.mode() == WebParam.Mode.OUT)
- return ParameterMode.OUT;
- }
+ ServerEndpointMetaData sepMetaData = result.sepMetaData;
+ ServiceMetaData serviceMetaData = result.serviceMetaData;
+ Class<?> seiClass = result.epClass;
- return HolderUtils.isHolderType(javaType) ? ParameterMode.INOUT : ParameterMode.IN;
- }
+ sepMetaData.setLinkName(linkName);
+ sepMetaData.setServiceEndpointImplName(sepClass.getName());
+ sepMetaData.setServiceEndpointInterfaceName(seiClass.getName());
- private WebParam getWebParamAnnotation(Method method, int pos)
- {
- for (Annotation annotation : method.getParameterAnnotations()[pos])
- if (annotation instanceof WebParam)
- return (WebParam)annotation;
+ // Assign the WS-Security configuration,
+ WSSecurityConfigFactory wsseConfFactory = WSSecurityConfigFactory.newInstance();
+ WSSecurityConfiguration securityConfiguration = wsseConfFactory.createConfiguration(udi);
+ serviceMetaData.setSecurityConfiguration(securityConfiguration);
- return null;
- }
+ // Process an optional @SOAPBinding annotation
+ processSOAPBinding(sepMetaData, seiClass);
- private QName getWebParamName(OperationMetaData opMetaData, int index, WebParam webParam)
- {
- String namespace = null;
- String name = null;
- boolean header = false;
+ // Process an optional @BindingType annotation
+ processBindingType(sepMetaData, seiClass);
- if (webParam != null)
- {
- if (webParam.targetNamespace().length() > 0)
- namespace = webParam.targetNamespace();
+ // Process web methods
+ processWebMethods(sepMetaData, seiClass);
- // RPC types use the partName for their XML name
- if (webParam.partName().length() > 0 && opMetaData.isRPCLiteral())
- name = webParam.partName();
- else if (webParam.name().length() > 0)
- name = webParam.name();
+ // Init the transport guarantee
+ initTransportGuaranteeJSE(udi, sepMetaData, linkName);
- header = webParam.header();
- }
+ // Initialize types
+ createJAXBContext(sepMetaData);
+ populateXmlTypes(sepMetaData);
- // Bare and headers must be qualified
- if (namespace == null && (opMetaData.isDocumentBare() || header))
- namespace = opMetaData.getQName().getNamespaceURI();
+ // Process or generate WSDL
+ processOrGenerateWSDL(seiClass, serviceMetaData, result.wsdlLocation, sepMetaData);
- // RPC body parts must have no namespace
- else if (opMetaData.isRPCLiteral() && !header)
- namespace = null;
+ // process config name and config file amongst others
+ // Note, that @PortComponent needs to be defined on the endpoint not the SEI
+ processPortComponent(udi, sepClass, linkName, sepMetaData);
- // Bare uses the operation name as the default, everything else is generated
- if (name == null)
- name = opMetaData.isDocumentBare() && !header ? opMetaData.getQName().getLocalPart() : "arg" + index;
+ // setup handler chain from config
+ sepMetaData.configure(sepMetaData);
- return (namespace != null) ? new QName(namespace, name) : new QName(name);
- }
-
- private QName getWebResultName(OperationMetaData opMetaData, WebResult anWebResult)
- {
- String name = null;
- String namespace = null;
- boolean header = false;
-
- if (anWebResult != null)
- {
- if (anWebResult.targetNamespace().length() > 0)
- namespace = anWebResult.targetNamespace();
-
- // RPC types use the partName for their XML name
- if (anWebResult.partName().length() > 0 && opMetaData.isRPCLiteral())
- name = anWebResult.partName();
- else if (anWebResult.name().length() > 0)
- name = anWebResult.name();
-
- header = anWebResult.header();
- }
-
- // Bare and headers must be qualified
- if (namespace == null && (opMetaData.isDocumentBare() || header))
- namespace = opMetaData.getQName().getNamespaceURI();
-
- // RPC body parts must have no namespace
- else if (opMetaData.isRPCLiteral() && !header)
- namespace = null;
-
- // Bare uses the operation name as the default, everything else is generated
- if (name == null)
- name = opMetaData.isDocumentBare() && !header ? opMetaData.getResponseName().getLocalPart() : "return";
-
- return (namespace != null) ? new QName(namespace, name) : new QName(name);
- }
-
- private void populateXmlType(FaultMetaData faultMetaData)
- {
- EndpointMetaData epMetaData = faultMetaData.getOperationMetaData().getEndpointMetaData();
- TypesMetaData types = epMetaData.getServiceMetaData().getTypesMetaData();
-
- QName xmlType = faultMetaData.getXmlType();
- String faultBeanName = faultMetaData.getFaultBeanName();
-
- types.addTypeMapping(new TypeMappingMetaData(types, xmlType, faultBeanName));
- }
-
- private void populateXmlType(ParameterMetaData paramMetaData)
- {
- EndpointMetaData epMetaData = paramMetaData.getOperationMetaData().getEndpointMetaData();
- TypesMetaData types = epMetaData.getServiceMetaData().getTypesMetaData();
-
- QName xmlName = paramMetaData.getXmlName();
- QName xmlType = paramMetaData.getXmlType();
- Class javaType = paramMetaData.getJavaType();
- String javaName = paramMetaData.getJavaTypeName();
-
- if (xmlType == null)
- {
- try
+ // Process an optional @HandlerChain annotation
+ if (sepClass.isAnnotationPresent(HandlerChain.class))
{
- xmlType = jaxbCtx.getTypeName(new TypeReference(xmlName, javaType));
+ processHandlerChain(sepMetaData, sepClass);
}
- catch (IllegalArgumentException e)
+ else if (seiClass.isAnnotationPresent(HandlerChain.class))
{
- throw new IllegalStateException("Cannot obtain xml type for: [xmlName=" + xmlName + ",javaName=" + javaName + "]");
+ processHandlerChain(sepMetaData, seiClass);
}
- /* Anonymous type.
- *
- * Currently the design of our stack is based on the
- * notion of their always being a unique type. In order to lookup the
- * appropriate (de)serializer you must have a type. So we use a fake
- * name. This is an illegal NCName, so it shouldn't collide.
- */
- if (xmlType == null)
- xmlType = new QName(xmlName.getNamespaceURI(), ">" + xmlName.getLocalPart());
+ // Sanity check: read the generated WSDL and initialize the schema model
+ WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
+ JBossXSModel schemaModel = WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());
+ serviceMetaData.getTypesMetaData().setSchemaModel(schemaModel);
- paramMetaData.setXmlType(xmlType);
- }
+ // Init the endpoint address
+ MetaDataBuilder.initEndpointAddress(udi, sepMetaData, linkName);
- types.addTypeMapping(new TypeMappingMetaData(types, xmlType, javaName));
- }
+ // replace the SOAP address
+ MetaDataBuilder.replaceAddressLocation(sepMetaData);
- /**
- * Process operation meta data extensions.
- */
- private void processMetaExtensions(EndpointMetaData epMetaData, OperationMetaData opMetaData)
- {
- // Until there is a addressing annotion we fallback to implicit action association
- // TODO: figure out a way to assign message name instead of IN and OUT
- String tns = epMetaData.getQName().getNamespaceURI();
- String portTypeName = epMetaData.getQName().getLocalPart();
+ // Process an optional @SOAPMessageHandlers annotation
+ if (sepClass.isAnnotationPresent(SOAPMessageHandlers.class) || seiClass.isAnnotationPresent(SOAPMessageHandlers.class))
+ log.warn("@SOAPMessageHandlers is deprecated as of JAX-WS 2.0 with no replacement.");
- AddressingProperties ADDR = new AddressingPropertiesImpl();
- AddressingOpMetaExt addrExt = new AddressingOpMetaExt(ADDR.getNamespaceURI());
- addrExt.setInboundAction(tns + "/" + portTypeName + "/IN");
+ // init service endpoint id
+ ObjectName sepID = MetaDataBuilder.createServiceEndpointID(udi, sepMetaData);
+ sepMetaData.setServiceEndpointID(sepID);
- if (!opMetaData.isOneWay())
- addrExt.setOutboundAction(tns + "/" + portTypeName + "/OUT");
-
- opMetaData.addExtension(addrExt);
- }
-
- private void processWebMethod(EndpointMetaData epMetaData, Method method)
- {
- String javaName = method.getName();
-
- // skip asnyc methods, they dont need meta data representation
- if (method.getName().endsWith(Constants.ASYNC_METHOD_SUFFIX))
- return;
-
- // reflection defaults
- String soapAction = "";
- String operationName = method.getName();
-
- // annotation values that override defaults
- if (method.isAnnotationPresent(WebMethod.class))
- {
- WebMethod anWebMethod = method.getAnnotation(WebMethod.class);
- soapAction = anWebMethod.action();
- if (anWebMethod.operationName().length() > 0)
- {
- operationName = anWebMethod.operationName();
- }
+ return sepMetaData;
}
-
- String targetNS = epMetaData.getInterfaceQName().getNamespaceURI();
- OperationMetaData opMetaData = new OperationMetaData(epMetaData, new QName(targetNS, operationName), javaName);
- opMetaData.setOneWay(method.isAnnotationPresent(Oneway.class));
- opMetaData.setSOAPAction(soapAction);
-
- if (method.isAnnotationPresent(SOAPBinding.class))
+ catch (RuntimeException rte)
{
- SOAPBinding anBinding = method.getAnnotation(SOAPBinding.class);
- if (anBinding.style() != SOAPBinding.Style.DOCUMENT || epMetaData.getStyle() != Style.DOCUMENT)
- throw new IllegalArgumentException("@SOAPBinding must be specified using DOCUMENT style when placed on a method");
- opMetaData.setParameterStyle(anBinding.parameterStyle());
+ throw rte;
}
-
- epMetaData.addOperation(opMetaData);
-
- // Build parameter meta data
- Class[] parameterTypes = method.getParameterTypes();
- Type[] genericTypes = method.getGenericParameterTypes();
- Annotation[][] parameterAnnotations = method.getParameterAnnotations();
- ParameterMetaData wrapperParameter = null, wrapperOutputParameter = null;
- List<WrappedParameter> wrappedParameters = null, wrappedOutputParameters = null;
-
- // Force paramter style to wrapped
- if (method.isAnnotationPresent(RequestWrapper.class) || method.isAnnotationPresent(ResponseWrapper.class))
+ catch (Exception ex)
{
- epMetaData.setParameterStyle(ParameterStyle.WRAPPED);
+ throw new WSException("Cannot build meta data: " + ex.getMessage(), ex);
}
-
- if (opMetaData.isDocumentWrapped())
- {
- wrapperParameter = createRequestWrapper(opMetaData, method);
- wrappedParameters = new ArrayList<WrappedParameter>(parameterTypes.length);
- wrapperParameter.setWrappedParameters(wrappedParameters);
-
- if (!opMetaData.isOneWay())
- {
- wrapperOutputParameter = createResponseWrapper(opMetaData, method);
- wrappedOutputParameters = new ArrayList<WrappedParameter>(parameterTypes.length + 1);
- wrapperOutputParameter.setWrappedParameters(wrappedOutputParameters);
- }
- }
-
- for (int i = 0; i < parameterTypes.length; i++)
- {
- Class javaType = parameterTypes[i];
- Type genericType = genericTypes[i];
- String javaTypeName = javaType.getName();
- WebParam anWebParam = getWebParamAnnotation(method, i);
- boolean isHeader = anWebParam != null && anWebParam.header();
- boolean isWrapped = opMetaData.isDocumentWrapped() && !isHeader;
- ParameterMode mode = getParameterMode(anWebParam, javaType);
-
- // Assert one-way
- if (opMetaData.isOneWay() && mode != ParameterMode.IN)
- throw new IllegalArgumentException("A one-way operation can not have output parameters [" + "method = " + method.getName() + ", parameter = " + i + "]");
-
- if (HolderUtils.isHolderType(javaType))
- {
- genericType = HolderUtils.getGenericValueType(genericType);
- javaType = JavaUtils.erasure(genericType);
- javaTypeName = javaType.getName();
- }
-
- if (isWrapped)
- {
- QName wrappedElementName = getWebParamName(opMetaData, i, anWebParam);
- String variable = convertToVariable(wrappedElementName.getLocalPart());
-
- WrappedParameter wrappedParameter = new WrappedParameter(wrappedElementName, javaTypeName, variable, i);
- wrappedParameter.setTypeArguments(convertTypeArguments(javaType, genericType));
-
- if (mode != ParameterMode.OUT)
- wrappedParameters.add(wrappedParameter);
- if (mode != ParameterMode.IN)
- {
- wrappedOutputParameters.add(wrappedParameter);
- wrappedParameter.setHolder(true);
- }
- }
- else
- {
- QName xmlName = getWebParamName(opMetaData, i, anWebParam);
-
- ParameterMetaData paramMetaData = new ParameterMetaData(opMetaData, xmlName, javaTypeName);
- paramMetaData.setInHeader(isHeader);
- paramMetaData.setIndex(i);
- paramMetaData.setMode(mode);
-
- /*
- * Note: The TCK enforces the following rule in the spec regarding
- * partName: "This is only used if the operation is rpc style or if
- * the operation is document style and the parameter style is BARE."
- *
- * This seems to be a flaw in the spec, because the intention is
- * obviously to prevent the ambiguity of wrapped parameters that
- * specify different partName values. There is, however, no reason
- * that this limitation should apply to header parameters since they
- * are never wrapped. In order to comply we adhere to this confusing
- * rule, although I will ask for clarification.
- */
- if (anWebParam != null && !opMetaData.isDocumentWrapped() && anWebParam.partName().length() > 0)
- paramMetaData.setPartName(anWebParam.partName());
-
- opMetaData.addParameter(paramMetaData);
- javaTypes.add(javaType);
- typeRefs.add(new TypeReference(xmlName, genericType, parameterAnnotations[i]));
- }
- }
-
- // Build result meta data
- Class returnType = method.getReturnType();
- Type genericReturnType = method.getGenericReturnType();
- String returnTypeName = returnType.getName();
- if (!(returnType == void.class))
- {
- if (opMetaData.isOneWay())
- throw new IllegalArgumentException("[JSR-181 2.5.1] The method '" + method.getName() + "' can not have a return value if it is marked OneWay");
-
- WebResult anWebResult = method.getAnnotation(WebResult.class);
- boolean isHeader = anWebResult != null && anWebResult.header();
- boolean isWrappedBody = opMetaData.isDocumentWrapped() && !isHeader;
- QName xmlName = getWebResultName(opMetaData, anWebResult);
-
- if (isWrappedBody)
- {
- WrappedParameter wrapped = new WrappedParameter(xmlName, returnTypeName, convertToVariable(xmlName.getLocalPart()), -1);
- wrapped.setTypeArguments(convertTypeArguments(returnType, genericReturnType));
-
- // insert at the beginning just for prettiness
- wrappedOutputParameters.add(0, wrapped);
- }
- else
- {
- ParameterMetaData retMetaData = new ParameterMetaData(opMetaData, xmlName, returnTypeName);
- retMetaData.setInHeader(isHeader);
- retMetaData.setIndex(-1);
- retMetaData.setMode(ParameterMode.OUT);
-
- // Special case: If we have a document/literal wrapped message, then
- // the return metadata must be the wrapper type that is sent in the
- // body. So, in order to handle headers that are mapped to the java
- // return value, we have to add them to a parameter with an index of
- // -1 to signify the return value. All other binding styles use the
- // expected return value mechanism.
- if (opMetaData.isDocumentWrapped())
- {
- opMetaData.addParameter(retMetaData);
- }
- else
- {
- // See above comment in the parameter for loop section as to why
- // we prevent customization of part names on document wrapped
- // header parameters.
- if (anWebResult != null && anWebResult.partName().length() > 0)
- retMetaData.setPartName(anWebResult.partName());
-
- opMetaData.setReturnParameter(retMetaData);
- }
-
- javaTypes.add(returnType);
- typeRefs.add(new TypeReference(xmlName, genericReturnType, method.getAnnotations()));
- }
- }
-
- // Generate wrapper beans
- if (opMetaData.isDocumentWrapped())
- {
- wrapperGenerator.generate(wrapperParameter);
- Class wrapperClass = wrapperParameter.getJavaType();
- javaTypes.add(wrapperClass);
- // In case there is no @XmlRootElement
- typeRefs.add(new TypeReference(wrapperParameter.getXmlName(), wrapperClass));
- if (!opMetaData.isOneWay())
- {
- wrapperGenerator.generate(wrapperOutputParameter);
- wrapperClass = wrapperOutputParameter.getJavaType();
- javaTypes.add(wrapperClass);
- // In case there is no @XmlRootElement
- typeRefs.add(new TypeReference(wrapperOutputParameter.getXmlName(), wrapperClass));
- }
- }
-
- // Add faults
- for (Class exClass : method.getExceptionTypes())
- if (!RemoteException.class.isAssignableFrom(exClass))
- addFault(opMetaData, exClass);
-
- // process op meta data extension
- processMetaExtensions(epMetaData, opMetaData);
}
-
+
private EndpointResult processWebService(UnifiedMetaData wsMetaData, Class<?> sepClass, UnifiedDeploymentInfo udi) throws ClassNotFoundException, IOException
{
WebService anWebService = sepClass.getAnnotation(WebService.class);
@@ -731,144 +231,8 @@
return result;
}
- protected void createJAXBContext(EndpointMetaData epMetaData)
+ private void processOrGenerateWSDL(Class wsClass, ServiceMetaData serviceMetaData, URL wsdlLocation, EndpointMetaData epMetaData)
{
- try
- {
- String targetNS = epMetaData.getInterfaceQName().getNamespaceURI();
- log.debug("JAXBContext [types=" + javaTypes + ",tns=" + targetNS + "]");
- jaxbCtx = JAXBRIContext.newInstance(javaTypes.toArray(new Class[0]), typeRefs, targetNS, false);
- }
- catch (JAXBException ex)
- {
- throw new IllegalStateException("Cannot build JAXB context", ex);
- }
- }
-
- protected void populateXmlTypes(EndpointMetaData epMetaData)
- {
- for (OperationMetaData operation : epMetaData.getOperations())
- {
- // parameters
- for (ParameterMetaData paramMetaData : operation.getParameters())
- {
- populateXmlType(paramMetaData);
- }
-
- // return value
- ParameterMetaData returnParameter = operation.getReturnParameter();
- if (returnParameter != null)
- populateXmlType(returnParameter);
-
- // faults
- for (FaultMetaData faultMetaData : operation.getFaults())
- {
- populateXmlType(faultMetaData);
- }
- }
- }
-
- /**
- * Process an optional @HandlerChain annotation
- *
- * Location of the handler chain file. The location supports 2 formats.
- *
- * 1. An absolute java.net.URL in externalForm.
- * (ex: http://myhandlers.foo.com/handlerfile1.xml)
- *
- * 2. A relative path from the source file or class file.
- * (ex: bar/handlerfile1.xml)
- */
- protected void processHandlerChain(EndpointMetaData epMetaData, Class<?> wsClass)
- {
- if (wsClass.isAnnotationPresent(SOAPMessageHandlers.class))
- throw new WSException("Cannot combine @HandlerChain with @SOAPMessageHandlers");
-
- HandlerChain anHandlerChain = wsClass.getAnnotation(HandlerChain.class);
-
- URL fileURL = null;
- String filename = anHandlerChain.file();
-
- // Try the filename as URL
- try
- {
- fileURL = new URL(filename);
- }
- catch (MalformedURLException ex)
- {
- // ignore
- }
-
- // Try the filename as File
- if (fileURL == null)
- {
- try
- {
- File file = new File(filename);
- if (file.exists())
- fileURL = file.toURL();
- }
- catch (MalformedURLException e)
- {
- // ignore
- }
- }
-
- // Try the filename as Resource
- if (fileURL == null)
- {
- fileURL = epMetaData.getClassLoader().getResource(filename);
- }
-
- // Try the filename relative to class
- if (fileURL == null)
- {
- String packagePath = wsClass.getPackage().getName().replace('.', '/');
- fileURL = epMetaData.getClassLoader().getResource(packagePath + "/" + filename);
- }
-
- if (fileURL == null)
- throw new WSException("Cannot resolve handler file '" + filename + "' on " + wsClass.getName());
-
- try
- {
- HandlerChainsMetaData handlerChainsMetaData = null;
- InputStream is = fileURL.openStream();
- try
- {
- Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- unmarshaller.setValidation(true);
- unmarshaller.setSchemaValidation(true);
- unmarshaller.setEntityResolver(new JBossWSEntityResolver());
- ObjectModelFactory factory = new HandlerChainFactory();
- handlerChainsMetaData = (HandlerChainsMetaData)unmarshaller.unmarshal(is, factory, null);
- }
- finally
- {
- is.close();
- }
-
- // Setup the endpoint handlers
- for (HandlerChainMetaData handlerChainMetaData : handlerChainsMetaData.getHandlerChains())
- {
- for (UnifiedHandlerMetaData uhmd : handlerChainMetaData.getHandlers())
- {
- epMetaData.addHandler(uhmd.getHandlerMetaDataJAXWS(epMetaData, HandlerType.ENDPOINT));
- }
- }
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot process handler chain: " + filename, ex);
- }
- }
-
- protected void processOrGenerateWSDL(Class wsClass, ServiceMetaData serviceMetaData, URL wsdlLocation, EndpointMetaData epMetaData)
- {
if (wsdlLocation != null)
{
serviceMetaData.setWsdlLocation(wsdlLocation);
@@ -915,165 +279,4 @@
}
}
}
-
- protected void processSOAPBinding(EndpointMetaData epMetaData, Class<?> wsClass)
- {
-
- if (!wsClass.isAnnotationPresent(SOAPBinding.class))
- return;
-
- SOAPBinding anSoapBinding = wsClass.getAnnotation(SOAPBinding.class);
-
- SOAPBinding.Style attrStyle = anSoapBinding.style();
- Style style = (attrStyle == SOAPBinding.Style.RPC ? Style.RPC : Style.DOCUMENT);
- epMetaData.setStyle(style);
-
- SOAPBinding.Use attrUse = anSoapBinding.use();
- if (attrUse == SOAPBinding.Use.ENCODED)
- throw new WSException("SOAP encoding is not supported for JSR-181 deployments");
-
- epMetaData.setEncodingStyle(Use.LITERAL);
-
- ParameterStyle paramStyle = anSoapBinding.parameterStyle();
- epMetaData.setParameterStyle(paramStyle);
- }
-
- // If the implementation bean does not implement a service endpoint interface and
- // there are no @WebMethod annotations in the implementation bean (excluding
- // @WebMethod annotations used to exclude inherited @WebMethods), all public
- // methods other than those inherited from java.lang.Object will be exposed as Web
- // Service operations, subject to the inheritance rules specified in Common
- // Annotations for the Java Platform [12], section 2.1.
- protected void processWebMethods(EndpointMetaData epMetaData, Class wsClass)
- {
- epMetaData.clearOperations();
-
- // Process @WebMethod annotations
- int webMethodCount = 0;
- for (Method method : wsClass.getMethods())
- {
- WebMethod annotation = method.getAnnotation(WebMethod.class);
- boolean exclude = annotation != null && annotation.exclude();
- if (!exclude && (annotation != null || wsClass.isInterface()))
- {
- processWebMethod(epMetaData, method);
- webMethodCount++;
- }
- }
-
- // @WebService should expose all inherited methods if @WebMethod is never specified
- if (webMethodCount == 0 && !wsClass.isInterface())
- {
- for (Method method : wsClass.getMethods())
- {
- WebMethod annotation = method.getAnnotation(WebMethod.class);
- boolean exclude = annotation != null && annotation.exclude();
- if (!exclude && method.getDeclaringClass() != Object.class)
- {
- processWebMethod(epMetaData, method);
- webMethodCount++;
- }
- }
- }
-
- if (webMethodCount == 0)
- throw new WSException("No exposable methods found");
- }
-
- protected void resetMetaDataBuilder(ClassLoader loader)
- {
- wrapperGenerator = new DynamicWrapperGenerator(loader);
- javaTypes.clear();
- typeRefs.clear();
- jaxbCtx = null;
- }
-
- public ServerEndpointMetaData buildEndpointMetaData(UnifiedMetaData wsMetaData, UnifiedDeploymentInfo udi, Class<?> sepClass, String linkName)
- {
- try
- {
- EndpointResult result = processWebService(wsMetaData, sepClass, udi);
-
- // Clear the java types, etc.
- resetMetaDataBuilder(udi.classLoader);
-
- ServerEndpointMetaData sepMetaData = result.sepMetaData;
- ServiceMetaData serviceMetaData = result.serviceMetaData;
- Class<?> seiClass = result.epClass;
-
- sepMetaData.setLinkName(linkName);
- sepMetaData.setServiceEndpointImplName(sepClass.getName());
- sepMetaData.setServiceEndpointInterfaceName(seiClass.getName());
-
- // Assign the WS-Security configuration,
- WSSecurityConfigFactory wsseConfFactory = WSSecurityConfigFactory.newInstance();
- WSSecurityConfiguration securityConfiguration = wsseConfFactory.createConfiguration(udi);
- serviceMetaData.setSecurityConfiguration(securityConfiguration);
-
- // Process an optional @SOAPBinding annotation
- processSOAPBinding(sepMetaData, seiClass);
-
- // Process an optional @BindingType annotation
- processBindingType(sepMetaData, seiClass);
-
- // Process web methods
- processWebMethods(sepMetaData, seiClass);
-
- // Init the transport guarantee
- initTransportGuaranteeJSE(udi, sepMetaData, linkName);
-
- // Initialize types
- createJAXBContext(sepMetaData);
- populateXmlTypes(sepMetaData);
-
- // Process or generate WSDL
- processOrGenerateWSDL(seiClass, serviceMetaData, result.wsdlLocation, sepMetaData);
-
- // process config name and config file amongst others
- // Note, that @PortComponent needs to be defined on the endpoint not the SEI
- processPortComponent(udi, sepClass, linkName, sepMetaData);
-
- // setup handler chain from config
- sepMetaData.configure(sepMetaData);
-
- // Process an optional @HandlerChain annotation
- if (sepClass.isAnnotationPresent(HandlerChain.class))
- {
- processHandlerChain(sepMetaData, sepClass);
- }
- else if (seiClass.isAnnotationPresent(HandlerChain.class))
- {
- processHandlerChain(sepMetaData, seiClass);
- }
-
- // Sanity check: read the generated WSDL and initialize the schema model
- WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
- JBossXSModel schemaModel = WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());
- serviceMetaData.getTypesMetaData().setSchemaModel(schemaModel);
-
- // Init the endpoint address
- MetaDataBuilder.initEndpointAddress(udi, sepMetaData, linkName);
-
- // replace the SOAP address
- MetaDataBuilder.replaceAddressLocation(sepMetaData);
-
- // Process an optional @SOAPMessageHandlers annotation
- if (sepClass.isAnnotationPresent(SOAPMessageHandlers.class) || seiClass.isAnnotationPresent(SOAPMessageHandlers.class))
- log.warn("@SOAPMessageHandlers is deprecated as of JAX-WS 2.0 with no replacement.");
-
- // init service endpoint id
- ObjectName sepID = MetaDataBuilder.createServiceEndpointID(udi, sepMetaData);
- sepMetaData.setServiceEndpointID(sepID);
-
- return sepMetaData;
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WSException("Cannot build meta data: " + ex.getMessage(), ex);
- }
- }
}
Modified: trunk/jbossws-tests/src/main/java/org/jboss/test/ws/tools/java2xsd/SchemaModelTestCase.java
===================================================================
--- trunk/jbossws-tests/src/main/java/org/jboss/test/ws/tools/java2xsd/SchemaModelTestCase.java 2007-01-16 04:10:04 UTC (rev 1977)
+++ trunk/jbossws-tests/src/main/java/org/jboss/test/ws/tools/java2xsd/SchemaModelTestCase.java 2007-01-16 07:52:19 UTC (rev 1978)
@@ -55,6 +55,7 @@
"<sequence>" +
"<element name='a' type='int'/>" +
"<element name='b' type='int'/>" +
+ "<element name='d' nillable='true' type='dateTime'/>" +
"</sequence>" +
"</complexType>" +
"</schema>";
18 years
JBossWS SVN: r1977 - in trunk/jbossws-core/src/main/java/org/jboss/ws: metadata/builder/jaxrpc and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2007-01-15 23:10:04 -0500 (Mon, 15 Jan 2007)
New Revision: 1977
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/EndpointInvocation.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ParameterMetaData.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingMessageReference.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
Log:
Fix JBWS-1384 (Fix document/literal wrapped attachment parameters)
Also mark "message style" as deprecated
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/EndpointInvocation.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/EndpointInvocation.java 2007-01-16 04:03:22 UTC (rev 1976)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/EndpointInvocation.java 2007-01-16 04:10:04 UTC (rev 1977)
@@ -258,7 +258,7 @@
Class javaType = paramMetaData.getJavaType();
Object value;
- if (opMetaData.isDocumentWrapped() && paramMetaData.isInHeader() == false)
+ if (opMetaData.isDocumentWrapped() && !paramMetaData.isInHeader() && !paramMetaData.isSwA())
{
value = ParameterWrapping.wrapRequestParameters(paramMetaData, inputParams);
}
@@ -300,7 +300,7 @@
Method method = opMetaData.getJavaMethod();
Class[] targetParameterTypes = method.getParameterTypes();
- if (opMetaData.isDocumentWrapped() && paramMetaData.isInHeader() == false && paramMetaData.isMessageType() == false)
+ if (opMetaData.isDocumentWrapped() && !paramMetaData.isInHeader()&& !paramMetaData.isSwA() && !paramMetaData.isMessageType())
{
outParameters = ParameterWrapping.unwrapRequestParameters(paramMetaData, paramValue, payload);
syncOutWrappedParameters(targetParameterTypes);
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java 2007-01-16 04:03:22 UTC (rev 1976)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java 2007-01-16 04:10:04 UTC (rev 1977)
@@ -386,21 +386,15 @@
if (pmd != null)
pmd.setInHeader(true);
}
-
- // we don't support swa binding parameters in document style
- // http://jira.jboss.org/jira/browse/JBWS-1384
- if (opMetaData.getStyle() == Style.RPC)
+ for (WSDLMIMEPart mimePart : bindingInput.getMimeParts())
{
- for (WSDLMIMEPart mimePart : bindingInput.getMimeParts())
- {
- String partName = mimePart.getPartName();
- QName xmlName = new QName(partName);
- QName xmlType = mimePart.getXmlType();
+ String partName = mimePart.getPartName();
+ QName xmlName = new QName(partName);
+ QName xmlType = mimePart.getXmlType();
- ParameterMetaData pmd = buildInputParameter(opMetaData, wsdlOperation, seiMethodMapping, typeMapping, partName, xmlName, xmlType, wsdlPosition++, false);
- pmd.setSwA(true);
- pmd.setMimeTypes(mimePart.getMimeTypes());
- }
+ ParameterMetaData pmd = buildInputParameter(opMetaData, wsdlOperation, seiMethodMapping, typeMapping, partName, xmlName, xmlType, wsdlPosition++, false);
+ pmd.setSwA(true);
+ pmd.setMimeTypes(mimePart.getMimeTypes());
}
return wsdlPosition;
@@ -596,9 +590,10 @@
}
}
- private int processDocElement(OperationMetaData operation, WSDLInterfaceOperation wsdlOperation, ServiceEndpointMethodMapping seiMethodMapping, TypeMappingImpl typeMapping, List<WrappedParameter> wrappedParameters, List<WrappedParameter> wrappedResponseParameters)
+ private int processDocElement(OperationMetaData operation, WSDLInterfaceOperation wsdlOperation, WSDLBindingOperation bindingOperation, ServiceEndpointMethodMapping seiMethodMapping, TypeMappingImpl typeMapping, List<WrappedParameter> wrappedParameters, List<WrappedParameter> wrappedResponseParameters)
{
WSDLInterfaceOperationInput input = wsdlOperation.getInputs()[0];
+ WSDLBindingOperationInput bindingInput = bindingOperation.getInputs()[0];
int wsdlPosition;
QName xmlName = input.getElement();
@@ -644,6 +639,11 @@
throw new IllegalArgumentException("wsdl-message-message mapping required for document/literal wrapped");
String elementName = wsdlMessageMapping.getWsdlMessagePartName();
+
+ // Skip attachments
+ if (bindingInput.getMimePart(elementName) != null)
+ continue;
+
String variable = variableMap.get(elementName);
if (variable == null)
throw new IllegalArgumentException("Could not determine variable name for element: " + elementName);
@@ -863,7 +863,7 @@
// WS-I BP 1.0 allows document/literal bare to have zero message parts
if (wsdlOperation.getInputs().length > 0)
{
- wsdlPosition = processDocElement(opMetaData, wsdlOperation, seiMethodMapping, typeMapping, wrappedParameters, wrappedResponseParameters);
+ wsdlPosition = processDocElement(opMetaData, wsdlOperation, bindingOperation, seiMethodMapping, typeMapping, wrappedParameters, wrappedResponseParameters);
wsdlPosition = processBindingParameters(opMetaData, wsdlOperation, seiMethodMapping, typeMapping, bindingOperation, wsdlPosition);
}
else
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ParameterMetaData.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ParameterMetaData.java 2007-01-16 04:03:22 UTC (rev 1976)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ParameterMetaData.java 2007-01-16 04:10:04 UTC (rev 1977)
@@ -132,6 +132,9 @@
Type valueType = (holder ? HolderUtils.getValueType(actualType) : actualType);
Class valueClass = JavaUtils.erasure(valueType);
+ // FIXME - Why do we need this hack? It shouldn't be needed. The method
+ // signature should _ALWAYS_ match, else we will get ambiguous or
+ // incorrect results
List<Class> anyTypes = new ArrayList<Class>();
anyTypes.add(javax.xml.soap.SOAPElement.class);
anyTypes.add(org.w3c.dom.Element.class);
@@ -312,11 +315,15 @@
this.soapArrayCompType = xmlType;
}
+
+ @Deprecated
+ // FIXME This hack should be removed
public boolean isMessageType()
{
return messageTypes.contains(javaTypeName);
}
+ @Deprecated
public static boolean isMessageType(String javaTypeName)
{
return messageTypes.contains(javaTypeName);
@@ -384,7 +391,8 @@
// reset java type
javaType = null;
- if (getOperationMetaData().isDocumentWrapped() && !isInHeader() && !isMessageType())
+ // FIXME - Remove messageType hack
+ if (getOperationMetaData().isDocumentWrapped() && !isInHeader() && !isSwA() && !isMessageType())
{
new DynamicWrapperGenerator(getClassLoader()).generate(this);
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingMessageReference.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingMessageReference.java 2007-01-16 04:03:22 UTC (rev 1976)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/wsdl/WSDLBindingMessageReference.java 2007-01-16 04:10:04 UTC (rev 1977)
@@ -23,6 +23,7 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.LinkedHashMap;
import java.util.List;
/**
@@ -39,7 +40,7 @@
private WSDLBindingOperation wsdlBindingOperation;
private NCName messageLabel;
private List<WSDLSOAPHeader> soapHeaders = new ArrayList<WSDLSOAPHeader>();
- private List<WSDLMIMEPart> mimeParts = new ArrayList<WSDLMIMEPart>();
+ private LinkedHashMap<String, WSDLMIMEPart> mimeParts = new LinkedHashMap<String, WSDLMIMEPart>();
public WSDLBindingMessageReference(WSDLBindingOperation wsdlBindingOperation)
{
@@ -111,7 +112,7 @@
*/
public void addMimePart(WSDLMIMEPart mimePart)
{
- this.mimeParts.add(mimePart);
+ this.mimeParts.put(mimePart.getPartName(), mimePart);
}
/**
@@ -121,6 +122,17 @@
*/
public Collection<WSDLMIMEPart> getMimeParts()
{
- return mimeParts;
+ return mimeParts.values();
}
+
+ /**
+ * Gets a specific MIME part
+ *
+ * @param partName the wsdl part name
+ * @return
+ */
+ public WSDLMIMEPart getMimePart(String partName)
+ {
+ return mimeParts.get(partName);
+ }
}
\ No newline at end of file
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2007-01-16 04:03:22 UTC (rev 1976)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2007-01-16 04:10:04 UTC (rev 1977)
@@ -126,7 +126,7 @@
// Temporary files used by this reader.
private List<File> tempFiles = new ArrayList<File>();
- // SWA handling
+ // SWA handling
private Map<QName, List<String>> skippedSWAParts = new HashMap<QName, List<String>>();
/**
@@ -536,7 +536,8 @@
for (Part srcPart : (List<Part>)srcMessage.getOrderedParts(paramOrder))
{
// Skip SWA attachment parts
- if( ignorePart(srcPortType, srcPart) ) continue;
+ if (ignorePart(srcPortType, srcPart))
+ continue;
if (Constants.URI_STYLE_DOCUMENT == destOperation.getStyle())
{
@@ -742,7 +743,7 @@
String style = destOperation.getStyle();
if (Constants.URI_STYLE_RPC.equals(style))
{
- // R2203 An rpc-literal binding in a DESCRIPTION MUST refer, in its soapbind:body element(s),
+ // R2203 An rpc-literal binding in a DESCRIPTION MUST refer, in its soapbind:body element(s),
// only to wsdl:part element(s) that have been defined using the type attribute.
if (srcPart.getName() == null)
throw new WSDLException(WSDLException.INVALID_WSDL, "RPC style message parts must define a typy name: " + srcMessage.getQName());
@@ -757,7 +758,7 @@
}
else
{
- // R2204 A document-literal binding in a DESCRIPTION MUST refer, in each of its soapbind:body element(s),
+ // R2204 A document-literal binding in a DESCRIPTION MUST refer, in each of its soapbind:body element(s),
// only to wsdl:part element(s) that have been defined using the element attribute
// [hb] do this only for non swa porttypes
if (srcPart.getElementName() == null)
@@ -1087,7 +1088,7 @@
public void removeReference(QName element)
{
WSDLInterfaceOperationInput destIntfInput = destIntfOperation.getInput(element);
- if (destIntfInput == null)
+ if (destIntfInput != null)
destIntfOperation.removeInput(element);
}
@@ -1120,7 +1121,7 @@
public void removeReference(QName element)
{
WSDLInterfaceOperationOutput destIntfOutput = destIntfOperation.getOutput(element);
- if (destIntfOutput == null)
+ if (destIntfOutput != null)
destIntfOperation.removeInput(element);
}
@@ -1217,7 +1218,6 @@
}
}
- // Found content types in this part
if (name != null)
{
QName xmlType = callback.getXmlType(name);
18 years