cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1522999 - in /cxf/trunk: rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ rt/wsdl/src/main/java/org/apache/cxf/wsdl/interceptors/ systests/jaxws/src/test/java/org/apache/cx...
Date Fri, 13 Sep 2013 16:16:11 GMT
Author: dkulp
Date: Fri Sep 13 16:16:11 2013
New Revision: 1522999

URL: http://svn.apache.org/r1522999
Log:
[CXF-5268] Force everything to doc/lit/bare for provider/dispatch things

Modified:
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
    cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl/interceptors/DocLiteralInInterceptor.java
    cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java?rev=1522999&r1=1522998&r2=1522999&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java Fri Sep
13 16:16:11 2013
@@ -90,6 +90,7 @@ import org.apache.cxf.service.Service;
 import org.apache.cxf.service.factory.AbstractServiceFactoryBean;
 import org.apache.cxf.service.factory.ServiceConstructionException;
 import org.apache.cxf.service.model.BindingInfo;
+import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.service.model.ServiceModelUtil;
@@ -309,6 +310,16 @@ public class ServiceImpl extends Service
                     ei.setProperty("soap.no.validate.parts", Boolean.TRUE);
                 }
             }
+            
+            for (BindingInfo bind : si.getBindings()) {
+                for (BindingOperationInfo bop : bind.getOperations()) {
+                    //force to bare, no unwrapping
+                    if (bop.isUnwrappedCapable()) {
+                        bop.getOperationInfo().setUnwrappedOperation(null);
+                        bop.setUnwrappedOperation(null);
+                    }
+                }
+            }
         }
         return serviceFactory;
     }    

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java?rev=1522999&r1=1522998&r2=1522999&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
Fri Sep 13 16:16:11 2013
@@ -332,6 +332,11 @@ public class JaxWsServiceFactoryBean ext
                 for (BindingInfo bind : si.getBindings()) {
                     for (BindingOperationInfo bop : bind.getOperations()) {
                         OperationInfo o = bop.getOperationInfo();
+                        if (bop.isUnwrappedCapable()) {
+                            //force to bare, no unwrapping
+                            bop.getOperationInfo().setUnwrappedOperation(null);
+                            bop.setUnwrappedOperation(null);
+                        }
                         if (o.getInput() != null) {
                             if (o.getInput().getMessageParts().isEmpty()) {
                                 MessagePartInfo inf = o.getInput().addMessagePart(o.getName());

Modified: cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl/interceptors/DocLiteralInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl/interceptors/DocLiteralInInterceptor.java?rev=1522999&r1=1522998&r2=1522999&view=diff
==============================================================================
--- cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl/interceptors/DocLiteralInInterceptor.java
(original)
+++ cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl/interceptors/DocLiteralInInterceptor.java
Fri Sep 13 16:16:11 2013
@@ -87,9 +87,13 @@ public class DocLiteralInInterceptor ext
 
         Service service = ServiceModelUtil.getService(message.getExchange());
         bop = getBindingOperationInfo(xmlReader, exchange, bop, client);
-
+        boolean forceDocLitBare = false;
+        if (bop != null && bop.getBinding() != null) {
+            forceDocLitBare = Boolean.TRUE.equals(bop.getBinding().getService().getProperty("soap.force.doclit.bare"));
+        }
+        
         try {
-            if (bop != null && bop.isUnwrappedCapable()) {
+            if (!forceDocLitBare && bop != null && bop.isUnwrappedCapable())
{
                 ServiceInfo si = bop.getBinding().getService();
                 // Wrapped case
                 MessageInfo msgInfo = setMessage(message, bop, client, si);
@@ -181,15 +185,14 @@ public class DocLiteralInInterceptor ext
                         p = findMessagePart(exchange, operations, elName, client, paramNum,
message);
                     }
                     
-                    boolean dlb = Boolean.TRUE.equals(si.getProperty("soap.force.doclit.bare"));
-                    if (!dlb) {
+                    if (!forceDocLitBare) {
                         //Make sure the elName found on the wire is actually OK for 
                         //the purpose we need it
                         validatePart(p, elName, message);
                     }
              
                     o = dr.read(p, xmlReader);
-                    if (dlb && parameters.isEmpty()) {
+                    if (forceDocLitBare && parameters.isEmpty()) {
                         // webservice provider does not need to ensure size
                         parameters.add(o);
                     } else {

Modified: cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java?rev=1522999&r1=1522998&r2=1522999&view=diff
==============================================================================
--- cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
(original)
+++ cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
Fri Sep 13 16:16:11 2013
@@ -29,6 +29,7 @@ import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 
+import javax.jws.WebService;
 import javax.xml.bind.JAXBContext;
 import javax.xml.namespace.QName;
 import javax.xml.soap.MessageFactory;
@@ -46,6 +47,8 @@ import javax.xml.ws.Response;
 import javax.xml.ws.Service;
 import javax.xml.ws.WebServiceException;
 import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.soap.Addressing;
+import javax.xml.ws.soap.AddressingFeature;
 import javax.xml.ws.soap.SOAPBinding;
 import javax.xml.ws.soap.SOAPFaultException;
 import javax.xml.ws.wsaddressing.W3CEndpointReference;
@@ -69,7 +72,7 @@ import org.apache.cxf.testutil.common.Te
 import org.apache.cxf.transport.http.HTTPConduit;
 import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
 import org.apache.hello_world_soap_http.BadRecordLitFault;
-import org.apache.hello_world_soap_http.GreeterImpl;
+import org.apache.hello_world_soap_http.BaseGreeterImpl;
 import org.apache.hello_world_soap_http.SOAPService;
 import org.apache.hello_world_soap_http.types.GreetMe;
 import org.apache.hello_world_soap_http.types.GreetMeLater;
@@ -88,6 +91,16 @@ public class DispatchClientServerTest ex
 
     private static String greeterPort = TestUtil.getPortNumber(DispatchClientServerTest.class);

     
+    
+    @WebService(serviceName = "SOAPService",
+        portName = "SoapPort",
+        endpointInterface = "org.apache.hello_world_soap_http.Greeter",
+        targetNamespace = "http://apache.org/hello_world_soap_http",
+        wsdlLocation = "testutils/hello_world.wsdl")
+    @Addressing
+    public static class GreeterImpl extends BaseGreeterImpl {
+    }    
+    
     public static class Server extends AbstractBusTestServerBase {        
         Endpoint ep;
         
@@ -98,7 +111,6 @@ public class DispatchClientServerTest ex
                 + TestUtil.getPortNumber(DispatchClientServerTest.class)
                 + "/SOAPDispatchService/SoapDispatchPort";
             ep = Endpoint.create(SOAPBinding.SOAP11HTTP_BINDING, implementor);
-            
             Map<String, Object> properties = new HashMap<String, Object>();
             Map<String, String> nsMap = new HashMap<String, String>();
             nsMap.put("gmns", "http://apache.org/hello_world_soap_http/types");
@@ -511,6 +523,28 @@ public class DispatchClientServerTest ex
         
         JAXBContext jc = JAXBContext.newInstance("org.apache.hello_world_soap_http.types");
         Dispatch<Object> disp = service.createDispatch(PORT_NAME, jc, Service.Mode.PAYLOAD);
+        doJAXBPayload(disp);
+    }
+    @Test
+    public void testJAXBObjectPAYLOADFromEPR() throws Exception {
+        URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
+        assertNotNull(wsdl);
+
+        SOAPService service = new SOAPService(wsdl, SERVICE_NAME);
+        assertNotNull(service);
+
+        W3CEndpointReferenceBuilder builder = new  W3CEndpointReferenceBuilder();
+        builder.address("http://localhost:" 
+                        + greeterPort 
+                        + "/SOAPDispatchService/SoapDispatchPort");
+        builder.serviceName(SERVICE_NAME);
+        builder.endpointName(PORT_NAME);
+        W3CEndpointReference w3cEpr = builder.build();
+        JAXBContext jc = JAXBContext.newInstance("org.apache.hello_world_soap_http.types");
+        Dispatch<Object> disp = service.createDispatch(w3cEpr, jc, Service.Mode.PAYLOAD,
new AddressingFeature());
+        doJAXBPayload(disp);
+    }
+    private void doJAXBPayload(Dispatch<Object> disp) throws Exception {
         disp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                                      "http://localhost:" 
                                      + greeterPort



Mime
View raw message