cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject svn commit: r469104 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/service/model/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/ rt/core/src/main/java/org...
Date Mon, 30 Oct 2006 09:39:31 GMT
Author: tli
Date: Mon Oct 30 01:39:30 2006
New Revision: 469104

URL: http://svn.apache.org/viewvc?view=rev&rev=469104
Log:
CXF-109 refactor the param in Soap Header processing

Added:
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapInPostInterceptor.java
  (with props)
Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java
    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/SoapBindingFactory.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/BareInInterceptorTest.java

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java?view=diff&rev=469104&r1=469103&r2=469104
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java
(original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java
Mon Oct 30 01:39:30 2006
@@ -24,6 +24,9 @@
 import org.apache.ws.commons.schema.XmlSchemaAnnotated;
 
 public final class MessagePartInfo extends AbstractPropertiesHolder {
+    
+    public static final String KEY_SKIPPED = "SKIPPED";
+    
     private QName pname;
     private AbstractMessageContainer mInfo;
     

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=469104&r1=469103&r2=469104
==============================================================================
--- 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 30 01:39:30 2006
@@ -26,6 +26,7 @@
 import javax.wsdl.extensions.ExtensibilityElement;
 import javax.xml.namespace.QName;
 
+import org.apache.cxf.binding.soap.model.SoapHeaderInfo;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.service.model.BindingMessageInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
@@ -39,6 +40,15 @@
     private HeaderUtil() {
     }
 
+    public static boolean isHeaderParam(List<SoapHeaderInfo> headers, MessagePartInfo
part) {
+        for (SoapHeaderInfo shi : headers) {
+            if (shi.getPart() == part) {
+                return true;
+            }
+        }
+        return false;
+    }
+    
     private static Set<QName> getHeaderParts(BindingMessageInfo bmi) {
         Object obj = bmi.getProperty(HEADERS_PROPERTY);
         if (obj == null) {

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=469104&r1=469103&r2=469104
==============================================================================
--- 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 30 01:39:30 2006
@@ -49,6 +49,7 @@
 import org.apache.cxf.binding.soap.interceptor.Soap11FaultOutInterceptor;
 import org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor;
 import org.apache.cxf.binding.soap.interceptor.Soap12FaultOutInterceptor;
+import org.apache.cxf.binding.soap.interceptor.SoapInPostInterceptor;
 import org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor;
 import org.apache.cxf.binding.soap.interceptor.SoapPreProtocolOutInterceptor;
 import org.apache.cxf.binding.soap.model.SoapBindingInfo;
@@ -175,6 +176,7 @@
         } else if (SoapConstants.BINDING_STYLE_DOC.equalsIgnoreCase(bindingStyle)
                         && SoapConstants.PARAMETER_STYLE_BARE.equalsIgnoreCase(parameterStyle))
{
             sb.getInInterceptors().add(new BareInInterceptor());
+            sb.getInInterceptors().add(new SoapInPostInterceptor());
             sb.getOutInterceptors().add(new BareOutInterceptor());
         } else {
             sb.getInInterceptors().add(new WrappedInInterceptor());
@@ -247,15 +249,10 @@
             for (SoapHeader header : headers) {
                 SoapHeaderInfo headerInfo = new SoapHeaderInfo();
                 headerInfo.setUse(header.getUse());
-
                 MessagePartInfo part = msg.getMessagePart(new QName(msg.getName().getNamespaceURI(),
header
                                 .getPart()));
-                if (part != null) {
-                    part.setInSoapHeader(true);
-                }
                 headerInfo.setPart(part);
                 messageParts.remove(part);
-
                 bmsg.addExtensor(headerInfo);
             }
         }

Added: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapInPostInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapInPostInterceptor.java?view=auto&rev=469104
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapInPostInterceptor.java
(added)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapInPostInterceptor.java
Mon Oct 30 01:39:30 2006
@@ -0,0 +1,150 @@
+/**
+ * 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.binding.soap.interceptor;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import org.apache.cxf.binding.soap.HeaderUtil;
+import org.apache.cxf.binding.soap.model.SoapHeaderInfo;
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.interceptor.AbstractInDatabindingInterceptor;
+import org.apache.cxf.interceptor.BareInInterceptor;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.message.Exchange;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.Phase;
+import org.apache.cxf.service.Service;
+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.service.model.OperationInfo;
+
+public class SoapInPostInterceptor extends AbstractInDatabindingInterceptor {
+
+    public SoapInPostInterceptor() {
+        super();
+        setPhase(Phase.UNMARSHAL);
+        addAfter(BareInInterceptor.class.getName());
+    }
+
+    public void handleMessage(Message message) throws Fault {
+        Exchange exchange = message.getExchange();
+
+        List<Object> parameters = (List<Object>) message.getContent(List.class);
+
+        Endpoint ep = exchange.get(Endpoint.class);
+        Service service = ep.getService();
+        BindingOperationInfo bop = exchange.get(BindingOperationInfo.class);
+
+        if (message.get(Element.class) != null) {
+            parameters.addAll(abstractParamsFromHeader(message.get(Element.class), ep, message));
+        }
+
+        // if we didn't know the operation going into this, find it.
+        if (bop == null) {
+            for (OperationInfo op : service.getServiceInfo().getInterface().getOperations())
{
+                Method method = (Method) op.getExtensor(Method.class);
+                if (!isMethodMatch(parameters, method)) {
+                    continue;
+                }
+                bop = ep.getEndpointInfo().getBinding().getOperation(op);
+                exchange.put(BindingOperationInfo.class, bop);
+                exchange.setOneWay(op.isOneWay());
+                break;
+            }
+            if (bop == null) {
+                throw new Fault(new RuntimeException("Can not find target operation"));
+            }
+        }
+
+        message.setContent(List.class, parameters);
+    }
+
+    private boolean isMethodMatch(List params, Method method) {
+        Class[] cls = method.getParameterTypes();
+        Type[] types = method.getGenericParameterTypes();
+        if (params.size() != cls.length) {
+            return false;
+        }
+        for (int i = 0; i < cls.length; i++) {
+            Class valueClass = cls[i];
+            if (cls[i].getName().equals("javax.xml.ws.Holder")) {
+                valueClass = ((ParameterizedType) types[i]).getRawType().getClass();
+            }
+            if (!params.get(i).getClass().isAssignableFrom(valueClass)) {
+                return false;
+            }
+        }
+        return true;
+    }
+    
+    
+    private List<Object> abstractParamsFromHeader(Element headerElement, Endpoint ep,
Message message) {
+        List<Object> paramInHeader = new ArrayList<Object>();
+        List<MessagePartInfo> parts = null;
+        List<Element> elemInHeader = new ArrayList<Element>();
+        for (BindingOperationInfo bop : ep.getEndpointInfo().getBinding().getOperations())
{
+            BindingMessageInfo bmi = null;
+            if (isRequestor(message)) {
+                parts = bop.getOutput().getMessageInfo().getMessageParts();
+                bmi = bop.getOutput();
+            } else {
+                parts = bop.getInput().getMessageInfo().getMessageParts();
+                bmi = bop.getInput();
+            }
+            List<SoapHeaderInfo> headers = bmi.getExtensors(SoapHeaderInfo.class);
+            for (MessagePartInfo mpi : parts) {
+                if (HeaderUtil.isHeaderParam(headers, mpi)) {
+                    NodeList nodeList = headerElement.getChildNodes();
+                    if (nodeList != null) {
+                        for (int i = 0; i < nodeList.getLength(); i++) {
+                            if (nodeList.item(i).getNamespaceURI().equals(
+                                    mpi.getElementQName().getNamespaceURI())
+                                    && nodeList.item(i).getLocalName().equals(
+                                            mpi.getElementQName().getLocalPart())) {
+                                Element param = (Element) nodeList.item(i);
+                                if (!elemInHeader.contains(param)) {
+                                    elemInHeader.add(param);
+                                }
+                            }
+                        }
+
+                    }
+
+                }
+            }
+        }
+
+        for (Iterator iter = elemInHeader.iterator(); iter.hasNext();) {
+            Element element = (Element) iter.next();
+            paramInHeader.add(getNodeDataReader(message).read(element));
+        }
+        return paramInHeader;
+    }
+
+}

Propchange: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapInPostInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapInPostInterceptor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java?view=diff&rev=469104&r1=469103&r2=469104
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapOutInterceptor.java
Mon Oct 30 01:39:30 2006
@@ -29,9 +29,12 @@
 
 import org.w3c.dom.Element;
 
+import org.apache.cxf.binding.soap.HeaderUtil;
 import org.apache.cxf.binding.soap.SoapFault;
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.binding.soap.SoapVersion;
+import org.apache.cxf.binding.soap.model.SoapBodyInfo;
+import org.apache.cxf.binding.soap.model.SoapHeaderInfo;
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.databinding.DataWriter;
 import org.apache.cxf.databinding.DataWriterFactory;
@@ -40,6 +43,7 @@
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.Service;
+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.service.model.ServiceModelUtil;
@@ -110,15 +114,18 @@
                  
         int countParts = 0;
         List<MessagePartInfo> parts = null;
+        BindingMessageInfo bmi = null;
         if (!isRequestor(message)) {
             if (operation.getOperationInfo().hasOutput()) {
                 parts = operation.getOutput().getMessageInfo().getMessageParts();
+                bmi = operation.getOutput();
             } else {
                 parts = new ArrayList<MessagePartInfo>();
             }
         } else {
             if (operation.getOperationInfo().hasInput()) {
                 parts = operation.getInput().getMessageInfo().getMessageParts();
+                bmi = operation.getInput();
             } else {
                 parts = new ArrayList<MessagePartInfo>();
             }
@@ -135,10 +142,11 @@
             Object[] els = parts.toArray();
             
             SoapVersion soapVersion = message.getVersion();
+            List<SoapHeaderInfo> headers = bmi.getExtensors(SoapHeaderInfo.class);
             for (int idx = 0; idx < countParts; idx++) {
                 Object arg = args[idx];
                 MessagePartInfo part = (MessagePartInfo)els[idx];
-                if (!part.isInSoapHeader()) {
+                if (headers == null || !HeaderUtil.isHeaderParam(headers, part)) {
                     continue;
                 } else {
                     if (!(startedHeader || preexistingHeaders)) {
@@ -158,6 +166,12 @@
                     dataWriter.write(arg, part, xtw);
                 }
                  
+            }
+            for (MessagePartInfo part : parts) {
+                if (bmi.getExtensor(SoapBodyInfo.class) != null 
+                        && !bmi.getExtensor(SoapBodyInfo.class).getParts().contains(part))
{
+                    part.setProperty(MessagePartInfo.KEY_SKIPPED, Boolean.TRUE);
+                }
             }
             if (startedHeader || preexistingHeaders) {
                 try {

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java?view=diff&rev=469104&r1=469103&r2=469104
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
Mon Oct 30 01:39:30 2006
@@ -32,6 +32,7 @@
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.databinding.DataReaderFactory;
+import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.AbstractPhaseInterceptor;
@@ -185,6 +186,10 @@
             MessagePartInfo p = (MessagePartInfo)msgInfo.getMessageParts().get(index);
 
             if (name.equals(p.getConcreteName())) {
+                Endpoint ep = exchange.get(Endpoint.class);
+                BindingOperationInfo boi = ep.getEndpointInfo().getBinding().getOperation(op);
+                exchange.put(BindingOperationInfo.class, boi);
+                exchange.setOneWay(op.isOneWay());
                 return p;
             }
 

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java?view=diff&rev=469104&r1=469103&r2=469104
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareInInterceptor.java
Mon Oct 30 01:39:30 2006
@@ -22,7 +22,6 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.ResourceBundle;
 import java.util.Set;
@@ -30,9 +29,6 @@
 
 import javax.xml.namespace.QName;
 
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.endpoint.Endpoint;
@@ -114,62 +110,7 @@
             }
             paramNum++;
         }
-
-        if (message.get(Element.class) != null) {
-            parameters.addAll(abstractParamsFromHeader(message.get(Element.class), ep, message));
-        }
-
-        // if we didn't know the operation going into this, find it.
-        if (bop == null) {
-            OperationInfo op = ops.iterator().next();
-            bop = ep.getEndpointInfo().getBinding().getOperation(op);
-            if (bop != null) {
-                exchange.put(BindingOperationInfo.class, bop);
-                exchange.setOneWay(op.isOneWay());
-            }
-        }
-        
         message.setContent(List.class, parameters);
-    }
-    
-    private List<Object> abstractParamsFromHeader(Element headerElement, Endpoint ep,
Message message) {
-        List<Object> paramInHeader = new ArrayList<Object>();
-        List<MessagePartInfo> parts = null;
-        List<Element> elemInHeader = new ArrayList<Element>();
-        for (BindingOperationInfo bop : ep.getEndpointInfo().getBinding().getOperations())
{
-
-            if (isRequestor(message)) {
-                parts = bop.getOutput().getMessageInfo().getMessageParts();
-            } else {
-                parts = bop.getInput().getMessageInfo().getMessageParts();
-            }
-
-            for (MessagePartInfo mpi : parts) {
-                if (mpi.isInSoapHeader()) {
-                    NodeList nodeList = headerElement.getChildNodes();
-                    if (nodeList != null) {
-                        for (int i = 0; i < nodeList.getLength(); i++) {
-                            if (nodeList.item(i).getNamespaceURI().equals(
-                                            mpi.getElementQName().getNamespaceURI())
-                                            && nodeList.item(i).getLocalName().equals(
-                                                            mpi.getElementQName().getLocalPart()))
{
-                                Element param = (Element) nodeList.item(i);
-                                if (!elemInHeader.contains(param)) {
-                                    elemInHeader.add(param);
-                                }
-                            }
-                        }
-
-                    }
-
-                }
-            }
-        }
-
-        for (Iterator iter = elemInHeader.iterator(); iter.hasNext();) {
-            Element element = (Element)iter.next();
-            paramInHeader.add(getNodeDataReader(message).read(element));
-        }
-        return paramInHeader;
+        
     }
 }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java?view=diff&rev=469104&r1=469103&r2=469104
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/BareOutInterceptor.java
Mon Oct 30 01:39:30 2006
@@ -69,12 +69,10 @@
                 for (int idx = 0; idx < countParts; idx++) {
                     Object arg = args[idx];
                     MessagePartInfo part = (MessagePartInfo)els[idx];
-                    if (part.isInSoapHeader()) {
+                    if (part.getProperty(MessagePartInfo.KEY_SKIPPED) == null) {
                         //this part should be in header, should donot write to soap body
-                        continue;
-                    }
-                    
-                    dataWriter.write(arg, part, message);
+                        dataWriter.write(arg, part, message);
+                    }                                        
                 }
             }
         }

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/BareInInterceptorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/BareInInterceptorTest.java?view=diff&rev=469104&r1=469103&r2=469104
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/BareInInterceptorTest.java
(original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/BareInInterceptorTest.java
Mon Oct 30 01:39:30 2006
@@ -26,14 +26,13 @@
 
 import org.apache.cxf.interceptor.BareInInterceptor;
 import org.apache.cxf.message.Message;
-import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.hello_world_soap_http.types.GreetMe;
 import org.apache.hello_world_soap_http.types.GreetMeResponse;
 
 public class BareInInterceptorTest extends TestBase {
 
     public void testInterceptorInbound() throws Exception {
-        BareInInterceptor interceptor = new BareInInterceptor();
+        BareInInterceptor interceptor = new BareInInterceptor();        
         message.setContent(XMLStreamReader.class, XMLInputFactory.newInstance()
             .createXMLStreamReader(getTestStream(getClass(), "resources/GreetMeDocLiteralReq.xml")));
 
@@ -49,12 +48,7 @@
         Object obj = parameters.get(0);
         assertTrue(obj instanceof GreetMe);
         GreetMe greet = (GreetMe)obj;
-        assertEquals("TestSOAPInputPMessage", greet.getRequestType());
-        
-        BindingOperationInfo bop = message.getExchange().get(BindingOperationInfo.class);
-        assertNotNull(bop);
-        
-        assertEquals("greetMe", bop.getName().getLocalPart());
+        assertEquals("TestSOAPInputPMessage", greet.getRequestType());        
     }
 
     public void testInterceptorOutbound() throws Exception {
@@ -73,8 +67,5 @@
         assertTrue(obj instanceof GreetMeResponse);
         GreetMeResponse greet = (GreetMeResponse)obj;
         assertEquals("TestSOAPOutputPMessage", greet.getResponseType());
-
-        BindingOperationInfo bop = message.getExchange().get(BindingOperationInfo.class);
-        assertNotNull(bop);
     }
 }



Mime
View raw message