You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by mm...@apache.org on 2006/10/09 15:30:44 UTC
svn commit: r454377 - in /incubator/cxf/trunk: rt/bindings/soap/
rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/
rt/bindings/soap/src/main/resources/META-INF/
rt/bindings/soap/src/main/resources/META-INF/cxf/
rt/bindings/soap/src/test/java/...
Author: mmao
Date: Mon Oct 9 06:30:42 2006
New Revision: 454377
URL: http://svn.apache.org/viewvc?view=rev&rev=454377
Log:
RT support SOAP12 wsdl extension
* SOAP11 and SOAP12 be real singleton object
* Soap and Jaxws modules depend on tools/common module to get the soap extension proxy model support. may move to common later
* SoapBinding should have the SoapVersion information.
* SoapBindingFactory now support both soap11 and soap12 wsdl extensions.
* SoapDestinationFactory now support both soap11 and soap12 address, but createPortExtensor still only support soap11 address.
* Fixed all the places using Soap11 and Soap12.
* Commented a pmd rule in rt/ws/addr, might a bug in pmd, need revist.
* Added unit test in tools and system test for soap12 support.
TODO:
* The SOAP message still SOAP11 format (should add unit/system test to check the soap message)
* SOAP1212Fault
* Provider/Dispatch should support soap12
* Servlet should support soap12
* Revisit JCA
* WSDLToSoap12 tool
* JavaToWSDL tool
* WSDLToService tool
Added:
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/GreeterImpl.java (with props)
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/Server.java (with props)
incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/Soap12ClientServerTest.java (with props)
incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world_soap12.wsdl (with props)
incubator/cxf/trunk/tools/wsdl2java/src/test/resources/wsdl2java_wsdl/hello_world_soap12.wsdl (with props)
Modified:
incubator/cxf/trunk/rt/bindings/soap/pom.xml
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/HeaderUtil.java
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap11.java
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap12.java
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBinding.java
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapDestinationFactory.java
incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapMessage.java
incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/bus-extensions.xml
incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/cxf/cxf-extension.xml
incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/MustUnderstandInterceptorTest.java
incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/ReadHeaderInterceptorTest.java
incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapOutInterceptorTest.java
incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/TestBase.java
incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/attachments/AttachmentTest.java
incubator/cxf/trunk/rt/frontend/jaxws/pom.xml
incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/ServletDestination.java
incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/bus-extensions.xml
incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/cxf/cxf-extension.xml
incubator/cxf/trunk/rt/ws/addr/.ruleset
incubator/cxf/trunk/testutils/pom.xml
incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/SOAPBindingUtil.java
incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToProcessor.java
incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessorTest.java
Modified: incubator/cxf/trunk/rt/bindings/soap/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/pom.xml?view=diff&rev=454377&r1=454376&r2=454377
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/pom.xml (original)
+++ incubator/cxf/trunk/rt/bindings/soap/pom.xml Mon Oct 9 06:30:42 2006
@@ -41,6 +41,14 @@
<artifactId>cxf-api</artifactId>
<version>${project.version}</version>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-tools-common</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-databinding-jaxb</artifactId>
Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/HeaderUtil.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/HeaderUtil.java?view=diff&rev=454377&r1=454376&r2=454377
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/HeaderUtil.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/HeaderUtil.java Mon Oct 9 06:30:42 2006
@@ -23,13 +23,15 @@
import java.util.List;
import java.util.Set;
-import javax.wsdl.extensions.soap.SOAPHeader;
+import javax.wsdl.extensions.ExtensibilityElement;
import javax.xml.namespace.QName;
import org.apache.cxf.helpers.CastUtils;
import org.apache.cxf.service.model.BindingMessageInfo;
import org.apache.cxf.service.model.BindingOperationInfo;
import org.apache.cxf.service.model.MessagePartInfo;
+import org.apache.cxf.tools.common.extensions.soap.SoapHeader;
+import org.apache.cxf.tools.util.SOAPBindingUtil;
public final class HeaderUtil {
private static final String HEADERS_PROPERTY = HeaderUtil.class.getName() + ".HEADERS";
@@ -42,16 +44,19 @@
if (obj == null) {
Set<QName> set = new HashSet<QName>();
List<MessagePartInfo> mps = bmi.getMessageInfo().getMessageParts();
- for (SOAPHeader head : bmi.getExtensors(SOAPHeader.class)) {
- String pn = head.getPart();
- for (MessagePartInfo mpi : mps) {
- if (pn.equals(mpi.getName().getLocalPart())) {
- if (mpi.isElement()) {
- set.add(mpi.getElementQName());
- } else {
- set.add(mpi.getTypeQName());
+ for (ExtensibilityElement ext : bmi.getWSDL11Extensors()) {
+ if (SOAPBindingUtil.isSOAPHeader(ext)) {
+ SoapHeader header = SOAPBindingUtil.getSoapHeader(ext);
+ String pn = header.getPart();
+ for (MessagePartInfo mpi : mps) {
+ if (pn.equals(mpi.getName().getLocalPart())) {
+ if (mpi.isElement()) {
+ set.add(mpi.getElementQName());
+ } else {
+ set.add(mpi.getTypeQName());
+ }
+ break;
}
- break;
}
}
}
Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap11.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap11.java?view=diff&rev=454377&r1=454376&r2=454377
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap11.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap11.java Mon Oct 9 06:30:42 2006
@@ -26,7 +26,7 @@
*
* @version $Revision$
*/
-public class Soap11 implements SoapVersion {
+public final class Soap11 implements SoapVersion {
public static final String SOAP_NAMESPACE = "http://schemas.xmlsoap.org/soap/envelope/";
private static final Soap11 INSTANCE = new Soap11();
@@ -53,6 +53,10 @@
private final QName fault = new QName(namespace, "Fault", prefix);
+ private Soap11() {
+ // Singleton
+ }
+
public static Soap11 getInstance() {
return INSTANCE;
}
Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap12.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap12.java?view=diff&rev=454377&r1=454376&r2=454377
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap12.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/Soap12.java Mon Oct 9 06:30:42 2006
@@ -26,7 +26,7 @@
*
* @version $Revision$
*/
-public class Soap12 implements SoapVersion {
+public final class Soap12 implements SoapVersion {
public static final String SOAP_NAMESPACE = "http://www.w3.org/2003/05/soap-envelope";
private static Soap12 instance = new Soap12();
@@ -54,6 +54,10 @@
private final QName fault = new QName(namespace, "Fault", prefix);
+ private Soap12() {
+ // Singleton
+ }
+
public static Soap12 getInstance() {
return instance;
}
Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBinding.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBinding.java?view=diff&rev=454377&r1=454376&r2=454377
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBinding.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBinding.java Mon Oct 9 06:30:42 2006
@@ -37,10 +37,18 @@
private List<Interceptor> out;
private List<Interceptor> fault;
+ private SoapVersion version;
+
public SoapBinding() {
+ this(Soap11.getInstance());
+ }
+
+ public SoapBinding(SoapVersion v) {
in = new ArrayList<Interceptor>();
out = new ArrayList<Interceptor>();
fault = new ArrayList<Interceptor>();
+
+ version = v;
}
public Message createMessage() {
@@ -48,6 +56,9 @@
}
public Message createMessage(Message m) {
+ SoapMessage soapMessage = new SoapMessage(m);
+ soapMessage.setVersion(version);
+
if (mtomEnabled) {
m.put(Message.MTOM_ENABLED, Boolean.TRUE);
}
Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java?view=diff&rev=454377&r1=454376&r2=454377
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingFactory.java Mon Oct 9 06:30:42 2006
@@ -32,12 +32,9 @@
import javax.wsdl.extensions.mime.MIMEContent;
import javax.wsdl.extensions.mime.MIMEMultipartRelated;
import javax.wsdl.extensions.mime.MIMEPart;
-import javax.wsdl.extensions.soap.SOAPBinding;
-import javax.wsdl.extensions.soap.SOAPBody;
-import javax.wsdl.extensions.soap.SOAPHeader;
-import javax.wsdl.extensions.soap.SOAPOperation;
import javax.xml.namespace.QName;
+
import org.apache.cxf.Bus;
import org.apache.cxf.binding.AbstractBindingFactory;
import org.apache.cxf.binding.Binding;
@@ -69,6 +66,11 @@
import org.apache.cxf.service.model.MessageInfo;
import org.apache.cxf.service.model.MessagePartInfo;
import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.cxf.tools.common.extensions.soap.SoapBody;
+import org.apache.cxf.tools.common.extensions.soap.SoapHeader;
+import org.apache.cxf.tools.common.extensions.soap.SoapOperation;
+import org.apache.cxf.tools.util.SOAPBindingUtil;
+
public class SoapBindingFactory extends AbstractBindingFactory {
@@ -178,7 +180,9 @@
// Copy all the extensors
initializeBindingInfo(service, binding, bi);
- SOAPBinding wSoapBinding = bi.getExtensor(SOAPBinding.class);
+ org.apache.cxf.tools.common.extensions.soap.SoapBinding wSoapBinding
+ = SOAPBindingUtil.getSoapBinding(bi.getWSDL11Extensors());
+
bi.setTransportURI(wSoapBinding.getTransportURI());
bi.setStyle(wSoapBinding.getStyle());
@@ -192,7 +196,8 @@
private void initializeBindingOperation(SoapBindingInfo bi, BindingOperationInfo boi) {
SoapOperationInfo soi = new SoapOperationInfo();
- SOAPOperation soapOp = boi.getExtensor(SOAPOperation.class);
+ SoapOperation soapOp = SOAPBindingUtil.getSoapOperation(boi.getWSDL11Extensors());
+
if (soapOp != null) {
String action = soapOp.getSoapActionURI();
if (action == null) {
@@ -221,9 +226,9 @@
List<MessagePartInfo> messageParts = new ArrayList<MessagePartInfo>();
messageParts.addAll(msg.getMessageParts());
- List<SOAPHeader> headers = bmsg.getExtensors(SOAPHeader.class);
+ List<SoapHeader> headers = SOAPBindingUtil.getSoapHeaders(bmsg.getWSDL11Extensors());
if (headers != null) {
- for (SOAPHeader header : headers) {
+ for (SoapHeader header : headers) {
SoapHeaderInfo headerInfo = new SoapHeaderInfo();
headerInfo.setUse(header.getUse());
@@ -240,7 +245,7 @@
}
SoapBodyInfo bodyInfo = new SoapBodyInfo();
- SOAPBody soapBody = bmsg.getExtensor(SOAPBody.class);
+ SoapBody soapBody = SOAPBindingUtil.getSoapBody(bmsg.getWSDL11Extensors());
List parts = null;
if (soapBody == null) {
MIMEMultipartRelated mmr = bmsg.getExtensor(MIMEMultipartRelated.class);
@@ -259,14 +264,16 @@
String partName = null;
if (part instanceof MIMEPart) {
MIMEPart mpart = (MIMEPart) part;
- if (mpart.getExtensibilityElements().size() == 1) {
- Object content = mpart.getExtensibilityElements().get(0);
- if (content instanceof MIMEContent) {
- partName = ((MIMEContent) content).getPart();
- } else {
- if (((SOAPBody) content).getParts().size() == 1) {
- partName = (String) ((SOAPBody) content).getParts().get(0);
- }
+ if (mpart.getExtensibilityElements().size() < 1) {
+ throw new RuntimeException("MIMEPart should at least contain one element!");
+ }
+ Object content = mpart.getExtensibilityElements().get(0);
+ if (content instanceof MIMEContent) {
+ partName = ((MIMEContent) content).getPart();
+ } else if (SOAPBindingUtil.isSOAPBody(content)) {
+ SoapBody sb = SOAPBindingUtil.getSoapBody(content);
+ if (sb.getParts().size() == 1) {
+ partName = (String) sb.getParts().get(0);
}
}
} else {
Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapDestinationFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapDestinationFactory.java?view=diff&rev=454377&r1=454376&r2=454377
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapDestinationFactory.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapDestinationFactory.java Mon Oct 9 06:30:42 2006
@@ -38,6 +38,8 @@
import org.apache.cxf.service.model.BindingInfo;
import org.apache.cxf.service.model.EndpointInfo;
import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.cxf.tools.common.extensions.soap.SoapAddress;
+import org.apache.cxf.tools.util.SOAPBindingUtil;
import org.apache.cxf.transport.Destination;
import org.apache.cxf.transport.DestinationFactory;
import org.apache.cxf.transport.DestinationFactoryManager;
@@ -101,8 +103,8 @@
for (Iterator itr = ees.iterator(); itr.hasNext();) {
Object extensor = itr.next();
- if (extensor instanceof SOAPAddress) {
- SOAPAddress sa = (SOAPAddress)extensor;
+ if (SOAPBindingUtil.isSOAPAddress(extensor)) {
+ SoapAddress sa = SOAPBindingUtil.getSoapAddress(extensor);
SoapBindingInfo sbi = (SoapBindingInfo) b;
EndpointInfo info = new EndpointInfo(serviceInfo, sbi.getTransportURI());
Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapMessage.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapMessage.java?view=diff&rev=454377&r1=454376&r2=454377
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapMessage.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapMessage.java Mon Oct 9 06:30:42 2006
@@ -38,7 +38,7 @@
private Map<Class<?>, Object> headers = new HashMap<Class<?>, Object>();
- private SoapVersion version = new Soap11();
+ private SoapVersion version = Soap11.getInstance();
public SoapMessage(Message message) {
super(message);
Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/bus-extensions.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/bus-extensions.xml?view=diff&rev=454377&r1=454376&r2=454377
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/bus-extensions.xml (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/bus-extensions.xml Mon Oct 9 06:30:42 2006
@@ -23,11 +23,14 @@
<namespace>http://schemas.xmlsoap.org/wsdl/soap/</namespace>
<namespace>http://schemas.xmlsoap.org/wsdl/soap/http</namespace>
<namespace>http://cxf.apache.org/transports/jms</namespace>
+ <namespace>http://www.w3.org/2003/05/soap/bindings/HTTP/</namespace>
+ <namespace>http://schemas.xmlsoap.org/wsdl/soap12/</namespace>
</extension>
<extension class="org.apache.cxf.binding.soap.SoapDestinationFactory"
interface="org.apache.cxf.transport.DestinationFactory" deferred="true">
<namespace>http://schemas.xmlsoap.org/soap/</namespace>
<namespace>http://schemas.xmlsoap.org/wsdl/soap/</namespace>
+ <namespace>http://schemas.xmlsoap.org/wsdl/soap12/</namespace>
</extension>
</extensions>
Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/cxf/cxf-extension.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/cxf/cxf-extension.xml?view=diff&rev=454377&r1=454376&r2=454377
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/cxf/cxf-extension.xml (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/resources/META-INF/cxf/cxf-extension.xml Mon Oct 9 06:30:42 2006
@@ -35,6 +35,8 @@
<value>http://schemas.xmlsoap.org/wsdl/soap/</value>
<value>http://schemas.xmlsoap.org/wsdl/soap/http</value>
<value>http://cxf.apache.org/transports/jms</value>
+ <value>http://www.w3.org/2003/05/soap/bindings/HTTP/</value>
+ <value>http://schemas.xmlsoap.org/wsdl/soap12/</value>
</set>
</property>
</bean>
@@ -47,6 +49,7 @@
<set>
<value>http://schemas.xmlsoap.org/soap/</value>
<value>http://schemas.xmlsoap.org/wsdl/soap/</value>
+ <value>http://schemas.xmlsoap.org/wsdl/soap12/</value>
</set>
</property>
</bean>
Modified: incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/MustUnderstandInterceptorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/MustUnderstandInterceptorTest.java?view=diff&rev=454377&r1=454376&r2=454377
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/MustUnderstandInterceptorTest.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/MustUnderstandInterceptorTest.java Mon Oct 9 06:30:42 2006
@@ -117,7 +117,7 @@
private void prepareSoapMessage() throws Exception {
- soapMessage = TestUtil.createEmptySoapMessage(new Soap12(), chain);
+ soapMessage = TestUtil.createEmptySoapMessage(Soap12.getInstance(), chain);
ByteArrayDataSource bads = new ByteArrayDataSource(this.getClass()
.getResourceAsStream("test-soap-header.xml"), "Application/xop+xml");
String cid = AttachmentUtil.createContentID("http://cxf.apache.org");
Modified: incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/ReadHeaderInterceptorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/ReadHeaderInterceptorTest.java?view=diff&rev=454377&r1=454376&r2=454377
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/ReadHeaderInterceptorTest.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/ReadHeaderInterceptorTest.java Mon Oct 9 06:30:42 2006
@@ -106,7 +106,7 @@
private void prepareSoapMessage(String message) throws IOException {
- soapMessage = TestUtil.createEmptySoapMessage(new Soap12(), chain);
+ soapMessage = TestUtil.createEmptySoapMessage(Soap12.getInstance(), chain);
ByteArrayDataSource bads = new ByteArrayDataSource(this.getClass().getResourceAsStream(message),
"Application/xop+xml");
String cid = AttachmentUtil.createContentID("http://cxf.apache.org");
Modified: incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapOutInterceptorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapOutInterceptorTest.java?view=diff&rev=454377&r1=454376&r2=454377
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapOutInterceptorTest.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapOutInterceptorTest.java Mon Oct 9 06:30:42 2006
@@ -94,7 +94,7 @@
}
private void prepareSoapMessage() throws IOException {
- soapMessage = TestUtil.createEmptySoapMessage(new Soap12(), chain);
+ soapMessage = TestUtil.createEmptySoapMessage(Soap12.getInstance(), chain);
soapMessage.setContent(InputStream.class, getClass().getResourceAsStream("test-soap-header.xml"));
}
Modified: incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/TestBase.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/TestBase.java?view=diff&rev=454377&r1=454376&r2=454377
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/TestBase.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/TestBase.java Mon Oct 9 06:30:42 2006
@@ -70,7 +70,7 @@
phases.add(phase3);
chain = new PhaseInterceptorChain(phases);
- soapMessage = TestUtil.createEmptySoapMessage(new Soap11(), chain);
+ soapMessage = TestUtil.createEmptySoapMessage(Soap11.getInstance(), chain);
}
public void tearDown() throws Exception {
Modified: incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/attachments/AttachmentTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/attachments/AttachmentTest.java?view=diff&rev=454377&r1=454376&r2=454377
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/attachments/AttachmentTest.java (original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/attachments/AttachmentTest.java Mon Oct 9 06:30:42 2006
@@ -74,7 +74,7 @@
public void testDoInterceptOfSoap12() throws Exception {
try {
- soapMessage = TestUtil.createSoapMessage(new Soap12(), chain, this.getClass());
+ soapMessage = TestUtil.createSoapMessage(Soap12.getInstance(), chain, this.getClass());
} catch (IOException ioe) {
fail(ioe.getStackTrace().toString());
}
@@ -85,7 +85,7 @@
public void testDoInterceptOfSoap11() throws Exception {
try {
- soapMessage = TestUtil.createSoapMessage(new Soap11(), chain, this.getClass());
+ soapMessage = TestUtil.createSoapMessage(Soap11.getInstance(), chain, this.getClass());
} catch (IOException ioe) {
fail(ioe.getStackTrace().toString());
}
@@ -97,7 +97,7 @@
public void testDoUnmarshallXopEnabled() {
Object obj = null;
try {
- soapMessage = TestUtil.createSoapMessage(new Soap12(), chain, this.getClass());
+ soapMessage = TestUtil.createSoapMessage(Soap12.getInstance(), chain, this.getClass());
InputStream is = soapMessage.getContent(Attachment.class).getDataHandler().getDataSource()
.getInputStream();
testHandleMessage(soapMessage, is, false);
@@ -147,7 +147,7 @@
public void testDoMarshallXopEnabled() throws Exception {
// mashalling data object
QName elName = new QName("http://cxf.apache.org/bindings/soap/attachments/types", "Detail");
- soapMessage = TestUtil.createEmptySoapMessage(new Soap12(), chain);
+ soapMessage = TestUtil.createEmptySoapMessage(Soap12.getInstance(), chain);
try {
DetailType detailObj = TestUtil.createDetailObject(this.getClass());
Class<?> cls = DetailType.class;
Modified: incubator/cxf/trunk/rt/frontend/jaxws/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/pom.xml?view=diff&rev=454377&r1=454376&r2=454377
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/pom.xml (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/pom.xml Mon Oct 9 06:30:42 2006
@@ -55,6 +55,13 @@
</dependency>
<dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-tools-common</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+
+ <dependency>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
</dependency>
Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/ServletDestination.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/ServletDestination.java?view=diff&rev=454377&r1=454376&r2=454377
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/ServletDestination.java (original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/ServletDestination.java Mon Oct 9 06:30:42 2006
@@ -41,7 +41,6 @@
import javax.wsdl.Definition;
import javax.wsdl.Port;
import javax.wsdl.extensions.ExtensibilityElement;
-import javax.wsdl.extensions.soap.SOAPAddress;
import javax.wsdl.factory.WSDLFactory;
import javax.wsdl.xml.WSDLWriter;
@@ -53,6 +52,8 @@
import org.apache.cxf.message.Message;
import org.apache.cxf.message.MessageImpl;
import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.tools.common.extensions.soap.SoapAddress;
+import org.apache.cxf.tools.util.SOAPBindingUtil;
import org.apache.cxf.transport.Conduit;
import org.apache.cxf.transport.ConduitInitiator;
import org.apache.cxf.transport.Destination;
@@ -61,7 +62,6 @@
import org.apache.cxf.wsdl11.ServiceWSDLBuilder;
import org.xmlsoap.schemas.wsdl.http.AddressType;
-
public class ServletDestination implements Destination {
public static final String HTTP_REQUEST =
@@ -301,8 +301,8 @@
List<?> exts = port.getExtensibilityElements();
if (exts.size() > 0) {
ExtensibilityElement el = (ExtensibilityElement)exts.get(0);
- if (el instanceof SOAPAddress) {
- SOAPAddress add = (SOAPAddress)el;
+ if (SOAPBindingUtil.isSOAPAddress(el)) {
+ SoapAddress add = SOAPBindingUtil.getSoapAddress(el);
add.setLocationURI(req.getRequestURL().toString());
}
if (el instanceof AddressType) {
Modified: incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/bus-extensions.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/bus-extensions.xml?view=diff&rev=454377&r1=454376&r2=454377
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/bus-extensions.xml (original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/bus-extensions.xml Mon Oct 9 06:30:42 2006
@@ -22,6 +22,7 @@
<extension class="org.apache.cxf.transport.http.HTTPTransportFactory" deferred="true">
<namespace>http://schemas.xmlsoap.org/wsdl/soap/http</namespace>
<namespace>http://schemas.xmlsoap.org/soap/http</namespace>
+ <namespace>http://www.w3.org/2003/05/soap/bindings/HTTP/</namespace>
<namespace>http://schemas.xmlsoap.org/wsdl/http/</namespace>
<namespace>http://cxf.apache.org/transports/http/configuration</namespace>
<namespace>http://cxf.apache.org/bindings/xformat</namespace>
Modified: incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/cxf/cxf-extension.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/cxf/cxf-extension.xml?view=diff&rev=454377&r1=454376&r2=454377
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/cxf/cxf-extension.xml (original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/cxf/cxf-extension.xml Mon Oct 9 06:30:42 2006
@@ -29,6 +29,7 @@
<set>
<value>http://schemas.xmlsoap.org/soap/http</value>
<value>http://schemas.xmlsoap.org/wsdl/soap/http</value>
+ <value>http://www.w3.org/2003/05/soap/bindings/HTTP/</value>
<value>http://schemas.xmlsoap.org/wsdl/http/</value>
<value>http://cxf.apache.org/transports/http/configuration</value>
<value>http://cxf.apache.org/bindings/xformat</value>
Modified: incubator/cxf/trunk/rt/ws/addr/.ruleset
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/.ruleset?view=diff&rev=454377&r1=454376&r2=454377
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/.ruleset (original)
+++ incubator/cxf/trunk/rt/ws/addr/.ruleset Mon Oct 9 06:30:42 2006
@@ -41,7 +41,7 @@
<rule ref="rulesets/basic.xml/UnnecessaryConversionTemporary"/>
<rule ref="rulesets/basic.xml/UnnecessaryFinalModifier"/>
<rule ref="rulesets/basic.xml/UnnecessaryReturn"/>
- <rule ref="rulesets/basic.xml/UselessOverridingMethod"/>
+ <!--rule ref="rulesets/basic.xml/UselessOverridingMethod"/-->
<!--<rule ref="rulesets/braces.xml/ForLoopsMustUseBraces"/>-->
<!--<rule ref="rulesets/braces.xml/IfElseStmtsMustUseBraces"/>-->
Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/GreeterImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/GreeterImpl.java?view=auto&rev=454377
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/GreeterImpl.java (added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/GreeterImpl.java Mon Oct 9 06:30:42 2006
@@ -0,0 +1,42 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.soap12;
+
+import java.util.logging.Logger;
+import org.apache.hello_world_soap12_http.Greeter;
+
+@javax.jws.WebService(portName = "SoapPort", serviceName = "SOAPService",
+ targetNamespace = "http://apache.org/hello_world_soap12_http",
+ endpointInterface = "org.apache.hello_world_soap12_http.Greeter")
+
+public class GreeterImpl implements Greeter {
+
+ private static final Logger LOG =
+ Logger.getLogger(GreeterImpl.class.getPackage().getName());
+
+ /* (non-Javadoc)
+ * @see org.apache.hello_world_soap12_http.Greeter#sayHi()
+ */
+ public String sayHi() {
+ LOG.info("Executing operation sayHi");
+ System.out.println("Executing operation sayHi\n");
+ return "Bonjour";
+ }
+}
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/GreeterImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/GreeterImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/Server.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/Server.java?view=auto&rev=454377
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/Server.java (added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/Server.java Mon Oct 9 06:30:42 2006
@@ -0,0 +1,47 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.soap12;
+
+import javax.xml.ws.Endpoint;
+
+import org.apache.cxf.systest.common.TestServerBase;
+
+public class Server extends TestServerBase {
+
+
+ protected void run() {
+ Object implementor = new GreeterImpl();
+ String address = "http://localhost:9000/SoapContext/SoapPort";
+ Endpoint.publish(address, implementor);
+ }
+
+
+ public static void main(String[] args) {
+ try {
+ Server s = new Server();
+ s.start();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ System.exit(-1);
+ } finally {
+ System.out.println("done!");
+ }
+ }
+}
\ No newline at end of file
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/Server.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/Server.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/Soap12ClientServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/Soap12ClientServerTest.java?view=auto&rev=454377
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/Soap12ClientServerTest.java (added)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/Soap12ClientServerTest.java Mon Oct 9 06:30:42 2006
@@ -0,0 +1,72 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+
+package org.apache.cxf.systest.soap12;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.apache.cxf.systest.common.ClientServerSetupBase;
+import org.apache.cxf.systest.common.ClientServerTestBase;
+import org.apache.hello_world_soap12_http.Greeter;
+import org.apache.hello_world_soap12_http.SOAPService;
+
+public class Soap12ClientServerTest extends ClientServerTestBase {
+
+ private final QName serviceName = new QName("http://apache.org/hello_world_soap12_http",
+ "SOAPService");
+ private final QName portName = new QName("http://apache.org/hello_world_soap12_http", "SoapPort");
+
+ public static Test suite() throws Exception {
+ TestSuite suite = new TestSuite(Soap12ClientServerTest.class);
+ return new ClientServerSetupBase(suite) {
+ public void startServers() throws Exception {
+ assertTrue("server did not launch correctly", launchServer(Server.class));
+ }
+ };
+
+ }
+
+ public void testBasicConnection() throws Exception {
+ URL wsdl = getClass().getResource("/wsdl/hello_world_soap12.wsdl");
+ assertNotNull("WSDL is null", wsdl);
+
+ SOAPService service = new SOAPService(wsdl, serviceName);
+ assertNotNull("Service is ull ", service);
+
+ Greeter greeter = service.getPort(portName,
+ Greeter.class);
+
+ for (int i = 0; i < 5; i++) {
+ String echo = greeter.sayHi();
+ assertEquals("Bonjour", echo);
+ }
+
+ }
+
+ public static void main(String[] args) {
+ junit.textui.TestRunner.run(Soap12ClientServerTest.class);
+ }
+}
+
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/Soap12ClientServerTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/soap12/Soap12ClientServerTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/cxf/trunk/testutils/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/pom.xml?view=diff&rev=454377&r1=454376&r2=454377
==============================================================================
--- incubator/cxf/trunk/testutils/pom.xml (original)
+++ incubator/cxf/trunk/testutils/pom.xml Mon Oct 9 06:30:42 2006
@@ -165,6 +165,9 @@
</extraargs>
</wsdlOption>
<wsdlOption>
+ <wsdl>${basedir}/src/main/resources/wsdl/hello_world_soap12.wsdl</wsdl>
+ </wsdlOption>
+ <wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/hello_world_secure.wsdl</wsdl>
</wsdlOption>
<wsdlOption>
Added: incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world_soap12.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world_soap12.wsdl?view=auto&rev=454377
==============================================================================
--- incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world_soap12.wsdl (added)
+++ incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world_soap12.wsdl Mon Oct 9 06:30:42 2006
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<definitions name="HelloWorld"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://apache.org/hello_world_soap12_http"
+ xmlns:x1="http://apache.org/hello_world_soap12_http/types"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://apache.org/hello_world_soap12_http"
+ xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/">
+ <wsdl:types>
+ <schema targetNamespace="http://apache.org/hello_world_soap12_http/types"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:x1="http://apache.org/hello_world_soap12_http/types"
+ elementFormDefault="qualified">
+ <element name="sayHi">
+ <complexType/>
+ </element>
+ <element name="sayHiResponse">
+ <complexType>
+ <sequence>
+ <element name="responseType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="sayHiRequest">
+ <wsdl:part name="in" element="x1:sayHi"/>
+ </wsdl:message>
+ <wsdl:message name="sayHiResponse">
+ <wsdl:part name="out" element="x1:sayHiResponse"/>
+ </wsdl:message>
+
+ <wsdl:portType name="Greeter">
+ <wsdl:operation name="sayHi">
+ <wsdl:input name="sayHiRequest" message="tns:sayHiRequest"/>
+ <wsdl:output name="sayHiResponse" message="tns:sayHiResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="Greeter_SOAPBinding" type="tns:Greeter">
+ <soap12:binding transport="http://www.w3.org/2003/05/soap/bindings/HTTP/" style="document" />
+ <operation name="sayHi">
+ <soap12:operation style="document" soapAction=""/>
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ </wsdl:binding>
+
+ <wsdl:service name="SOAPService">
+ <wsdl:port name="SoapPort" binding="tns:Greeter_SOAPBinding">
+ <soap12:address location="http://localhost:9000/SoapContext/SoapPort"/>
+ </wsdl:port>
+ </wsdl:service>
+</definitions>
Propchange: incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world_soap12.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world_soap12.wsdl
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/testutils/src/main/resources/wsdl/hello_world_soap12.wsdl
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/SOAPBindingUtil.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/SOAPBindingUtil.java?view=diff&rev=454377&r1=454376&r2=454377
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/SOAPBindingUtil.java (original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/SOAPBindingUtil.java Mon Oct 9 06:30:42 2006
@@ -21,14 +21,13 @@
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
+import java.util.*;
import javax.wsdl.Binding;
import javax.wsdl.BindingInput;
import javax.wsdl.BindingOperation;
import javax.wsdl.BindingOutput;
+import javax.wsdl.extensions.ExtensibilityElement;
import javax.wsdl.extensions.soap.SOAPAddress;
import javax.wsdl.extensions.soap.SOAPBinding;
import javax.wsdl.extensions.soap.SOAPBody;
@@ -85,6 +84,17 @@
return "";
}
+ public static SoapOperation getSoapOperation(List<ExtensibilityElement> exts) {
+ if (exts != null) {
+ for (ExtensibilityElement ext : exts) {
+ if (isSOAPOperation(ext)) {
+ return getSoapOperation(ext);
+ }
+ }
+ }
+ return null;
+ }
+
public static SoapOperation getSoapOperation(Object obj) {
if (isSOAPOperation(obj)) {
return getProxy(SoapOperation.class, obj);
@@ -137,6 +147,15 @@
return null;
}
+ public static SoapBody getSoapBody(List<ExtensibilityElement> exts) {
+ for (ExtensibilityElement ext : exts) {
+ if (isSOAPBody(ext)) {
+ return getSoapBody(ext);
+ }
+ }
+ return null;
+ }
+
public static SoapBody getSoapBody(Object obj) {
if (isSOAPBody(obj)) {
return getProxy(SoapBody.class, obj);
@@ -152,6 +171,16 @@
return obj instanceof SOAPHeader || obj instanceof SOAP12Header;
}
+ public static List<SoapHeader> getSoapHeaders(List<ExtensibilityElement> exts) {
+ List<SoapHeader> headers = new ArrayList<SoapHeader>();
+ for (ExtensibilityElement ext : exts) {
+ if (isSOAPHeader(ext)) {
+ headers.add(getSoapHeader(ext));
+ }
+ }
+ return headers;
+ }
+
public static SoapHeader getSoapHeader(Object obj) {
if (isSOAPHeader(obj)) {
return getProxy(SoapHeader.class, obj);
@@ -200,6 +229,15 @@
return null;
}
+ public static SoapBinding getSoapBinding(List<ExtensibilityElement> exts) {
+ for (ExtensibilityElement ext : exts) {
+ if (isSOAPBinding(ext)) {
+ return getSoapBinding(ext);
+ }
+ }
+ return null;
+ }
+
public static SoapBinding getSoapBinding(Object obj) {
if (isSOAPBinding(obj)) {
return getProxy(SoapBinding.class, obj);
Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToProcessor.java?view=diff&rev=454377&r1=454376&r2=454377
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToProcessor.java (original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToProcessor.java Mon Oct 9 06:30:42 2006
@@ -393,31 +393,12 @@
public void checkSupported(Definition def) throws ToolException {
- if (isSOAP12Binding(wsdlDefinition)) {
- org.apache.cxf.common.i18n.Message msg =
- new org.apache.cxf.common.i18n.Message("SOAP12_UNSUPPORTED",
- LOG);
- throw new ToolException(msg);
- }
-
if (isRPCEncoded(wsdlDefinition)) {
org.apache.cxf.common.i18n.Message msg =
new org.apache.cxf.common.i18n.Message("UNSUPPORTED_RPC_ENCODED",
LOG);
throw new ToolException(msg);
}
- }
-
- private boolean isSOAP12Binding(Definition def) {
- String namespace = "";
- for (Iterator ite = def.getNamespaces().values().iterator(); ite.hasNext();) {
- namespace = (String)ite.next();
- if (namespace != null
- && namespace.toLowerCase().indexOf("http://schemas.xmlsoap.org/wsdl/soap12") >= 0) {
- return true;
- }
- }
- return false;
}
private boolean isRPCEncoded(Definition def) {
Modified: incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessorTest.java?view=diff&rev=454377&r1=454376&r2=454377
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessorTest.java (original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessorTest.java Mon Oct 9 06:30:42 2006
@@ -136,8 +136,57 @@
}
- public void testHelloWorld() throws Exception {
+ public void testHelloWorldSoap12() throws Exception {
+ env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/hello_world_soap12.wsdl"));
+ processor.setEnvironment(env);
+ processor.process();
+
+ assertNotNull(output);
+
+ File org = new File(output, "org");
+ assertTrue(org.exists());
+ File apache = new File(org, "apache");
+ assertTrue(apache.exists());
+ File helloworldsoaphttp = new File(apache, "hello_world_soap12_http");
+ assertTrue(helloworldsoaphttp.exists());
+ File types = new File(helloworldsoaphttp, "types");
+ assertTrue(types.exists());
+ File[] files = helloworldsoaphttp.listFiles();
+ assertEquals(3, files.length);
+ files = types.listFiles();
+ assertEquals(4, files.length);
+
+ Class clz = classLoader.loadClass("org.apache.hello_world_soap12_http.Greeter");
+ assertTrue("class " + clz.getName() + " modifier is not public", Modifier
+ .isPublic(clz.getModifiers()));
+ assertTrue("class " + clz.getName() + " modifier is interface",
+ Modifier.isInterface(clz
+ .getModifiers()));
+
+ WebService webServiceAnn = AnnotationUtil.getPrivClassAnnotation(clz, WebService.class);
+ assertEquals("Greeter", webServiceAnn.name());
+
+ Method method = clz.getMethod("sayHi", new Class[] {});
+ WebMethod webMethodAnno = AnnotationUtil.getPrivMethodAnnotation(method, WebMethod.class);
+ assertEquals(method.getName() + "()" + " Annotation : WebMethod.operationName ", "sayHi",
+ webMethodAnno.operationName());
+ RequestWrapper requestWrapperAnn = AnnotationUtil.getPrivMethodAnnotation(method,
+ RequestWrapper.class);
+
+ assertEquals("org.apache.hello_world_soap12_http.types.SayHi", requestWrapperAnn.className());
+
+ ResponseWrapper resposneWrapperAnn = AnnotationUtil.getPrivMethodAnnotation(method,
+ ResponseWrapper.class);
+
+ assertEquals("sayHiResponse", resposneWrapperAnn.localName());
+
+ WebResult webResultAnno = AnnotationUtil.getPrivMethodAnnotation(method, WebResult.class);
+
+ assertEquals("responseType", webResultAnno.name());
+ }
+
+ public void testHelloWorld() throws Exception {
env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/hello_world.wsdl"));
processor.setEnvironment(env);
processor.process();
Added: incubator/cxf/trunk/tools/wsdl2java/src/test/resources/wsdl2java_wsdl/hello_world_soap12.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/test/resources/wsdl2java_wsdl/hello_world_soap12.wsdl?view=auto&rev=454377
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/test/resources/wsdl2java_wsdl/hello_world_soap12.wsdl (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/test/resources/wsdl2java_wsdl/hello_world_soap12.wsdl Mon Oct 9 06:30:42 2006
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<definitions name="HelloWorld"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://apache.org/hello_world_soap12_http"
+ xmlns:x1="http://apache.org/hello_world_soap12_http/types"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://apache.org/hello_world_soap12_http"
+ xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/">
+ <wsdl:types>
+ <schema targetNamespace="http://apache.org/hello_world_soap12_http/types"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:x1="http://apache.org/hello_world_soap12_http/types"
+ elementFormDefault="qualified">
+ <element name="sayHi">
+ <complexType/>
+ </element>
+ <element name="sayHiResponse">
+ <complexType>
+ <sequence>
+ <element name="responseType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="sayHiRequest">
+ <wsdl:part name="in" element="x1:sayHi"/>
+ </wsdl:message>
+ <wsdl:message name="sayHiResponse">
+ <wsdl:part name="out" element="x1:sayHiResponse"/>
+ </wsdl:message>
+
+ <wsdl:portType name="Greeter">
+ <wsdl:operation name="sayHi">
+ <wsdl:input name="sayHiRequest" message="tns:sayHiRequest"/>
+ <wsdl:output name="sayHiResponse" message="tns:sayHiResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="Greeter_SOAPBinding" type="tns:Greeter">
+ <soap12:binding transport="http://www.w3.org/2003/05/soap/bindings/HTTP/" style="document" />
+ <operation name="sayHi">
+ <soap12:operation style="document" soapAction=""/>
+ <input>
+ <soap12:body use="literal" />
+ </input>
+ <output>
+ <soap12:body use="literal" />
+ </output>
+ </operation>
+ </wsdl:binding>
+
+ <wsdl:service name="SOAPService">
+ <wsdl:port name="SoapPort" binding="tns:Greeter_SOAPBinding">
+ <soap12:address location="http://localhost:9000/SoapContext/SoapPort"/>
+ </wsdl:port>
+ </wsdl:service>
+</definitions>
Propchange: incubator/cxf/trunk/tools/wsdl2java/src/test/resources/wsdl2java_wsdl/hello_world_soap12.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/tools/wsdl2java/src/test/resources/wsdl2java_wsdl/hello_world_soap12.wsdl
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/tools/wsdl2java/src/test/resources/wsdl2java_wsdl/hello_world_soap12.wsdl
------------------------------------------------------------------------------
svn:mime-type = text/xml