JBossWS SVN: r13050 - in stack/cxf/trunk: modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-30 13:34:20 -0400 (Thu, 30 Sep 2010)
New Revision: 13050
Added:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionFactoryImpl.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java
stack/cxf/trunk/modules/client/src/main/resources/META-INF/services/javax.xml.soap.SOAPConnectionFactory
Removed:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/saaj/
stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-server.jar/META-INF/services/javax.xml.soap.SOAPConnectionFactory
Modified:
stack/cxf/trunk/src/main/scripts/assembly-bin-dist.xml
Log:
[JBWS-3084] Moving custom SOAPConnectionFactory to jbossws-cxf-client.jar for basic client side usage. Also including the test in binary distribution.
Added: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionFactoryImpl.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionFactoryImpl.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionFactoryImpl.java 2010-09-30 17:34:20 UTC (rev 13050)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.wsf.stack.cxf.saaj;
+
+import javax.xml.soap.SOAPConnection;
+import javax.xml.soap.SOAPConnectionFactory;
+import javax.xml.soap.SOAPException;
+
+public class SOAPConnectionFactoryImpl extends SOAPConnectionFactory
+{
+
+ @Override
+ public SOAPConnection createConnection() throws SOAPException
+ {
+ return new SOAPConnectionImpl();
+ }
+
+}
Added: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java 2010-09-30 17:34:20 UTC (rev 13050)
@@ -0,0 +1,214 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.wsf.stack.cxf.saaj;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.MimeHeader;
+import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPConnection;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.helpers.IOUtils;
+import org.apache.cxf.helpers.LoadingByteArrayOutputStream;
+import org.apache.cxf.message.Exchange;
+import org.apache.cxf.message.ExchangeImpl;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageImpl;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.transport.Conduit;
+import org.apache.cxf.transport.ConduitInitiator;
+import org.apache.cxf.transport.ConduitInitiatorManager;
+import org.apache.cxf.transport.MessageObserver;
+import org.apache.cxf.transport.http.HTTPConduit;
+
+public class SOAPConnectionImpl extends SOAPConnection
+{
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public SOAPMessage call(SOAPMessage msgOut, Object addressObject) throws SOAPException
+ {
+ String address = getAddress(addressObject);
+ ConduitInitiator ci = getConduitInitiator(address);
+
+
+ // create a new Message and Exchange
+ EndpointInfo info = new EndpointInfo();
+ info.setAddress(address);
+ Message outMessage = new MessageImpl();
+ Exchange exch = new ExchangeImpl();
+ outMessage.setExchange(exch);
+
+ // sent SOAPMessage
+ try
+ {
+ final Conduit c = ci.getConduit(info);
+
+
+ Map<String, List<String>> outHeaders = new HashMap<String, List<String>>();
+ for (Iterator it = msgOut.getMimeHeaders().getAllHeaders(); it.hasNext();)
+ {
+ MimeHeader mimeHeader = (MimeHeader)it.next();
+ if ("Content-Type".equals(mimeHeader.getName()))
+ {
+ outMessage.put(Message.CONTENT_TYPE, mimeHeader.getValue());
+ }
+
+ // disable the chunked encoding if requested
+ if ("Transfer-Encoding".equals(mimeHeader.getName())
+ && "disabled".equals(mimeHeader.getValue())
+ && c instanceof HTTPConduit)
+ {
+ ((HTTPConduit)c).getClient().setAllowChunking(false);
+ continue;
+ }
+
+ List<String> values = outHeaders.get(mimeHeader.getName());
+ if (values == null)
+ {
+ values = new ArrayList<String>();
+ outHeaders.put(mimeHeader.getName(), values);
+ }
+ values.add(mimeHeader.getValue());
+ }
+ outMessage.put(Message.HTTP_REQUEST_METHOD, "POST");
+ outMessage.put(Message.PROTOCOL_HEADERS, outHeaders);
+ c.prepare(outMessage);
+
+ OutputStream outs = outMessage.getContent(OutputStream.class);
+ msgOut.writeTo(outs);
+
+ c.setMessageObserver(new MessageObserver() {
+ public void onMessage(Message inMessage)
+ {
+ LoadingByteArrayOutputStream bout = new LoadingByteArrayOutputStream();
+ try
+ {
+ IOUtils.copy(inMessage.getContent(InputStream.class), bout);
+ inMessage.getExchange().put(InputStream.class, bout.createInputStream());
+
+ Map<String, List<String>> inHeaders =
+ (Map<String, List<String>>)inMessage.get(Message.PROTOCOL_HEADERS);
+
+ inMessage.getExchange().put(Message.PROTOCOL_HEADERS, inHeaders);
+ c.close(inMessage);
+ }
+ catch (IOException e)
+ {
+ //ignore
+ }
+ }
+ });
+
+ c.close(outMessage);
+ }
+ catch (Exception ex)
+ {
+ throw new SOAPException("SOAPMessage can not be sent", ex);
+ }
+
+ // read SOAPMessage
+ try
+ {
+ InputStream ins = exch.get(InputStream.class);
+ Map<String, List<String>> inHeaders =
+ (Map<String, List<String>>)exch.get(Message.PROTOCOL_HEADERS);
+
+ MimeHeaders mimeHeaders = new MimeHeaders();
+ if (inHeaders != null)
+ {
+ for (Map.Entry<String, List<String>> entry : inHeaders.entrySet())
+ {
+ if (entry.getValue() != null)
+ {
+ for (String value : entry.getValue())
+ {
+ mimeHeaders.addHeader(entry.getKey(), value);
+ }
+ }
+ }
+ }
+
+ MessageFactory msgFac = MessageFactory.newInstance();
+ return msgFac.createMessage(mimeHeaders, ins);
+ }
+ catch (Exception ex)
+ {
+ throw new SOAPException("SOAPMessage can not be read", ex);
+ }
+
+
+ }
+
+ @Override
+ public void close() throws SOAPException
+ {
+ // complete
+ }
+
+ private String getAddress(Object addressObject) throws SOAPException
+ {
+ if (addressObject instanceof URL || addressObject instanceof String)
+ {
+ return addressObject.toString();
+ }
+ throw new SOAPException("Address object of type " + addressObject.getClass().getName()
+ + " is not supported");
+ }
+
+ private ConduitInitiator getConduitInitiator(String address) throws SOAPException {
+
+ ConduitInitiator ci = null;
+ try {
+ Bus bus = BusFactory.getThreadDefaultBus(true);
+ ConduitInitiatorManager mgr = bus.getExtension(ConduitInitiatorManager.class);
+
+ if (address.startsWith("http")) {
+ ci = mgr.getConduitInitiator("http://cxf.apache.org/transports/http");
+ }
+ if (ci == null) {
+ ci = mgr.getConduitInitiatorForUri(address);
+ }
+
+ } catch (Exception ex) {
+ throw new SOAPException("No ConduitInitiator is available for " + address, ex);
+ }
+
+ if (ci == null) {
+ throw new SOAPException("No ConduitInitiator is available for " + address);
+ }
+ return ci;
+ }
+}
Added: stack/cxf/trunk/modules/client/src/main/resources/META-INF/services/javax.xml.soap.SOAPConnectionFactory
===================================================================
--- stack/cxf/trunk/modules/client/src/main/resources/META-INF/services/javax.xml.soap.SOAPConnectionFactory (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/resources/META-INF/services/javax.xml.soap.SOAPConnectionFactory 2010-09-30 17:34:20 UTC (rev 13050)
@@ -0,0 +1 @@
+org.jboss.wsf.stack.cxf.saaj.SOAPConnectionFactoryImpl
Deleted: stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-server.jar/META-INF/services/javax.xml.soap.SOAPConnectionFactory
===================================================================
--- stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-server.jar/META-INF/services/javax.xml.soap.SOAPConnectionFactory 2010-09-30 16:41:01 UTC (rev 13049)
+++ stack/cxf/trunk/modules/server/src/main/resources/jbossws-cxf-server.jar/META-INF/services/javax.xml.soap.SOAPConnectionFactory 2010-09-30 17:34:20 UTC (rev 13050)
@@ -1 +0,0 @@
-org.jboss.wsf.stack.cxf.saaj.SOAPConnectionFactoryImpl
Modified: stack/cxf/trunk/src/main/scripts/assembly-bin-dist.xml
===================================================================
--- stack/cxf/trunk/src/main/scripts/assembly-bin-dist.xml 2010-09-30 16:41:01 UTC (rev 13049)
+++ stack/cxf/trunk/src/main/scripts/assembly-bin-dist.xml 2010-09-30 17:34:20 UTC (rev 13050)
@@ -103,12 +103,14 @@
<include>java/org/jboss/test/ws/jaxws/smoke/**</include>
<include>java/org/jboss/test/ws/management/**</include>
<include>java/org/jboss/test/ws/projectGenerator/**</include>
+ <include>java/org/jboss/test/ws/saaj/**</include>
<include>resources/console/**</include>
<include>resources/jaxrpc/samples/**</include>
<include>resources/jaxws/samples/**</include>
<include>resources/jaxws/smoke/**</include>
<include>resources/management/**</include>
<include>resources/projectGenerator/**</include>
+ <include>resources/saaj/**</include>
</includes>
</unpackOptions>
</dependencySet>
14 years, 2 months
JBossWS SVN: r13049 - in stack/cxf/trunk/modules/testsuite/cxf-tests/src/test: java/org/jboss/test/ws/jaxws/samples/wsa/jaxws and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-30 12:41:01 -0400 (Thu, 30 Sep 2010)
New Revision: 13049
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/AddressingTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/ServiceIface.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/ServiceImpl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/jaxws/SayHello.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsa/WEB-INF/wsdl/AddressingService.wsdl
Log:
Improving wsa sample, adding a testcase using client with decoupledEndpoint
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/AddressingTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/AddressingTestCase.java 2010-09-30 09:27:48 UTC (rev 13048)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/AddressingTestCase.java 2010-09-30 16:41:01 UTC (rev 13049)
@@ -21,13 +21,21 @@
*/
package org.jboss.test.ws.jaxws.samples.wsa;
+import java.net.SocketTimeoutException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceException;
import javax.xml.ws.soap.AddressingFeature;
import junit.framework.Test;
+
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.endpoint.ClientImpl;
+import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.transport.http.HTTPConduit;
+import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
@@ -60,7 +68,7 @@
ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class, new AddressingFeature());
((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL);
// invoke method
- assertEquals("Hello World!", proxy.sayHello());
+ assertEquals("Hello World!", proxy.sayHello("World"));
}
/**
@@ -77,7 +85,46 @@
Service service = Service.create(wsdlURL, serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
// invoke method
- assertEquals("Hello World!", proxy.sayHello());
+ assertEquals("Hello World!", proxy.sayHello("World"));
}
+ /**
+ * This shows the usage of decoupled-endpoint for getting back response on a new http connection.
+ * The CXF client basically creates a destination listening at the provided decoupled endpoint address, using the
+ * configured http transport factory. The client gets back a HTTP 202 accept response message immediately after
+ * the call to the server, then once the actual response comes back to the decoupled endpoint, the client is
+ * notified and returns control to the application code.
+ *
+ * @throws Exception
+ */
+ public void testDecoupledEndpointForLongLastingProcessingOfInvocations() throws Exception
+ {
+ // construct proxy
+ QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wsaddressing", "AddressingService");
+ URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
+
+ Client client = ClientProxy.getClient(proxy);
+ HTTPConduit conduit = (HTTPConduit)client.getConduit();
+ HTTPClientPolicy policy = conduit.getClient();
+ //set low connection and receive timeouts to ensure the http client can't keep the connection open till the response is received
+ policy.setConnectionTimeout(5000); //5 secs
+ policy.setReceiveTimeout(10000); //10 secs
+ //please note you might want to set the synchronous timeout for long waits, as CXF ClientImpl would simply drop waiting for the response after that (default 60 secs)
+// ((ClientImpl)client).setSynchronousTimeout(value);
+
+ try {
+ proxy.sayHello("Sleepy"); //this takes at least 30 secs
+ fail("Timeout exception expected");
+ } catch (WebServiceException e) {
+ assertTrue(e.getCause() instanceof SocketTimeoutException);
+ }
+
+ policy.setDecoupledEndpoint("http://localhost:18181/jaxws-samples-wsa/decoupled-endpoint");
+ String response = proxy.sayHello("Sleepy"); //this takes at least 30 secs... but now the client doesn't time out
+ assertEquals("Hello Sleepy!", response);
+ }
+
+
}
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/ServiceIface.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/ServiceIface.java 2010-09-30 09:27:48 UTC (rev 13048)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/ServiceIface.java 2010-09-30 16:41:01 UTC (rev 13049)
@@ -22,7 +22,11 @@
package org.jboss.test.ws.jaxws.samples.wsa;
import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
import javax.jws.WebService;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
@WebService
(
@@ -30,6 +34,10 @@
)
public interface ServiceIface
{
+ @WebResult(name = "return", targetNamespace = "")
+ @RequestWrapper(localName = "sayHello", targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wsaddressing", className = "org.jboss.test.ws.jaxws.samples.wsa.jaxws.SayHello")
@WebMethod
- String sayHello();
+ @ResponseWrapper(localName = "sayHelloResponse", targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wsaddressing", className = "org.jboss.test.ws.jaxws.samples.wsa.jaxws.SayHelloResponse")
+ public String sayHello(@WebParam(name = "name", targetNamespace = "") String name);
+
}
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/ServiceImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/ServiceImpl.java 2010-09-30 09:27:48 UTC (rev 13048)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/ServiceImpl.java 2010-09-30 16:41:01 UTC (rev 13049)
@@ -24,6 +24,8 @@
import javax.jws.WebService;
import javax.xml.ws.soap.Addressing;
+import org.apache.log4j.Logger;
+
@WebService
(
portName = "AddressingServicePort",
@@ -35,8 +37,23 @@
@Addressing(enabled=true, required=true)
public class ServiceImpl implements ServiceIface
{
- public String sayHello()
+ private Logger log = Logger.getLogger(this.getClass());
+
+ public String sayHello(String name)
{
- return "Hello World!";
+ if ("Sleepy".equals(name))
+ {
+ try
+ {
+ log.info("Sleeping...");
+ Thread.sleep(30 * 1000);
+ log.info("...end of sleeping.");
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ return "Hello " + name + "!";
}
}
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/jaxws/SayHello.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/jaxws/SayHello.java 2010-09-30 09:27:48 UTC (rev 13048)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/jaxws/SayHello.java 2010-09-30 16:41:01 UTC (rev 13049)
@@ -23,16 +23,58 @@
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
- * This class was generated by the CXF 2.0.5-incubator
- * Mon Apr 21 16:36:02 CEST 2008
- * Generated source version: 2.0.5-incubator
+ * <p>Java class for sayHello complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="sayHello">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
*/
-@XmlRootElement(name = "sayHello", namespace = "http://www.jboss.org/jbossws/ws-extensions/wsaddressing")
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "sayHello", namespace = "http://www.jboss.org/jbossws/ws-extensions/wsaddressing")
+@XmlType(name = "sayHello", propOrder =
+{"name"})
+public class SayHello
+{
+ protected String name;
-public class SayHello {}
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value)
+ {
+ this.name = value;
+ }
+
+}
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsa/WEB-INF/wsdl/AddressingService.wsdl
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsa/WEB-INF/wsdl/AddressingService.wsdl 2010-09-30 09:27:48 UTC (rev 13048)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsa/WEB-INF/wsdl/AddressingService.wsdl 2010-09-30 16:41:01 UTC (rev 13049)
@@ -4,7 +4,9 @@
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/wsaddressing" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://www.jboss.org/jbossws/ws-extensions/wsaddressing">
<xsd:element name="sayHello" type="tns:sayHello"/>
<xsd:complexType name="sayHello">
-<xsd:sequence/>
+<xsd:sequence>
+<xsd:element minOccurs="0" name="name" type="xsd:string"/>
+</xsd:sequence>
</xsd:complexType>
<xsd:element name="sayHelloResponse" type="tns:sayHelloResponse"/>
<xsd:complexType name="sayHelloResponse">
14 years, 2 months
JBossWS SVN: r13047 - stack/native/tags.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-30 04:28:36 -0400 (Thu, 30 Sep 2010)
New Revision: 13047
Added:
stack/native/tags/jbossws-native-2.0.1.SP2_CP09/
Log:
Tagging jbossws-native-2.0.1.SP2_CP09
Copied: stack/native/tags/jbossws-native-2.0.1.SP2_CP09 (from rev 13046, stack/native/branches/jbossws-native-2.0.1.SP2_CP)
14 years, 2 months
JBossWS SVN: r13046 - stack/native/branches/jbossws-native-2.0.1.SP2_CP.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-30 04:25:53 -0400 (Thu, 30 Sep 2010)
New Revision: 13046
Modified:
stack/native/branches/jbossws-native-2.0.1.SP2_CP/version.properties
Log:
Moving to latest jbossws-common
Modified: stack/native/branches/jbossws-native-2.0.1.SP2_CP/version.properties
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.SP2_CP/version.properties 2010-09-29 13:36:18 UTC (rev 13045)
+++ stack/native/branches/jbossws-native-2.0.1.SP2_CP/version.properties 2010-09-30 08:25:53 UTC (rev 13046)
@@ -26,7 +26,7 @@
# Dependend integration projects
jbossws-spi=1.0.0.GA_CP02-brew
-jbossws-common=1.0.0.GA_CP05-brew
+jbossws-common=1.0.0.GA_CP06-brew
jbossws-framework=2.0.1.GA_CP05-brew
jbossws-jboss40=2.0.1.GA
jbossws-jboss42=2.0.1.GA_CP01
14 years, 2 months
JBossWS SVN: r13045 - in stack/cxf/trunk/modules/testsuite/cxf-tests: src/test/java/org/jboss/test/ws/jaxws/samples/wsa and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-29 09:36:18 -0400 (Wed, 29 Sep 2010)
New Revision: 13045
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/AddressingTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/ServiceImpl.java
Log:
Update ws-addressing sample to use addressing policy
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2010-09-29 13:35:19 UTC (rev 13044)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-jars-jaxws.xml 2010-09-29 13:36:18 UTC (rev 13045)
@@ -102,12 +102,6 @@
<include name="org/jboss/test/ws/jaxws/samples/wsa/Service*.class"/>
<include name="org/jboss/test/ws/jaxws/samples/wsa/jaxws/*.class"/>
</classes>
- <webinf dir="${tests.output.dir}/test-resources/jaxws/samples/wsa/WEB-INF">
- <include name="jbossws-cxf.xml"/>
- </webinf>
- <zipfileset
- dir="${tests.output.dir}/test-resources/jaxws/samples/wsa/WEB-INF/wsdl"
- prefix="WEB-INF/wsdl"/>
</war>
<!-- jaxws-samples-wsrm -->
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/AddressingTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/AddressingTestCase.java 2010-09-29 13:35:19 UTC (rev 13044)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/AddressingTestCase.java 2010-09-29 13:36:18 UTC (rev 13045)
@@ -23,6 +23,7 @@
import java.net.URL;
import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
import javax.xml.ws.Service;
import javax.xml.ws.soap.AddressingFeature;
@@ -44,15 +45,39 @@
return new JBossWSTestSetup(AddressingTestCase.class, "jaxws-samples-wsa.war");
}
- public void test() throws Exception
+ /**
+ * This tests the invocation using the local copy of the service contract; that does not have any ws-addressing
+ * policy, so the addressing feature needs to be explicitly provided.
+ *
+ * @throws Exception
+ */
+ public void testUsingLocalContract() throws Exception
{
// construct proxy
QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wsaddressing", "AddressingService");
- URL wsdlURL = new URL(serviceURL + "?wsdl");
+ URL wsdlURL = getResourceURL("jaxws/samples/wsa/WEB-INF/wsdl/AddressingService.wsdl");
Service service = Service.create(wsdlURL, serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class, new AddressingFeature());
+ ((BindingProvider)proxy).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceURL);
// invoke method
assertEquals("Hello World!", proxy.sayHello());
}
+ /**
+ * This tests the invocation using the service contract published by the endpoint. That should have the
+ * ws-addressing policy in it, hence no need to explicitly configure addressing, the policy engine takes care of that.
+ *
+ * @throws Exception
+ */
+ public void testUsingContractFromDeployedEndpoint() throws Exception
+ {
+ // construct proxy
+ QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wsaddressing", "AddressingService");
+ URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
+ // invoke method
+ assertEquals("Hello World!", proxy.sayHello());
+ }
+
}
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/ServiceImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/ServiceImpl.java 2010-09-29 13:35:19 UTC (rev 13044)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsa/ServiceImpl.java 2010-09-29 13:36:18 UTC (rev 13045)
@@ -28,7 +28,7 @@
(
portName = "AddressingServicePort",
serviceName = "AddressingService",
- wsdlLocation = "WEB-INF/wsdl/AddressingService.wsdl",
+// wsdlLocation = "WEB-INF/wsdl/AddressingService.wsdl", //do not provide the wsdl and let the endpoint publish the proper one with addressing policy
targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wsaddressing",
endpointInterface = "org.jboss.test.ws.jaxws.samples.wsa.ServiceIface"
)
14 years, 2 months
JBossWS SVN: r13044 - in stack/cxf/trunk/modules: server and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-29 09:35:19 -0400 (Wed, 29 Sep 2010)
New Revision: 13044
Modified:
stack/cxf/trunk/modules/client/pom.xml
stack/cxf/trunk/modules/server/pom.xml
Log:
[JBWS-3080] Use ${project.version} instead of ${version}
Modified: stack/cxf/trunk/modules/client/pom.xml
===================================================================
--- stack/cxf/trunk/modules/client/pom.xml 2010-09-29 08:39:59 UTC (rev 13043)
+++ stack/cxf/trunk/modules/client/pom.xml 2010-09-29 13:35:19 UTC (rev 13044)
@@ -27,7 +27,7 @@
<dependency>
<groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf-factories</artifactId>
- <version>${version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.ws.cxf</groupId>
Modified: stack/cxf/trunk/modules/server/pom.xml
===================================================================
--- stack/cxf/trunk/modules/server/pom.xml 2010-09-29 08:39:59 UTC (rev 13043)
+++ stack/cxf/trunk/modules/server/pom.xml 2010-09-29 13:35:19 UTC (rev 13044)
@@ -19,7 +19,7 @@
<dependency>
<groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf-client</artifactId>
- <version>${version}</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
@@ -42,7 +42,7 @@
<dependency>
<groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf-factories</artifactId>
- <version>${version}</version>
+ <version>${project.version}</version>
</dependency>
<!-- CXF dependencies -->
<dependency>
14 years, 2 months
JBossWS SVN: r13043 - common/tags/jbossws-common-1.0.0.GA_CP06.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-29 04:39:59 -0400 (Wed, 29 Sep 2010)
New Revision: 13043
Modified:
common/tags/jbossws-common-1.0.0.GA_CP06/version.properties
Log:
Updating version.properties
Modified: common/tags/jbossws-common-1.0.0.GA_CP06/version.properties
===================================================================
--- common/tags/jbossws-common-1.0.0.GA_CP06/version.properties 2010-09-29 08:19:42 UTC (rev 13042)
+++ common/tags/jbossws-common-1.0.0.GA_CP06/version.properties 2010-09-29 08:39:59 UTC (rev 13043)
@@ -5,8 +5,8 @@
specification.vendor=JBoss (http://www.jboss.org)
specification.version=jbossws-2.0
-version.id=1.0.0.GA_CP-SNAPSHOT
-repository.id=1.0.0.GA_CP-SNAPSHOT
+version.id=1.0.0.GA_CP06
+repository.id=1.0.0.GA_CP06
implementation.title=JBoss Web Services - Common
implementation.url=http://www.jboss.org/products/jbossws
14 years, 2 months
JBossWS SVN: r13042 - common/tags.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-29 04:19:42 -0400 (Wed, 29 Sep 2010)
New Revision: 13042
Added:
common/tags/jbossws-common-1.0.0.GA_CP06/
Log:
Tagging jbossws-common-1.0.0.GA_CP06
Copied: common/tags/jbossws-common-1.0.0.GA_CP06 (from rev 13041, common/branches/jbossws-common-1.0.0.GA_CP)
14 years, 2 months
JBossWS SVN: r13041 - stack/native/branches.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-09-29 04:09:05 -0400 (Wed, 29 Sep 2010)
New Revision: 13041
Removed:
stack/native/branches/asoldano/
Log:
Removing branch not used anymore
14 years, 2 months