Author: heiko.braun(a)jboss.com
Date: 2007-03-19 16:06:28 -0400 (Mon, 19 Mar 2007)
New Revision: 2641
Added:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/CustomHandler.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/Message.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/ResponseMessage.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/TestDDOverrides.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/TestWSDDParser.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/WSDDEndpoint.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/WSDDEndpointImpl.java
trunk/jbossws-tests/src/resources/jaxws/wsdd/
trunk/jbossws-tests/src/resources/jaxws/wsdd/WEB-INF/
trunk/jbossws-tests/src/resources/jaxws/wsdd/WEB-INF/web.xml
trunk/jbossws-tests/src/resources/jaxws/wsdd/WEB-INF/webservices.xml
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java
trunk/jbossws-core/src/java/org/jboss/ws/core/CommonBindingProvider.java
trunk/jbossws-core/src/java/org/jboss/ws/core/EndpointInvocation.java
trunk/jbossws-core/src/java/org/jboss/ws/core/client/ServiceRefObjectFactory.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ServiceRefHandlerJAXWS.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EndpointInfo.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/ServiceRefMetaDataParser.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedPortComponentRefMetaData.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/webservices/PortComponentMetaData.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/webservices/WebservicesFactory.java
trunk/jbossws-tests/ant-import/build-jars-jaxws.xml
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/EJBClient.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefClientTestCase.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefEJBTestCase.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefServletTestCase.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServletClient.java
trunk/jbossws-tests/src/resources/jaxws/serviceref/META-INF/application-client.xml
trunk/jbossws-tests/src/resources/jaxws/serviceref/META-INF/ejb-jar.xml
trunk/jbossws-tests/src/resources/jaxws/serviceref/META-INF/jboss-client.xml
trunk/jbossws-tests/src/resources/jaxws/serviceref/servlet-client/WEB-INF/web.xml
Log:
Fix webservice.xml deployments (JSR-109, 1.2)
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java 2007-03-19
15:04:57 UTC (rev 2640)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java 2007-03-19
20:06:28 UTC (rev 2641)
@@ -29,9 +29,13 @@
import org.jboss.virtual.VirtualFile;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.integration.UnifiedVirtualFile;
import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
+import org.w3c.dom.Element;
+import java.io.IOException;
+
/**
* A deployer JAXRPC JSE Endpoints
*
@@ -40,6 +44,8 @@
*/
public class JAXRPCDeployerJSE extends AbstractDeployerJSE
{
+ private static final String WEBSERVICES_XML = "webservices.xml";
+
@Override
protected DeploymentType getDeploymentType()
{
@@ -58,13 +64,29 @@
@Override
public boolean isWebServiceDeployment(DeploymentUnit unit)
{
- boolean hasWebMetaData = unit.getAllMetaData(WebMetaData.class).size() > 0;
- return hasWebMetaData && getWebServicesFile(unit) != null;
+ boolean isWebserviceDeployment = unit.getAllMetaData(WebMetaData.class).size() >
0;
+ isWebserviceDeployment = (isWebserviceDeployment &&
getWebServicesFile(unit) != null);
+
+ if(isWebserviceDeployment)
+ {
+ // verify the DD namespace
+ try
+ {
+ Element root = DOMUtils.parse(
unit.getMetaDataFile(WEBSERVICES_XML).openStream() );
+ isWebserviceDeployment = (isWebserviceDeployment &&
root.getNamespaceURI().equals("http://java.sun.com/xml/ns/j2ee"));
+ }
+ catch (IOException e)
+ {
+ throw new IllegalArgumentException("Failed to parse
webservice.xml", e);
+ }
+ }
+
+ return isWebserviceDeployment;
}
private UnifiedVirtualFile getWebServicesFile(DeploymentUnit unit)
{
- VirtualFile vfile = unit.getMetaDataFile("webservices.xml");
+ VirtualFile vfile = unit.getMetaDataFile(WEBSERVICES_XML);
return vfile != null ? new VirtualFileAdaptor(vfile) : null;
}
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/CommonBindingProvider.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/CommonBindingProvider.java 2007-03-19
15:04:57 UTC (rev 2640)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/CommonBindingProvider.java 2007-03-19
20:06:28 UTC (rev 2641)
@@ -35,6 +35,8 @@
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData.Type;
+import javax.xml.ws.soap.SOAPBinding;
+
/**
* Provides access to the protocol binding.
*
@@ -84,7 +86,6 @@
{
throw new WSException("Unsupported binding: " + bindingId);
}
-
}
public CommonBinding getCommonBinding()
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/EndpointInvocation.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/EndpointInvocation.java 2007-03-19
15:04:57 UTC (rev 2640)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/EndpointInvocation.java 2007-03-19
20:06:28 UTC (rev 2641)
@@ -211,7 +211,7 @@
// Conformance (MIME type mismatch): On receipt of a message where the MIME
type of a part does not
// match that described in the WSDL an implementation SHOULD throw a
WebServiceException.
if (mimeTypes != null && !MimeUtils.isMemberOf(mimeType, mimeTypes))
- log.warn("Mime type " + mimeType + " not allowed for
parameter " + xmlName + " allowed types are " + mimeTypes);
+ throw new SOAPException("Mime type " + mimeType + " not
allowed for parameter " + xmlName + " allowed types are " + mimeTypes);
retValue = part.getDataHandler();
}
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/client/ServiceRefObjectFactory.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/client/ServiceRefObjectFactory.java 2007-03-19
15:04:57 UTC (rev 2640)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/client/ServiceRefObjectFactory.java 2007-03-19
20:06:28 UTC (rev 2641)
@@ -134,8 +134,7 @@
Object child = null;
if (localName.equals("port-component-ref"))
{
- child = new UnifiedPortComponentRefMetaData(ref);
- ref.addPortComponentRef((UnifiedPortComponentRefMetaData)child);
+ child = new UnifiedPortComponentRefMetaData(ref);
}
else if (localName.equals("handler"))
{
@@ -171,6 +170,7 @@
if (localName.equals("service-endpoint-interface"))
{
ref.setServiceEndpointInterface(value);
+ ref.getServiceRefMetaData().addPortComponentRef(ref);
}
else if (localName.equals("enable-mtom"))
{
@@ -182,7 +182,17 @@
}
else if (localName.equals("port-qname"))
{
- ref.setPortQName(QName.valueOf(value));
+ QName portQName = QName.valueOf(value);
+ ref.setPortQName(portQName);
+
+ UnifiedPortComponentRefMetaData portComponentRef =
ref.getServiceRefMetaData().getPortComponentRef(
+ ref.getServiceEndpointInterface(), portQName
+ );
+
+ if(portComponentRef == null)
+ ref.getServiceRefMetaData().addPortComponentRef(ref);
+ else
+ portComponentRef.setPortQName(portQName);
}
else if (localName.equals("config-name"))
{
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ServiceRefHandlerJAXWS.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ServiceRefHandlerJAXWS.java 2007-03-19
15:04:57 UTC (rev 2640)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/ServiceRefHandlerJAXWS.java 2007-03-19
20:06:28 UTC (rev 2641)
@@ -167,6 +167,7 @@
// Do not use rebind, the binding should be unique
// [JBWS-1499] - Revisit WebServiceRefHandler JNDI rebind
- Util.rebind(encCtx, encName, new ServiceReferenceable(serviceImplClass,
targetClassName, serviceRef));
+ Util.bind(encCtx, encName, new ServiceReferenceable(serviceImplClass,
targetClassName, serviceRef));
+
}
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EndpointInfo.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EndpointInfo.java 2007-03-19
15:04:57 UTC (rev 2640)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EndpointInfo.java 2007-03-19
20:06:28 UTC (rev 2641)
@@ -60,17 +60,15 @@
// Add the endpoint properties
Properties epProps = epMetaData.getProperties();
- if (epProps != null)
+ Iterator it = epProps.entrySet().iterator();
+ while (it.hasNext())
{
- Iterator it = epProps.entrySet().iterator();
- while (it.hasNext())
- {
- Map.Entry entry = (Map.Entry)it.next();
- String key = (String)entry.getKey();
- Object val = entry.getValue();
- properties.put(key, val);
- }
+ Map.Entry entry = (Map.Entry)it.next();
+ String key = (String)entry.getKey();
+ Object val = entry.getValue();
+ properties.put(key, val);
}
+
}
public Map<String, Object> getProperties()
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2007-03-19
15:04:57 UTC (rev 2640)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSClientMetaDataBuilder.java 2007-03-19
20:06:28 UTC (rev 2641)
@@ -25,6 +25,7 @@
import java.io.IOException;
import java.net.URL;
+import java.util.*;
import javax.jws.soap.SOAPBinding;
import javax.xml.namespace.QName;
@@ -33,6 +34,7 @@
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.jaxws.client.ServiceObjectFactory;
import org.jboss.ws.integration.ResourceLoaderAdapter;
import org.jboss.ws.integration.UnifiedVirtualFile;
import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
@@ -50,6 +52,9 @@
import org.jboss.ws.metadata.wsdl.WSDLService;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedStubPropertyMetaData;
/**
* A client side meta data builder.
@@ -125,6 +130,7 @@
throw new IllegalArgumentException("Cannot obtain wsdl service: " +
serviceName);
// Build endpoint meta data
+
for (WSDLEndpoint wsdlEndpoint : wsdlService.getEndpoints())
{
QName portName = wsdlEndpoint.getName();
@@ -140,9 +146,69 @@
initEndpointEncodingStyle(epMetaData);
setupOperationsFromWSDL(epMetaData, wsdlEndpoint);
+
+ // service-ref contributions
+ bufferServiceRefContributions(epMetaData);
+
}
}
+ /**
+ * Buffer portComponent information that it can be reused
+ * when rebuild is called (actually getPort(...))
+ * @param epMetaData
+ */
+ private void bufferServiceRefContributions(EndpointMetaData epMetaData)
+ {
+ UnifiedServiceRefMetaData serviceRefMetaData =
ServiceObjectFactory.getServiceRefAssociation();
+
+ if(serviceRefMetaData!=null)
+ {
+ for(UnifiedPortComponentRefMetaData portComp :
serviceRefMetaData.getPortComponentRefs())
+ {
+ epMetaData.getServiceRefContrib().add(portComp);
+ }
+ }
+ }
+
+ /**
+ * ServiceRef deployment descriptor elements may override the endpoint metadata.
+ * @param epMetaData
+ */
+ private void processServiceRefContributions(EndpointMetaData epMetaData)
+ {
+
+ Iterator<UnifiedPortComponentRefMetaData> it =
epMetaData.getServiceRefContrib().iterator();
+
+ while(it.hasNext())
+ {
+ UnifiedPortComponentRefMetaData portComp = it.next();
+
+ if(epMetaData.matches(portComp))
+ {
+ log.debug("Processing service-ref contribution on portType:
"+epMetaData.getPortTypeName());
+
+ // process MTOM overrides
+ if(portComp.getEnableMTOM())
+ {
+ String bindingId = epMetaData.getBindingId();
+ if(bindingId.equals(Constants.SOAP11HTTP_BINDING))
+ epMetaData.setBindingId(Constants.SOAP11HTTP_MTOM_BINDING);
+ else if(bindingId.equals(Constants.SOAP12HTTP_BINDING))
+ epMetaData.setBindingId(Constants.SOAP12HTTP_MTOM_BINDING);
+ }
+
+ // process stub properties
+ for(UnifiedStubPropertyMetaData stubProp: portComp.getStubProperties())
+ {
+ epMetaData.getProperties().put(stubProp.getPropName(),
stubProp.getPropValue());
+ }
+ }
+
+ }
+
+ }
+
protected void setupOperationsFromWSDL(EndpointMetaData epMetaData, WSDLEndpoint
wsdlEndpoint)
{
WSDLDefinitions wsdlDefinitions =
wsdlEndpoint.getInterface().getWsdlDefinitions();
@@ -210,6 +276,10 @@
// Set SEI name
epMetaData.setServiceEndpointInterfaceName(wsClass.getName());
+ // service-ref contributions
+ processServiceRefContributions(epMetaData);
+ //epMetaData.getServiceRefContrib().clear();
+
// Eager initialization
epMetaData.eagerInitialize();
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-03-19
15:04:57 UTC (rev 2640)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-03-19
20:06:28 UTC (rev 2641)
@@ -23,10 +23,7 @@
// $Id$
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.io.Writer;
+import java.io.*;
import java.net.URL;
import javax.jws.HandlerChain;
@@ -40,16 +37,20 @@
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
import org.jboss.ws.core.utils.IOUtils;
import org.jboss.ws.metadata.builder.MetaDataBuilder;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.metadata.umdm.ServiceMetaData;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+import org.jboss.ws.metadata.umdm.*;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
import org.jboss.ws.metadata.wsse.WSSecurityConfigFactory;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
import org.jboss.ws.metadata.wsse.WSSecurityOMFactory;
+import org.jboss.ws.metadata.webservices.WebservicesMetaData;
+import org.jboss.ws.metadata.webservices.WebservicesFactory;
+import org.jboss.ws.metadata.webservices.WebserviceDescriptionMetaData;
+import org.jboss.ws.metadata.webservices.PortComponentMetaData;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
import org.jboss.ws.tools.ToolsUtils;
import org.jboss.ws.tools.jaxws.JAXBWSDLGenerator;
import org.jboss.ws.tools.wsdl.WSDLGenerator;
@@ -72,7 +73,7 @@
private boolean toolMode = false;
private File wsdlDirectory = null;
private PrintStream messageStream = null;
-
+
private static class EndpointResult
{
private Class<?> epClass;
@@ -80,7 +81,7 @@
private ServiceMetaData serviceMetaData;
private URL wsdlLocation;
}
-
+
public void setGenerateWsdl(boolean generateWsdl)
{
this.generateWsdl = generateWsdl;
@@ -140,7 +141,7 @@
WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
JBossXSModel schemaModel =
WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());
serviceMetaData.getTypesMetaData().setSchemaModel(schemaModel);
-
+
// process config
processEndpointConfig(udi, sepClass, linkName, sepMetaData);
@@ -156,6 +157,9 @@
else if (seiClass.isAnnotationPresent(HandlerChain.class))
processHandlerChain(sepMetaData, seiClass);
+ // process webservices.xml contributions
+ processWSDDContribution(sepMetaData);
+
// Init the endpoint address
MetaDataBuilder.initEndpointAddress(udi, sepMetaData, linkName);
@@ -165,7 +169,7 @@
MetaDataBuilder.replaceAddressLocation(sepMetaData);
processEndpointMetaDataExtensions(sepMetaData, wsdlDefinitions);
-
+
// init service endpoint id
ObjectName sepID = MetaDataBuilder.createServiceEndpointID(udi, sepMetaData);
sepMetaData.setServiceEndpointID(sepID);
@@ -181,7 +185,58 @@
throw new WSException("Cannot build meta data: " + ex.getMessage(),
ex);
}
}
-
+
+ /**
+ * With JAX-WS the use of webservices.xml is optional since the annotations can be
used
+ * to specify most of the information specified in this deployment descriptor file.
+ * The deployment descriptors are only used to override or augment the annotation
member attributes.
+ * @param sepMetaData
+ */
+ private void processWSDDContribution(ServerEndpointMetaData sepMetaData)
+ {
+ WebservicesMetaData webservices =
WebservicesFactory.loadFromVFSRoot(sepMetaData.getRootFile());
+ if(webservices!=null)
+ {
+ for(WebserviceDescriptionMetaData wsDesc :
webservices.getWebserviceDescriptions())
+ {
+ for(PortComponentMetaData portComp : wsDesc.getPortComponents())
+ {
+ if(portComp.getWsdlPort().equals(sepMetaData.getPortName()))
+ {
+
+ log.debug("Processing 'webservices.xml' handler
contributions");
+ UnifiedHandlerChainsMetaData chainWrapper =
portComp.getHandlerChains();
+ if(chainWrapper!=null)
+ {
+ for(UnifiedHandlerChainMetaData handlerChain :
chainWrapper.getHandlerChains())
+ {
+ for (UnifiedHandlerMetaData uhmd : handlerChain.getHandlers())
+ {
+ HandlerMetaDataJAXWS handlerMetaDataJAXWS =
uhmd.getHandlerMetaDataJAXWS(sepMetaData, HandlerMetaData.HandlerType.ENDPOINT);
+ sepMetaData.addHandler(handlerMetaDataJAXWS);
+ log.debug("Handler contribution from webservices.xml:
" + handlerMetaDataJAXWS.getHandlerName());
+ }
+ }
+ }
+
+ log.debug("Processing MTOM contributions");
+ if(portComp.isEnableMtom())
+ {
+ String bindingId = sepMetaData.getBindingId();
+ if(bindingId.equals(Constants.SOAP11HTTP_BINDING))
+ sepMetaData.setBindingId(Constants.SOAP11HTTP_MTOM_BINDING);
+ else if(bindingId.equals(Constants.SOAP12HTTP_BINDING))
+ sepMetaData.setBindingId(Constants.SOAP12HTTP_MTOM_BINDING);
+
+ }
+
+ }
+ }
+ }
+
+ }
+ }
+
private EndpointResult processWebService(UnifiedMetaData wsMetaData, Class<?>
sepClass, UnifiedDeploymentInfo udi) throws ClassNotFoundException, IOException
{
WebService endpointImplAnnotation = sepClass.getAnnotation(WebService.class);
@@ -275,7 +330,7 @@
wsdlDefinitions.getWsdlTypes().setNamespace(epMetaData.getPortTypeName().getNamespaceURI());
final File dir, wsdlFile;
-
+
if (wsdlDirectory != null)
{
dir = wsdlDirectory;
@@ -298,7 +353,7 @@
{
file = new File(dir, suggestedFile + ".wsdl");
}
- else
+ else
{
file = File.createTempFile(suggestedFile, ".wsdl", dir);
file.deleteOnExit();
@@ -324,7 +379,7 @@
}
}
}
-
+
private void message(String msg)
{
if (messageStream != null)
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/ServiceRefMetaDataParser.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/ServiceRefMetaDataParser.java 2007-03-19
15:04:57 UTC (rev 2640)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/ServiceRefMetaDataParser.java 2007-03-19
20:06:28 UTC (rev 2641)
@@ -37,7 +37,7 @@
*
* @author Thomas.Diesler(a)jboss.org
*/
-public class ServiceRefMetaDataParser
+public class ServiceRefMetaDataParser
{
public void importStandardXml(Element root, UnifiedServiceRefMetaData sref)
{
@@ -70,7 +70,7 @@
sref.addHandler(handlerMetaData);
}
}
-
+
public void importJBossXml(Element root, UnifiedServiceRefMetaData sref)
{
sref.setConfigName(getOptionalElementContent(root, "config-name"));
@@ -83,18 +83,19 @@
{
Element pcrefElement = (Element)iterator.next();
String seiName = getOptionalElementContent(pcrefElement,
"service-endpoint-interface");
- if (seiName != null)
+ String portNameString = getOptionalElementContent(pcrefElement,
"port-qname");
+ QName portName = portNameString!=null ? QName.valueOf(portNameString) : null;
+
+ UnifiedPortComponentRefMetaData pcref = sref.getPortComponentRef(seiName,
portName);
+ if (pcref == null)
{
- UnifiedPortComponentRefMetaData pcref = sref.getPortComponentRef(seiName);
- if (pcref == null)
- {
- // Its ok to only have the <port-component-ref> in jboss.xml and not
in ejb-jar.xml
- pcref = new UnifiedPortComponentRefMetaData(sref);
- pcref.importStandardXml(pcrefElement);
- sref.addPortComponentRef(pcref);
- }
- pcref.importJBossXml(pcrefElement);
+ // Its ok to only have the <port-component-ref> in jboss.xml and not in
ejb-jar.xml
+ pcref = new UnifiedPortComponentRefMetaData(sref);
+ pcref.importStandardXml(pcrefElement);
+ sref.addPortComponentRef(pcref);
}
+ pcref.importJBossXml(pcrefElement);
+
}
// Parse the call-property elements
@@ -108,6 +109,7 @@
}
}
+
public void importStandardXml(Element root, UnifiedPortComponentRefMetaData pcref)
{
pcref.setServiceEndpointInterface(getOptionalElementContent(root,
"service-endpoint-interface"));
@@ -126,7 +128,7 @@
pcref.addCallProperty(new UnifiedCallPropertyMetaData(name, value));
}
}
-
+
public void importStandardXml(Element root, UnifiedHandlerMetaData href)
{
href.setHandlerName(getElementContent(root, "handler-name"));
@@ -171,21 +173,21 @@
href.addPortName(content);
}
}
-
+
private String getElementContent(Element element, String childName)
{
String childValue = getOptionalElementContent(element, childName);
if (childValue == null || childValue.length() == 0)
throw new IllegalStateException("Invalid null element content: " +
childName);
-
+
return childValue;
}
-
+
private String getOptionalElementContent(Element element, String childName)
{
return getTextContent(DOMUtils.getFirstChildElement(element, childName));
}
-
+
private String getTextContent(Element element)
{
String content = null;
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedPortComponentRefMetaData.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedPortComponentRefMetaData.java 2007-03-19
15:04:57 UTC (rev 2640)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedPortComponentRefMetaData.java 2007-03-19
20:06:28 UTC (rev 2641)
@@ -23,16 +23,13 @@
// $Id$
+import org.jboss.ws.integration.ServiceRefElement;
+import org.w3c.dom.Element;
+
+import javax.xml.namespace.QName;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
-import javax.xml.namespace.QName;
-
-import org.jboss.ws.core.utils.DOMUtils;
-import org.jboss.ws.integration.ServiceRefElement;
-import org.w3c.dom.Element;
-
/** The metdata data from service-ref/port-component-ref element in web.xml, ejb-jar.xml,
and application-client.xml.
*
* @author Thomas.Diesler(a)jboss.org
@@ -45,14 +42,14 @@
// The required <service-endpoint-interface> element
private String serviceEndpointInterface;
// The optional <enable-mtom> element
- private Boolean enableMTOM;
+ private Boolean enableMTOM = Boolean.FALSE;
// The optional <port-component-link> element
private String portComponentLink;
// The optional <port-qname> element
private QName portQName;
- // Arbitrary proxy properties given by <call-property>
+ // Arbitrary proxy properties given by <call-property>
private List<UnifiedCallPropertyMetaData> callProperties = new
ArrayList<UnifiedCallPropertyMetaData>();
- // Arbitrary proxy properties given by <stub-property>
+ // Arbitrary proxy properties given by <stub-property>
private List<UnifiedStubPropertyMetaData> stubProperties = new
ArrayList<UnifiedStubPropertyMetaData>();
// The optional JBossWS config-name
private String configName;
@@ -70,9 +67,9 @@
configName = pcref.configName;
configFile = pcref.configFile;
callProperties = pcref.callProperties;
- stubProperties = pcref.stubProperties;
+ stubProperties = pcref.stubProperties;
}
-
+
public UnifiedServiceRefMetaData getServiceRefMetaData()
{
return serviceRefMetaData;
@@ -188,4 +185,17 @@
{
new ServiceRefMetaDataParser().importJBossXml(root, this);
}
+
+ public boolean matches(String seiName, QName portName)
+ {
+ boolean match;
+ if (seiName != null && portName != null)
+ match = seiName.equals(getServiceEndpointInterface()) &&
portName.equals(getPortQName());
+ else if (seiName != null)
+ match = seiName.equals(getServiceEndpointInterface());
+ else
+ match = portName.equals(getPortQName());
+
+ return match;
+ }
}
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java 2007-03-19
15:04:57 UTC (rev 2640)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java 2007-03-19
20:06:28 UTC (rev 2641)
@@ -119,11 +119,12 @@
String seiName = pcref.getServiceEndpointInterface();
if (seiName == null)
{
- log.warn("Ignore <port-component-ref> with null
<service-endpoint-interface>");
- continue;
+ log.warn("*** Ignore <port-component-ref> with null
<service-endpoint-interface>");
+ //continue;
}
- UnifiedPortComponentRefMetaData targetPCRef = getPortComponentRef(seiName);
+ UnifiedPortComponentRefMetaData targetPCRef = getPortComponentRef(seiName,
pcref.getPortQName());
+
if (targetPCRef == null)
{
log.warn("Cannot find port component ref with SEI name: " +
seiName);
@@ -187,6 +188,7 @@
return portComponentRefs;
}
+ @Deprecated
public UnifiedPortComponentRefMetaData getPortComponentRef(String seiName)
{
if (seiName == null)
@@ -199,6 +201,21 @@
return null;
}
+ public UnifiedPortComponentRefMetaData getPortComponentRef(String seiName, QName
portName)
+ {
+ UnifiedPortComponentRefMetaData matchingRef = null;
+
+ for (UnifiedPortComponentRefMetaData ref : portComponentRefs)
+ {
+ if(ref.matches(seiName, portName))
+ {
+ matchingRef = ref;
+ break;
+ }
+ }
+ return matchingRef;
+ }
+
public void addPortComponentRef(UnifiedPortComponentRefMetaData pcRef)
{
portComponentRefs.add(pcRef);
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-03-19
15:04:57 UTC (rev 2640)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-03-19
20:06:28 UTC (rev 2641)
@@ -61,6 +61,7 @@
import org.jboss.ws.metadata.config.EndpointFeature;
import org.jboss.ws.metadata.config.JBossWSConfigFactory;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerType;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
/**
* A Service component describes a set of endpoints.
@@ -129,6 +130,8 @@
private JAXBContextCache jaxbCache = new JAXBContextCache();
+ private List<UnifiedPortComponentRefMetaData> serviceRefContrib = new
ArrayList<UnifiedPortComponentRefMetaData>();
+
public EndpointMetaData(ServiceMetaData service, QName portName, QName portTypeName,
Type type)
{
this.serviceMetaData = service;
@@ -319,7 +322,9 @@
public Properties getProperties()
{
- return properties;
+ if(null == this.properties)
+ this.properties = new Properties();
+ return this.properties;
}
public void setProperties(Properties properties)
@@ -709,4 +714,23 @@
notifyObservers(object);
}
}
+
+ public List<UnifiedPortComponentRefMetaData> getServiceRefContrib()
+ {
+ return serviceRefContrib;
+ }
+
+ public boolean matches(UnifiedPortComponentRefMetaData pcRef)
+ {
+ String seiName = pcRef.getServiceEndpointInterface();
+ QName portName = pcRef.getPortQName();
+
+ boolean match;
+ if (seiName != null && portName != null)
+ match = getServiceEndpointInterfaceName().equals(seiName) &&
portName.equals(portName);
+ else
+ match = getServiceEndpointInterfaceName().equals(seiName) ||
getPortName().equals(portName);
+
+ return match;
+ }
}
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/metadata/webservices/PortComponentMetaData.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/webservices/PortComponentMetaData.java 2007-03-19
15:04:57 UTC (rev 2640)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/webservices/PortComponentMetaData.java 2007-03-19
20:06:28 UTC (rev 2641)
@@ -31,6 +31,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
/**
* XML Binding and ws4ee meta-data element for
@@ -73,9 +74,18 @@
// The HTTP context root
private String contextRoot;
- // The optional secure wsdl access
+ // The optional secure wsdl access
private Boolean secureWSDLAccess;
+ // -----------------------------------------
+ // JAX-WS additions
+
+ private boolean enableMtom;
+ private QName wsdlService;
+ private String protocolBinding;
+ private UnifiedHandlerChainsMetaData handlerChains;
+
+
/** Construct a new PortComponentMetaData for a given WebserviceDescriptionMetaData
*/
public PortComponentMetaData(WebserviceDescriptionMetaData webserviceDescription)
@@ -173,6 +183,46 @@
this.secureWSDLAccess = secureWSDLAccess;
}
+ public boolean isEnableMtom()
+ {
+ return enableMtom;
+ }
+
+ public void setEnableMtom(boolean enableMtom)
+ {
+ this.enableMtom = enableMtom;
+ }
+
+ public QName getWsdlService()
+ {
+ return wsdlService;
+ }
+
+ public void setWsdlService(QName wsdlService)
+ {
+ this.wsdlService = wsdlService;
+ }
+
+ public String getProtocolBinding()
+ {
+ return protocolBinding;
+ }
+
+ public void setProtocolBinding(String protocolBinding)
+ {
+ this.protocolBinding = protocolBinding;
+ }
+
+ public UnifiedHandlerChainsMetaData getHandlerChains()
+ {
+ return handlerChains;
+ }
+
+ public void setHandlerChains(UnifiedHandlerChainsMetaData handlerChains)
+ {
+ this.handlerChains = handlerChains;
+ }
+
public String serialize()
{
StringBuilder builder = new StringBuilder("<port-component>");
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/metadata/webservices/WebservicesFactory.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/webservices/WebservicesFactory.java 2007-03-19
15:04:57 UTC (rev 2640)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/webservices/WebservicesFactory.java 2007-03-19
20:06:28 UTC (rev 2641)
@@ -23,15 +23,23 @@
// $Id$
-import java.net.URL;
-
import org.jboss.logging.Logger;
+import org.jboss.ws.integration.UnifiedVirtualFile;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
import org.jboss.ws.metadata.j2ee.serviceref.UnifiedInitParamMetaData;
+import org.jboss.ws.WSException;
import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
import org.jboss.xb.binding.UnmarshallingContext;
import org.xml.sax.Attributes;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
/**
* A JBossXB factory for {@link WebservicesMetaData}
*
@@ -52,6 +60,62 @@
}
/**
+ * Load webservices.xml from <code>META-INF/webservices.xml</code>
+ * or <code>WEB-INF/webservices.xml</code>.
+ *
+ * @param root virtual file root
+ * @return WebservicesMetaData or <code>null</code> if it cannot be found
+ */
+ public static WebservicesMetaData loadFromVFSRoot(UnifiedVirtualFile root)
+ {
+ WebservicesMetaData webservices = null;
+
+ UnifiedVirtualFile wsdd = null;
+ try
+ {
+ wsdd = root.findChild("META-INF/webservices.xml");
+ }
+ catch (IOException e)
+ {
+ //
+ }
+
+ // Maybe a web application deployment?
+ if(null == wsdd)
+ {
+ try
+ {
+ wsdd = root.findChild("WEB-INF/webservices.xml");
+ }
+ catch (IOException e)
+ {
+ //
+ }
+ }
+
+ // the descriptor is optional
+ if(wsdd!=null)
+ {
+
+ URL wsddUrl = wsdd.toURL();
+ try
+ {
+ InputStream is = wsddUrl.openStream();
+ Unmarshaller unmarshaller =
UnmarshallerFactory.newInstance().newUnmarshaller();
+ ObjectModelFactory factory = new WebservicesFactory(wsddUrl);
+ webservices = (WebservicesMetaData)unmarshaller.unmarshal(is, factory,
null);
+ is.close();
+ }
+ catch(Exception e)
+ {
+ throw new WSException("Failed to unmarshall webservices.xml:" +
e.getMessage());
+ }
+ }
+
+ return webservices;
+ }
+
+ /**
* This method is called on the factory by the object model builder when the parsing
starts.
*
* @return the root of the object model.
@@ -81,7 +145,7 @@
* Called when parsing character is complete.
*/
public void addChild(WebservicesMetaData webservices, WebserviceDescriptionMetaData
webserviceDescription, UnmarshallingContext navigator, String namespaceURI,
- String localName)
+ String localName)
{
webservices.addWebserviceDescription(webserviceDescription);
}
@@ -100,7 +164,7 @@
* Called when parsing character is complete.
*/
public void addChild(WebserviceDescriptionMetaData webserviceDescription,
PortComponentMetaData portComponent, UnmarshallingContext navigator, String namespaceURI,
- String localName)
+ String localName)
{
webserviceDescription.addPortComponent(portComponent);
}
@@ -112,10 +176,33 @@
{
if ("handler".equals(localName))
return new UnifiedHandlerMetaData(null);
+ else if ("handler-chains".equals(localName))
+ return new UnifiedHandlerChainsMetaData();
else return null;
}
/**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(UnifiedHandlerChainsMetaData handlerChains,
UnmarshallingContext navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ if ("handler-chain".equals(localName))
+ return new UnifiedHandlerChainMetaData();
+ else return null;
+ }
+
+ /**
+ * Called when parsing of a new element started.
+ */
+ public Object newChild(UnifiedHandlerChainMetaData handlerChains, UnmarshallingContext
navigator, String namespaceURI, String localName, Attributes attrs)
+ {
+ if ("handler".equals(localName))
+ return new UnifiedHandlerMetaData();
+ else return null;
+ }
+
+
+ /**
* Called when parsing character is complete.
*/
public void addChild(PortComponentMetaData portComponent, UnifiedHandlerMetaData
handler, UnmarshallingContext navigator, String namespaceURI, String localName)
@@ -124,6 +211,30 @@
}
/**
+ * Called when parsing character is complete.
+ */
+ public void addChild(PortComponentMetaData portComponent, UnifiedHandlerChainsMetaData
handlerChains, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ portComponent.setHandlerChains(handlerChains);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(UnifiedHandlerChainsMetaData chains, UnifiedHandlerChainMetaData
handlerChain, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ chains.addHandlerChain(handlerChain);
+ }
+
+ /**
+ * Called when parsing character is complete.
+ */
+ public void addChild(UnifiedHandlerChainMetaData chain, UnifiedHandlerMetaData
handler, UnmarshallingContext navigator, String namespaceURI, String localName)
+ {
+ chain.addHandler(handler);
+ }
+
+ /**
* Called when parsing of a new element started.
*/
public Object newChild(UnifiedHandlerMetaData handler, UnmarshallingContext navigator,
String namespaceURI, String localName, Attributes attrs)
@@ -175,6 +286,14 @@
portComponent.setEjbLink(value);
else if (localName.equals("servlet-link"))
portComponent.setServletLink(value);
+ else if (localName.equals("wsdl-service"))
+ portComponent.setWsdlService(navigator.resolveQName(value));
+ else if (localName.equals("protocol-binding"))
+ portComponent.setProtocolBinding(value);
+ else if (localName.equals("enable-mtom"))
+ portComponent.setEnableMtom(Boolean.valueOf(value));
+
+
}
/**
@@ -193,7 +312,7 @@
handler.addSoapHeader(navigator.resolveQName(value));
else if (localName.equals("soap-role"))
handler.addSoapRole(value);
- else if (localName.equals("port-name"))
+ else if (localName.equals("port-name"))
handler.addPortName(value);
}
Modified: trunk/jbossws-tests/ant-import/build-jars-jaxws.xml
===================================================================
--- trunk/jbossws-tests/ant-import/build-jars-jaxws.xml 2007-03-19 15:04:57 UTC (rev
2640)
+++ trunk/jbossws-tests/ant-import/build-jars-jaxws.xml 2007-03-19 20:06:28 UTC (rev
2641)
@@ -303,6 +303,9 @@
<webinf
dir="${tests.output.dir}/resources/jaxws/serviceref/META-INF">
<include name="wsdl/**"/>
</webinf>
+ <webinf
dir="${tests.output.dir}/resources/jaxws/serviceref/servlet-client/WEB-INF">
+ <include name="jboss-web.xml"/>
+ </webinf>
</war>
<jar
destfile="${tests.output.dir}/libs/jaxws-serviceref-ejb-client.jar">
<fileset dir="${tests.output.dir}/classes">
@@ -313,6 +316,7 @@
</fileset>
<metainf
dir="${tests.output.dir}/resources/jaxws/serviceref/META-INF">
<include name="ejb-jar.xml"/>
+ <include name="jboss.xml"/>
<include name="wsdl/**"/>
</metainf>
</jar>
@@ -333,6 +337,17 @@
</classes>
</war>
+ <!-- jaxws-wsdd -->
+ <war warfile="${tests.output.dir}/libs/jaxws-wsdd.war"
+ webxml="${tests.output.dir}/resources/jaxws/wsdd/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/wsdd/*.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/resources/jaxws/wsdd/WEB-INF">
+ <include name="webservices.xml"/>
+ </webinf>
+ </war>
+
<!-- jaxws-wsaddressing-action -->
<war
warfile="${tests.output.dir}/libs/jaxws-wsaddressing-action-rpc.war"
webxml="${tests.output.dir}/resources/jaxws/wsaddressing/action/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/EJBClient.java
===================================================================
---
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/EJBClient.java 2007-03-19
15:04:57 UTC (rev 2640)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/EJBClient.java 2007-03-19
20:06:28 UTC (rev 2641)
@@ -21,18 +21,18 @@
*/
package org.jboss.test.ws.jaxws.serviceref;
-import java.rmi.RemoteException;
-import java.util.ArrayList;
+import org.jboss.annotation.ejb.RemoteBinding;
+import org.jboss.logging.Logger;
import javax.ejb.Remote;
import javax.ejb.Stateless;
-import javax.naming.InitialContext;
-import javax.xml.ws.Service;
+import javax.xml.ws.BindingProvider;
import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceRef;
+import javax.xml.ws.soap.SOAPBinding;
+import java.rmi.RemoteException;
+import java.util.ArrayList;
-import org.jboss.annotation.ejb.RemoteBinding;
-import org.jboss.logging.Logger;
-
@Remote(EJBRemote.class)
@RemoteBinding(jndiBinding = "/ejb/EJBClient")
@Stateless
@@ -42,26 +42,43 @@
// Provide logging
private static Logger log = Logger.getLogger(EJBClient.class);
+ @WebServiceRef(name = "port1")
+ TestEndpoint port1;
+
+ @WebServiceRef(name = "port2")
+ TestEndpoint port2;
+
public String echo(String inStr) throws RemoteException
{
log.info("echo: " + inStr);
- ArrayList ports = new ArrayList();
- try
+ ArrayList ports = new ArrayList(2);
+ ports.add(port1);
+ ports.add(port2);
+
+ /*try
{
InitialContext iniCtx = new InitialContext();
-
ports.add((TestEndpoint)((Service)iniCtx.lookup("java:comp/env/service1")).getPort(TestEndpoint.class));
-
ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/service2")).getTestEndpointPort());
+
ports.add((TestEndpoint)((Service)iniCtx.lookup("java:comp/env/port1")).getPort(TestEndpoint.class));
+
ports.add(((TestEndpointService)iniCtx.lookup("java:comp/env/port2")).getTestEndpointPort());
}
catch (Exception ex)
{
log.error("Cannot add port", ex);
- throw new WebServiceException(ex);
- }
+ //throw new WebServiceException(ex);
+ } */
for (int i = 0; i < ports.size(); i++)
{
TestEndpoint port = (TestEndpoint)ports.get(i);
+
+ BindingProvider bp = (BindingProvider)port;
+ boolean mtomEnabled = ((SOAPBinding)bp.getBinding()).isMTOMEnabled();
+ boolean expectedSetting = (i==0) ? false : true;
+
+ if(mtomEnabled != expectedSetting)
+ throw new WebServiceException("MTOM settings
(enabled="+expectedSetting+") not overridden through service-ref" );
+
String outStr = port.echo(inStr);
if (inStr.equals(outStr) == false)
throw new WebServiceException("Invalid echo return: " + inStr);
Modified:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefClientTestCase.java
===================================================================
---
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefClientTestCase.java 2007-03-19
15:04:57 UTC (rev 2640)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefClientTestCase.java 2007-03-19
20:06:28 UTC (rev 2641)
@@ -27,6 +27,7 @@
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
+import javax.naming.InitialContext;
import junit.framework.Test;
@@ -65,13 +66,24 @@
Service service = Service.create(wsdlURL, qname);
TestEndpoint port = (TestEndpoint)service.getPort(TestEndpoint.class);
- String helloWorld = "Hello World!";
- Object retObj = port.echo(helloWorld);
- assertEquals(helloWorld, retObj);
+ String request = "testDynamicProxy";
+ String response = port.echo(request);
+ assertEquals(request, response);
}
- public void testAppClient() throws Exception
+ public void testApplicationClient() throws Exception
{
System.out.println("FIXME: [JBWS-1576] Implement jaxws <service-ref>
from deployment descriptor");
+
+ /*InitialContext iniCtx = getInitialContext("jbossws-client");
+ TestEndpoint port =
((Service)iniCtx.lookup("java:comp/env/service2")).getPort(TestEndpoint.class);
+ assertNotNull(port);
+
+ String request = "testApplicationClient";
+ String response = port.echo(request);
+ assertEquals(response, request);
+ */
+
}
+
}
Modified:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefEJBTestCase.java
===================================================================
---
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefEJBTestCase.java 2007-03-19
15:04:57 UTC (rev 2640)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefEJBTestCase.java 2007-03-19
20:06:28 UTC (rev 2641)
@@ -66,7 +66,7 @@
Service service = Service.create(wsdlURL, qname);
TestEndpoint port = (TestEndpoint)service.getPort(TestEndpoint.class);
- String helloWorld = "Hello World!";
+ String helloWorld = "testDynamicProxy";
Object retObj = port.echo(helloWorld);
assertEquals(helloWorld, retObj);
}
Modified:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefServletTestCase.java
===================================================================
---
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefServletTestCase.java 2007-03-19
15:04:57 UTC (rev 2640)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServiceRefServletTestCase.java 2007-03-19
20:06:28 UTC (rev 2641)
@@ -29,6 +29,8 @@
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.soap.SOAPBinding;
import junit.framework.Test;
@@ -69,7 +71,7 @@
String helloWorld = "Hello World!";
Object retObj = port.echo(helloWorld);
- assertEquals(helloWorld, retObj);
+ assertEquals(helloWorld, retObj);
}
public void testServletClient() throws Exception
Modified:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServletClient.java
===================================================================
---
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServletClient.java 2007-03-19
15:04:57 UTC (rev 2640)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/serviceref/ServletClient.java 2007-03-19
20:06:28 UTC (rev 2641)
@@ -31,6 +31,8 @@
import javax.servlet.http.HttpServletResponse;
import javax.xml.ws.Service;
import javax.xml.ws.WebServiceException;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.soap.SOAPBinding;
import org.jboss.logging.Logger;
@@ -60,6 +62,14 @@
for (int i = 0; i < ports.size(); i++)
{
TestEndpoint port = (TestEndpoint)ports.get(i);
+
+ BindingProvider bp = (BindingProvider)port;
+ boolean mtomEnabled = ((SOAPBinding)bp.getBinding()).isMTOMEnabled();
+ boolean expectedSetting = (i==0) ? false : true;
+
+ if(mtomEnabled != expectedSetting)
+ throw new WebServiceException("MTOM settings
(enabled="+expectedSetting+") not overridden through service-ref" );
+
String outStr = port.echo(inStr);
if (inStr.equals(outStr) == false)
throw new WebServiceException("Invalid echo return: " + inStr);
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/CustomHandler.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/CustomHandler.java
(rev 0)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/CustomHandler.java 2007-03-19
20:06:28 UTC (rev 2641)
@@ -0,0 +1,93 @@
+/*
+ * 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.test.ws.jaxws.wsdd;
+
+import org.jboss.ws.core.jaxws.handler.GenericSOAPHandler;
+import org.jboss.ws.core.soap.TextImpl;
+import org.jboss.ws.extensions.xop.XOPContext;
+
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+import javax.xml.ws.WebServiceException;
+import javax.xml.soap.*;
+
+/**
+ * Inbound the handler appends to the echo message,
+ * outbound it changes the boolean value of the checkMTOM invocation.
+ *
+ * @author Heiko.Braun(a)jboss.org
+ * @version $Id$
+ * @since Mar 12, 2007
+ */
+public class CustomHandler extends GenericSOAPHandler {
+
+ protected boolean handleInbound(MessageContext msgContext)
+ {
+ try
+ {
+ SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
+ SOAPBody soapBody = soapMessage.getSOAPBody();
+
+ SOAPBodyElement soapBodyElement =
(SOAPBodyElement)soapBody.getChildElements().next();
+ if(soapBodyElement.getChildElements().hasNext())
+ {
+ SOAPElement payload =
(SOAPElement)soapBodyElement.getChildElements().next();
+ SOAPElement message = (SOAPElement)payload.getChildElements().next();
+ String value = message.getValue();
+ message.setValue(value + "World");
+ }
+ }
+ catch (SOAPException e)
+ {
+ throw new WebServiceException(e);
+ }
+ return true;
+ }
+
+ protected boolean handleOutbound(MessageContext msgContext)
+ {
+ try
+ {
+ SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
+ SOAPBody soapBody = soapMessage.getSOAPBody();
+
+ SOAPBodyElement soapBodyElement =
(SOAPBodyElement)soapBody.getChildElements().next();
+ if(soapBodyElement.getChildElements().hasNext())
+ {
+ SOAPElement payload =
(SOAPElement)soapBodyElement.getChildElements().next();
+ if(soapBodyElement.getElementQName().getLocalPart().indexOf("MTOM")
!= -1)
+ {
+ TextImpl response = (TextImpl)payload.getChildElements().next();
+ String value = response.getValue();
+ response.setValue( String.valueOf(XOPContext.isMTOMEnabled()) );
+ }
+
+ }
+ }
+ catch (SOAPException e)
+ {
+ throw new WebServiceException(e);
+ }
+
+ return true;
+ }
+}
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/Message.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/Message.java
(rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/Message.java 2007-03-19
20:06:28 UTC (rev 2641)
@@ -0,0 +1,40 @@
+/*
+ * 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.test.ws.jaxws.wsdd;
+
+/**
+ * @author Heiko.Braun(a)jboss.org
+ * @version $Id$
+ * @since Mar 12, 2007
+ */
+public class Message {
+ public String msg;
+
+ public Message()
+ {
+ }
+
+ public Message(String msg)
+ {
+ this.msg = msg;
+ }
+}
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/ResponseMessage.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/ResponseMessage.java
(rev 0)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/ResponseMessage.java 2007-03-19
20:06:28 UTC (rev 2641)
@@ -0,0 +1,41 @@
+/*
+ * 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.test.ws.jaxws.wsdd;
+
+/**
+ * @author Heiko.Braun(a)jboss.org
+ * @version $Id$
+ * @since Mar 12, 2007
+ */
+public class ResponseMessage {
+
+ public String msg;
+
+ public ResponseMessage()
+ {
+ }
+
+ public ResponseMessage(String msg)
+ {
+ this.msg = msg;
+ }
+}
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/TestDDOverrides.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/TestDDOverrides.java
(rev 0)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/TestDDOverrides.java 2007-03-19
20:06:28 UTC (rev 2641)
@@ -0,0 +1,73 @@
+/*
+ * 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.test.ws.jaxws.wsdd;
+
+import junit.framework.Test;
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.soap.SOAPBinding;
+import java.net.URL;
+
+/**
+ * @author Heiko.Braun(a)jboss.org
+ * @version $Id$
+ * @since Mar 12, 2007
+ */
+public class TestDDOverrides extends JBossWSTest {
+
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-wsdd";
+
+ public static Test suite()
+ {
+ return JBossWSTestSetup.newTestSetup(TestDDOverrides.class,
"jaxws-wsdd.war");
+ }
+
+ public void testHandlerChainOverride() throws Exception
+ {
+ QName serviceName = new
QName("http://wsdd.jaxws.ws.test.jboss.org/",
"WSDDEndpointImplService");
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ WSDDEndpoint port = service.getPort(WSDDEndpoint.class);
+
+ Message request = new Message("Hello");
+ ResponseMessage response = port.echo(request);
+ assertNotNull(response);
+ assertEquals(response.msg, "HelloWorld");
+ }
+
+ public void testMTOMOverride() throws Exception
+ {
+ QName serviceName = new
QName("http://wsdd.jaxws.ws.test.jboss.org/",
"WSDDEndpointImplService");
+ URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ WSDDEndpoint port = service.getPort(WSDDEndpoint.class);
+
+ assertTrue("MTOM should be enabled thorugh webservice.xml overrides",
port.checkMTOMEnabled());
+
+ }
+}
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/TestWSDDParser.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/TestWSDDParser.java
(rev 0)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/TestWSDDParser.java 2007-03-19
20:06:28 UTC (rev 2641)
@@ -0,0 +1,88 @@
+/*
+ * 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.test.ws.jaxws.wsdd;
+
+import junit.framework.TestCase;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
+import org.jboss.ws.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
+import org.jboss.ws.metadata.webservices.PortComponentMetaData;
+import org.jboss.ws.metadata.webservices.WebserviceDescriptionMetaData;
+import org.jboss.ws.metadata.webservices.WebservicesFactory;
+import org.jboss.ws.metadata.webservices.WebservicesMetaData;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+
+import java.io.File;
+import java.io.InputStream;
+import java.net.URL;
+
+/**
+ * Tets webservice.xml additions that are related to JAX-WS
+ *
+ * @author Heiko.Braun(a)jboss.org
+ * @version $Id$
+ * @since Mar 12, 2007
+ */
+public class TestWSDDParser extends TestCase {
+
+ public void testJAXWSElementParsing() throws Exception
+ {
+ URL webservicesURL = new
File("resources/jaxws/wsdd/webservices.xml").toURL();
+ // Unmarshall webservices.xml
+ WebservicesMetaData webservices = null;
+ InputStream is = webservicesURL.openStream();
+ try
+ {
+ Unmarshaller unmarshaller =
UnmarshallerFactory.newInstance().newUnmarshaller();
+ ObjectModelFactory factory = new WebservicesFactory(webservicesURL);
+ webservices = (WebservicesMetaData)unmarshaller.unmarshal(is, factory, null);
+ }
+ finally
+ {
+ is.close();
+ }
+
+ assertNotNull(webservices);
+
+ WebserviceDescriptionMetaData wsDesc = webservices.getWebserviceDescriptions()[0];
+ assertNotNull(wsDesc);
+ assertTrue(wsDesc.getPortComponents().length==1);
+
+ PortComponentMetaData portComp = wsDesc.getPortComponents()[0];
+ assertNotNull(portComp);
+ assertTrue(portComp.getHandlerChains().getHandlerChains().size()>0);
+
+ // wsdlService
+
assertTrue(portComp.getWsdlService().getLocalPart().equals("HelloService"));
+
+ // mtom
+ assertTrue(portComp.isEnableMtom());
+
+ // handler chains
+ UnifiedHandlerChainMetaData handlerChain =
portComp.getHandlerChains().getHandlerChains().get(0);
+ assertNotNull(handlerChain);
+ assertTrue(
((UnifiedHandlerMetaData)handlerChain.getHandlers().get(0)).getHandlerName().equals("ServerHandler1"));
+
+ }
+
+}
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/WSDDEndpoint.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/WSDDEndpoint.java
(rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/WSDDEndpoint.java 2007-03-19
20:06:28 UTC (rev 2641)
@@ -0,0 +1,18 @@
+package org.jboss.test.ws.jaxws.wsdd;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+/**
+ * @author Heiko.Braun(a)jboss.org
+ * @version $Id$
+ * @since Mar 12, 2007
+ */
+@WebService
+public interface WSDDEndpoint {
+ @WebMethod
+ ResponseMessage echo(Message message);
+
+ @WebMethod
+ Boolean checkMTOMEnabled();
+}
Added: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/WSDDEndpointImpl.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/WSDDEndpointImpl.java
(rev 0)
+++
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/wsdd/WSDDEndpointImpl.java 2007-03-19
20:06:28 UTC (rev 2641)
@@ -0,0 +1,53 @@
+/*
+ * 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.test.ws.jaxws.wsdd;
+
+import org.jboss.ws.extensions.xop.XOPContext;
+
+import javax.jws.WebService;
+import javax.jws.WebMethod;
+
+/**
+ * @author Heiko.Braun(a)jboss.org
+ * @version $Id$
+ * @since Mar 12, 2007
+ */
+@WebService
+public class WSDDEndpointImpl implements WSDDEndpoint {
+
+ @WebMethod
+ public ResponseMessage echo(Message message)
+ {
+ System.out.println(message.msg);
+ return new ResponseMessage(message.msg);
+ }
+
+ @WebMethod
+ public Boolean checkMTOMEnabled()
+ {
+ // At this point it's not set
+ // The MTOM property is avaialbel when the CommonSOAPBinding
+ // did bin the reponse. Therefore we delegate this task to the handler impl.
+ return Boolean.FALSE;
+ }
+
+}
Modified:
trunk/jbossws-tests/src/resources/jaxws/serviceref/META-INF/application-client.xml
===================================================================
---
trunk/jbossws-tests/src/resources/jaxws/serviceref/META-INF/application-client.xml 2007-03-19
15:04:57 UTC (rev 2640)
+++
trunk/jbossws-tests/src/resources/jaxws/serviceref/META-INF/application-client.xml 2007-03-19
20:06:28 UTC (rev 2641)
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
-<application-client version="5"
xmlns="http://java.sun.com/xml/ns/javaee"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<application-client version="5"
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/application-client_5.xsd">
<display-name>jaxws simple tests</display-name>
-
+
<service-ref>
<service-ref-name>service1</service-ref-name>
<service-interface>javax.xml.ws.Service</service-interface>
@@ -16,6 +16,10 @@
<service-ref-name>service2</service-ref-name>
<service-interface>org.jboss.test.ws.jaxws.serviceref.TestEndpointService</service-interface>
<wsdl-file>META-INF/wsdl/TestEndpoint.wsdl</wsdl-file>
+ <port-component-ref>
+
<service-endpoint-interface>org.jboss.test.ws.jaxws.serviceref.TestEndpoint</service-endpoint-interface>
+ <enable-mtom>true</enable-mtom>
+ </port-component-ref>
</service-ref>
</application-client>
Modified: trunk/jbossws-tests/src/resources/jaxws/serviceref/META-INF/ejb-jar.xml
===================================================================
--- trunk/jbossws-tests/src/resources/jaxws/serviceref/META-INF/ejb-jar.xml 2007-03-19
15:04:57 UTC (rev 2640)
+++ trunk/jbossws-tests/src/resources/jaxws/serviceref/META-INF/ejb-jar.xml 2007-03-19
20:06:28 UTC (rev 2641)
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<ejb-jar
xmlns="http://java.sun.com/xml/ns/javaee"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/j2ee/ejb-jar_3_0.xsd"
- version="3.0">
+<ejb-jar version="3.0"
+
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
<enterprise-beans>
<session>
@@ -16,13 +16,17 @@
<service-ref>
<service-ref-name>service1</service-ref-name>
<service-interface>javax.xml.ws.Service</service-interface>
- <wsdl-file>META-INF/wsdl/TestEndpoint.wsdl</wsdl-file>
+ <wsdl-file>META-INF/wsdl/TestEndpoint.wsdl</wsdl-file>
</service-ref>
<service-ref>
<service-ref-name>service2</service-ref-name>
<service-interface>org.jboss.test.ws.jaxws.serviceref.TestEndpointService</service-interface>
<wsdl-file>META-INF/wsdl/TestEndpoint.wsdl</wsdl-file>
+ <port-component-ref>
+
<service-endpoint-interface>org.jboss.test.ws.jaxws.serviceref.TestEndpoint</service-endpoint-interface>
+ <enable-mtom>true</enable-mtom>
+ </port-component-ref>
</service-ref>
</session>
Modified: trunk/jbossws-tests/src/resources/jaxws/serviceref/META-INF/jboss-client.xml
===================================================================
---
trunk/jbossws-tests/src/resources/jaxws/serviceref/META-INF/jboss-client.xml 2007-03-19
15:04:57 UTC (rev 2640)
+++
trunk/jbossws-tests/src/resources/jaxws/serviceref/META-INF/jboss-client.xml 2007-03-19
20:06:28 UTC (rev 2641)
@@ -1,7 +1,14 @@
<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE jboss-client PUBLIC "-//JBoss//DTD Application Client 5.0//EN"
"http://www.jboss.org/j2ee/dtd/jboss-client_5_0.dtd">
-<!DOCTYPE jboss-client PUBLIC "-//JBoss//DTD Application Client 4.0//EN"
"http://www.jboss.org/j2ee/dtd/jboss-client_4_0.dtd">
-
<jboss-client>
<jndi-name>jbossws-client</jndi-name>
+
+ <!--service-ref>
+ <service-ref-name>service2</service-ref-name>
+ <port-component-ref>
+
<service-endpoint-interface>org.jboss.test.ws.jaxws.serviceref.TestEndpoint</service-endpoint-interface>
+
<
port-qname>{http://serviceref.jaxws.ws.test.jboss.org/}TestEndpointPor...
+ </port-component-ref>
+ </service-ref-->
</jboss-client>
Modified:
trunk/jbossws-tests/src/resources/jaxws/serviceref/servlet-client/WEB-INF/web.xml
===================================================================
---
trunk/jbossws-tests/src/resources/jaxws/serviceref/servlet-client/WEB-INF/web.xml 2007-03-19
15:04:57 UTC (rev 2640)
+++
trunk/jbossws-tests/src/resources/jaxws/serviceref/servlet-client/WEB-INF/web.xml 2007-03-19
20:06:28 UTC (rev 2641)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd">
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd">
<servlet>
<servlet-name>ServletClient</servlet-name>
@@ -19,10 +19,14 @@
<wsdl-file>WEB-INF/wsdl/TestEndpoint.wsdl</wsdl-file>
</service-ref>
- <service-ref>
+ <service-ref>
<service-ref-name>service2</service-ref-name>
<service-interface>org.jboss.test.ws.jaxws.serviceref.TestEndpointService</service-interface>
<wsdl-file>WEB-INF/wsdl/TestEndpoint.wsdl</wsdl-file>
+ <port-component-ref>
+
<service-endpoint-interface>org.jboss.test.ws.jaxws.serviceref.TestEndpoint</service-endpoint-interface>
+ <enable-mtom>true</enable-mtom>
+ </port-component-ref>
</service-ref>
</web-app>
\ No newline at end of file
Added: trunk/jbossws-tests/src/resources/jaxws/wsdd/WEB-INF/web.xml
===================================================================
--- trunk/jbossws-tests/src/resources/jaxws/wsdd/WEB-INF/web.xml
(rev 0)
+++ trunk/jbossws-tests/src/resources/jaxws/wsdd/WEB-INF/web.xml 2007-03-19 20:06:28 UTC
(rev 2641)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <servlet>
+ <servlet-name>Endpoint</servlet-name>
+
<servlet-class>org.jboss.test.ws.jaxws.wsdd.WSDDEndpointImpl</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Endpoint</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
\ No newline at end of file
Added: trunk/jbossws-tests/src/resources/jaxws/wsdd/WEB-INF/webservices.xml
===================================================================
--- trunk/jbossws-tests/src/resources/jaxws/wsdd/WEB-INF/webservices.xml
(rev 0)
+++ trunk/jbossws-tests/src/resources/jaxws/wsdd/WEB-INF/webservices.xml 2007-03-19
20:06:28 UTC (rev 2641)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<webservices
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns:wsdl="http://wsdd.jaxws.ws.test.jboss.org/"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/javaee_web_services_1_2.xsd"
version="1.2">
+ <webservice-description>
+
<webservice-description-name>WSDDTestService</webservice-description-name>
+ <!--wsdl-file>META-INF/wsdl/HelloService.wsdl</wsdl-file-->
+ <port-component>
+ <port-component-name>WSDDEndpointImpl</port-component-name>
+ <wsdl-service>wsdl:WSDDEndpointImplService</wsdl-service>
+ <wsdl-port>wsdl:WSDDEndpointImplPort</wsdl-port>
+
<!--service-endpoint-interface>com.sun.ts.tests.webservices12.ejb.descriptors.WSEjbOverrideWSRefHCWithDDsTest.Hello</service-endpoint-interface-->
+ <service-impl-bean>
+ <servlet-link>Endpoint</servlet-link>
+ </service-impl-bean>
+ <enable-mtom>true</enable-mtom>
+ <handler-chains>
+ <handler-chain>
+ <handler>
+ <handler-name>CustomHandler</handler-name>
+
<handler-class>org.jboss.test.ws.jaxws.wsdd.CustomHandler</handler-class>
+ </handler>
+ </handler-chain>
+ </handler-chains>
+ </port-component>
+ </webservice-description>
+</webservices>