camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r713944 - in /activemq/camel/trunk/components/camel-cxf: ./ src/main/java/org/apache/camel/component/cxf/interceptors/ src/main/java/org/apache/camel/component/cxf/invoker/ src/test/java/org/apache/camel/component/cxf/ src/test/resources/ s...
Date Fri, 14 Nov 2008 07:17:44 GMT
Author: ningjiang
Date: Thu Nov 13 23:17:40 2008
New Revision: 713944

URL: http://svn.apache.org/viewvc?rev=713944&view=rev
Log:
CAMEL-1088 fixed the soap header bug of camel-cxf endpoint in PAYLOAD data format

Added:
    activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadSoapHeaderTest.java
  (with props)
    activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/PizzaImpl.java
  (with props)
    activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/PizzaEndpoints.xml
  (with props)
    activemq/camel/trunk/components/camel-cxf/src/test/resources/pizza_service.wsdl   (with
props)
Modified:
    activemq/camel/trunk/components/camel-cxf/pom.xml
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/AbstractMessageInInterceptor.java
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/SoapMessageInInterceptor.java
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/SoapMessageOutInterceptor.java
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/XMLMessageInInterceptor.java
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/PayloadInvokingContext.java
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/PayloadMessage.java
    activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadMessageRouterTest.java

Modified: activemq/camel/trunk/components/camel-cxf/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/pom.xml?rev=713944&r1=713943&r2=713944&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/pom.xml (original)
+++ activemq/camel/trunk/components/camel-cxf/pom.xml Thu Nov 13 23:17:40 2008
@@ -309,6 +309,13 @@
       							<extraarg>${basedir}/src/test/resources/person-non-wrapper-binding.xml</extraarg>
       						</extraargs>
       					</wsdlOption>
+      					<wsdlOption>
+      						<wsdl>${basedir}/src/test/resources/pizza_service.wsdl</wsdl>
+      						<extraargs>
+      							<extraarg>-exsh</extraarg>
+      							<extraarg>true</extraarg>
+      						</extraargs>
+      					</wsdlOption>
       				</wsdlOptions>
       			</configuration>
       			<goals>

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/AbstractMessageInInterceptor.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/AbstractMessageInInterceptor.java?rev=713944&r1=713943&r2=713944&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/AbstractMessageInInterceptor.java
(original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/AbstractMessageInInterceptor.java
Thu Nov 13 23:17:40 2008
@@ -116,9 +116,7 @@
         BindingMessageInfo bmi = isRequestor(message) ?  boi.getOutput() : boi.getInput();
         List<Element> partList = getPartList(message, payloadEl, bmi);
         message.put(List.class, partList);
-
-        Element header = getHeader(message);
-        message.put(Element.class, header);
+        
     }
 
     /**
@@ -160,11 +158,5 @@
      */
     protected abstract List<Element> getPartList(T inMessage, Element rootElement,
BindingMessageInfo boi);
 
-    /**
-     * This method is called when the routing message interceptor has intercepted a inbound
-     * message as a DOM Content.  It retreives the header parts as DOM Element
-     * and returns a Element.
-     */
-    protected abstract Element getHeader(T inMessage);
-
+   
 }

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/SoapMessageInInterceptor.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/SoapMessageInInterceptor.java?rev=713944&r1=713943&r2=713944&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/SoapMessageInInterceptor.java
(original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/SoapMessageInInterceptor.java
Thu Nov 13 23:17:40 2008
@@ -16,10 +16,12 @@
  */
 package org.apache.camel.component.cxf.interceptors;
 
+
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
-//import java.util.ResourceBundle;
+
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -30,10 +32,11 @@
 import org.w3c.dom.Node;
 
 
+import org.apache.camel.pizza.types.CallerIDHeaderType;
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.binding.soap.model.SoapBindingInfo;
 import org.apache.cxf.common.logging.LogUtils;
-//import org.apache.cxf.common.i18n.BundleUtils;
+
 
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.message.Exchange;
@@ -113,11 +116,8 @@
         return partList;
     }
 
-    protected Element getHeader(SoapMessage inMessage) {
-        // need to find out the soap header information
-        Element element = null;
-        return element;
-        // return inMessage.getHeaders(Element.class);
-    }
+   
+
+    
 
 }

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/SoapMessageOutInterceptor.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/SoapMessageOutInterceptor.java?rev=713944&r1=713943&r2=713944&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/SoapMessageOutInterceptor.java
(original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/SoapMessageOutInterceptor.java
Thu Nov 13 23:17:40 2008
@@ -57,64 +57,13 @@
     }
 
     @SuppressWarnings("unchecked")
-    public void handleMessage(SoapMessage message) throws Fault {
-        // header is not store as the element
-        Element header = message.get(Element.class);
+    public void handleMessage(SoapMessage message) throws Fault {        
 
         List<Element> payload = message.get(List.class);
         Exchange exchange = message.getExchange();
         BindingMessageInfo bmi = exchange.get(BindingMessageInfo.class);
+        //The soap header is handled by the SoapOutInterceptor
 
-
-        //Headers -represent as -Element,Body -represent as StaxStream.
-        //Check if BindingOperationInfo contains header
-        List<SoapHeaderInfo> bindingHdr = bmi.getExtensors(SoapHeaderInfo.class);
-        if (bindingHdr != null && !bindingHdr.isEmpty()) {
-            if (LOG.isLoggable(Level.INFO)) {
-                LOG.info("SoapMessageOutInterceptor BindingOperation header processing.");
-            }
-
-            List<Element> headerList = new ArrayList<Element>();
-            List<Element> newPayload = new ArrayList<Element>(payload);
-            //Look for headers in Payload.
-            for (SoapHeaderInfo shi : bindingHdr) {
-                List<Element> tmpList = new ArrayList<Element>();
-                MessagePartInfo mpi = shi.getPart();
-                QName hdrName = mpi.getConcreteName();
-                for (Element el : payload) {
-                    QName elName = new QName(el.getNamespaceURI(), el.getLocalName());
-                    if (elName.equals(hdrName)) {
-                        newPayload.remove(el);
-                        tmpList.add(el);
-                    }
-                }
-
-                if (tmpList.size() > 1) {
-                    throw new Fault(new org.apache.cxf.common.i18n.Message(
-                                    "MULTIPLE_HDR_PARTS", LOG, hdrName));
-                }
-                headerList.addAll(tmpList);
-            }
-
-            if (LOG.isLoggable(Level.INFO)) {
-                LOG.info("DOMOutInterceptor Copy Payload parts to SOAPHeaders");
-            }
-            if (headerList.size() != 0) {
-                SoapVersion version = ((SoapMessage)message).getVersion();
-                header = createElement(version.getHeader(), headerList);
-            }
-            payload = newPayload;
-        }
-
-        //Set SOAP Header Element.
-        //Child Elements Could be binding specified parts or user specified headers.
-        //REVISTED the soap headers
-        //message.setHeaders(Element.class, header);
-
-        //TODO Moving Parts from Header to Payload.
-        //For e.g Payload ROuting from SOAP11 <-> SOAP12
-
-        //So write payload and header to outbound message
         if (LOG.isLoggable(Level.INFO)) {
             LOG.info("SoapMessageOutInterceptor binding operation style processing.");
         }

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/XMLMessageInInterceptor.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/XMLMessageInInterceptor.java?rev=713944&r1=713943&r2=713944&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/XMLMessageInInterceptor.java
(original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/XMLMessageInInterceptor.java
Thu Nov 13 23:17:40 2008
@@ -141,8 +141,4 @@
         return partList;
     }
     
-    protected Element getHeader(XMLMessage inMessage) {
-        return null;
-    }
-    
 }

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/PayloadInvokingContext.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/PayloadInvokingContext.java?rev=713944&r1=713943&r2=713944&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/PayloadInvokingContext.java
(original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/PayloadInvokingContext.java
Thu Nov 13 23:17:40 2008
@@ -23,7 +23,11 @@
 import java.util.logging.Logger;
 import org.w3c.dom.Element;
 
+import org.apache.camel.Headers;
+import org.apache.cxf.binding.soap.SoapHeader;
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.headers.Header;
+import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 
@@ -41,14 +45,14 @@
 
         PayloadMessage request = (PayloadMessage)contents.get(PayloadMessage.class);
 
-        Element header = request.getHeader();
+        List<SoapHeader> headers = request.getHeaders();
         List<Element> payload = request.getPayload();
 
         if (LOG.isLoggable(Level.FINEST)) {
-            LOG.finest("header = " + header + ", paylaod = " + payload);
+            LOG.finest("header = " + headers + ", paylaod = " + payload);
         }
 
-        message.put(Element.class, header);
+        message.put(Header.HEADER_LIST, headers);
         message.put(List.class, payload);
     }
 
@@ -58,7 +62,7 @@
 
         Message msg = exchange.getInMessage();
         List<Element> payload = getResponseObject(msg , responseContext, List.class);
-        Element header = exchange.getInMessage().get(Element.class);
+        List<SoapHeader> header = CastUtils.cast((List<?>)exchange.getInMessage().get(Header.HEADER_LIST));
         payloadMsg = new PayloadMessage(payload, header);
 
         if (LOG.isLoggable(Level.FINEST)) {
@@ -90,7 +94,7 @@
                 LOG.finest(payloadMessage.toString());
             }
             outMessage.put(List.class, payloadMessage.getPayload());
-            outMessage.put(Element.class, payloadMessage.getHeader());
+            outMessage.put(Header.HEADER_LIST, payloadMessage.getHeaders());
         }
     }
 
@@ -98,14 +102,14 @@
     @SuppressWarnings("unchecked")
     public Map<Class, Object> getRequestContent(Message inMessage) {
         List<Element> payload = inMessage.get(List.class);
-        Element header = inMessage.get(Element.class);
+        List<SoapHeader> headers = CastUtils.cast((List<?>)inMessage.get(Header.HEADER_LIST));
 
         if (LOG.isLoggable(Level.FINEST)) {
-            LOG.finest("Header = " + header + ", Payload = " + payload);
+            LOG.finest("Header = " + headers + ", Payload = " + payload);
         }
 
         Map<Class, Object> contents = new IdentityHashMap<Class, Object>();
-        contents.put(PayloadMessage.class, new PayloadMessage(payload, header));
+        contents.put(PayloadMessage.class, new PayloadMessage(payload, headers));
 
         return contents;
     }

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/PayloadMessage.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/PayloadMessage.java?rev=713944&r1=713943&r2=713944&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/PayloadMessage.java
(original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/invoker/PayloadMessage.java
Thu Nov 13 23:17:40 2008
@@ -17,30 +17,32 @@
 package org.apache.camel.component.cxf.invoker;
 
 import java.util.List;
-
 import org.w3c.dom.Element;
+import org.apache.cxf.binding.soap.SoapHeader;
+
+
 
 public class PayloadMessage {
     private List<Element> payload;
-    private Element header;
+    private List<SoapHeader> headers;
     
-    public PayloadMessage(List<Element> payload, Element header) {
+    public PayloadMessage(List<Element> payload, List<SoapHeader> headers) {
         this.payload = payload;
-        this.header = header;
+        this.headers = headers;
     }
     
     public List<Element> getPayload() {
         return payload;
     }
     
-    public Element getHeader() {
-        return header;
+    public List<SoapHeader> getHeaders() {
+        return headers;
     }
     
     public String toString() {
         StringBuffer buf = new StringBuffer();
         buf.append("payload: " + payload);
-        buf.append(" header: " + header);
+        buf.append(" headers: " + headers);
         return buf.toString();
     }
 }

Modified: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadMessageRouterTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadMessageRouterTest.java?rev=713944&r1=713943&r2=713944&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadMessageRouterTest.java
(original)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadMessageRouterTest.java
Thu Nov 13 23:17:40 2008
@@ -35,7 +35,7 @@
                 from(routerEndpointURI).process(new Processor() {
                     public void process(Exchange exchange) throws Exception {
                         Message inMessage = exchange.getIn();
-                        if(inMessage instanceof CxfMessage) {
+                        if (inMessage instanceof CxfMessage) {
                             CxfMessage message = (CxfMessage) inMessage;
                             List<Element> elements = message.getMessage().get(List.class);
                             assertNotNull("We should get the elements here" , elements);

Added: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadSoapHeaderTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadSoapHeaderTest.java?rev=713944&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadSoapHeaderTest.java
(added)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadSoapHeaderTest.java
Thu Nov 13 23:17:40 2008
@@ -0,0 +1,148 @@
+/**
+ * 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.camel.component.cxf;
+
+import java.net.URL;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Endpoint;
+
+import org.w3c.dom.Element;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.pizza.Pizza;
+import org.apache.camel.pizza.PizzaService;
+import org.apache.camel.pizza.types.CallerIDHeaderType;
+import org.apache.camel.pizza.types.OrderPizzaResponseType;
+import org.apache.camel.pizza.types.OrderPizzaType;
+import org.apache.camel.pizza.types.ToppingsListType;
+import org.apache.camel.spring.SpringCamelContext;
+import org.apache.cxf.binding.soap.SoapHeader;
+import org.apache.cxf.headers.Header;
+import org.apache.cxf.helpers.CastUtils;
+import org.apache.cxf.jaxws.EndpointImpl;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+
+
+public class CxfPayLoadSoapHeaderTest extends CxfRouterTestSupport {
+    protected AbstractXmlApplicationContext applicationContext; 
+    private final QName serviceName = new QName("http://camel.apache.org/pizza", "PizzaService");
+    
+    
+    private String routerEndpointURI = "cxf:bean:routerEndpoint?dataFormat=PAYLOAD";
+    private String serviceEndpointURI = "cxf:bean:serviceEndpoint?dataFormat=PAYLOAD";
+    
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            public void configure() {
+                // START SNIPPET: payload
+                from(routerEndpointURI).process(new Processor() {
+                    @SuppressWarnings("unchecked")
+                    public void process(Exchange exchange) throws Exception {
+                        Message inMessage = exchange.getIn();
+                        CxfMessage message = (CxfMessage) inMessage;
+                        List<Element> elements = message.getMessage().get(List.class);
+                        assertNotNull("We should get the payload elements here" , elements);
+                        assertEquals("Get the wrong elements size" , elements.size(), 1);
+                        assertEquals("Get the wrong namespace URI" , elements.get(0).getNamespaceURI(),
"http://camel.apache.org/pizza/types");
+                            
+                        List<SoapHeader> headers = CastUtils.cast((List<?>)message.getMessage().get(Header.HEADER_LIST));
+                        assertNotNull("We should get the headers here", headers);
+                        assertEquals("Get the wrong headers size", headers.size(), 1);
+                        assertEquals("Get the wrong namespace URI" , ((Element)(headers.get(0).getObject())).getNamespaceURI(),
"http://camel.apache.org/pizza/types");
+                        
+                    }
+                    
+                })
+                .to(serviceEndpointURI);
+                // END SNIPPET: payload
+            }
+        };
+    }
+
+    @Override
+    protected void setUp() throws Exception {
+        applicationContext = createApplicationContext();
+        super.setUp();
+        assertNotNull("Should have created a valid spring context", applicationContext);
+
+
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        if (applicationContext != null) {
+            applicationContext.destroy();
+        }
+        super.tearDown();
+    }
+
+    @Override
+    protected void startService() {
+        Object implementor = new PizzaImpl();
+        String address = "http://localhost:9023/new_pizza_service/services/PizzaService";
+        EndpointImpl endpoint = (EndpointImpl) Endpoint.publish(address, implementor);
+        server = endpoint.getServer();
+    }
+    
+    public void testPizzaService() {
+        Pizza port = getPort();
+
+        OrderPizzaType req = new OrderPizzaType();
+        ToppingsListType t = new ToppingsListType();
+        t.getTopping().add("test");
+        req.setToppings(t);
+
+        CallerIDHeaderType header = new CallerIDHeaderType();
+        header.setName("Willem");
+        header.setPhoneNumber("108");
+
+        OrderPizzaResponseType res =  port.orderPizza(req, header);
+
+        assertEquals(208, res.getMinutesUntilReady());
+    }
+    
+    private Pizza getPort() {
+        URL wsdl = getClass().getResource("/pizza_service.wsdl");
+        assertNotNull("WSDL is null", wsdl);
+
+        PizzaService service = new PizzaService(wsdl, serviceName);
+        assertNotNull("Service is null ", service);
+
+        return service.getPizzaPort();
+    }
+    
+    @Override
+    protected CamelContext createCamelContext() throws Exception {
+        return SpringCamelContext.springCamelContext(applicationContext);
+    }
+
+
+    protected ClassPathXmlApplicationContext createApplicationContext() {
+        return new ClassPathXmlApplicationContext("org/apache/camel/component/cxf/PizzaEndpoints.xml");
+    }
+    
+    
+
+}

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadSoapHeaderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfPayLoadSoapHeaderTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/PizzaImpl.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/PizzaImpl.java?rev=713944&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/PizzaImpl.java
(added)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/PizzaImpl.java
Thu Nov 13 23:17:40 2008
@@ -0,0 +1,36 @@
+/**
+ * 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.camel.component.cxf;
+
+import org.apache.camel.pizza.Pizza;
+import org.apache.camel.pizza.types.CallerIDHeaderType;
+import org.apache.camel.pizza.types.OrderPizzaResponseType;
+import org.apache.camel.pizza.types.OrderPizzaType;
+
+public class PizzaImpl implements Pizza {
+
+    public OrderPizzaResponseType orderPizza(OrderPizzaType body, CallerIDHeaderType callerID)
{
+        OrderPizzaResponseType resp = new OrderPizzaResponseType();
+        if (callerID == null) {
+            resp.setMinutesUntilReady(100);
+        } else {
+            resp.setMinutesUntilReady(100 + Integer.parseInt(callerID.getPhoneNumber()));
+        }
+        return resp;
+    }
+
+}

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/PizzaImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/PizzaImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/PizzaEndpoints.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/PizzaEndpoints.xml?rev=713944&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/PizzaEndpoints.xml
(added)
+++ activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/PizzaEndpoints.xml
Thu Nov 13 23:17:40 2008
@@ -0,0 +1,44 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:cxf="http://activemq.apache.org/camel/schema/cxfEndpoint"
+
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+       http://activemq.apache.org/camel/schema/cxfEndpoint http://activemq.apache.org/camel/schema/cxfEndpoint/camel-cxf.xsd
+       http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
+    ">
+   <import resource="classpath:META-INF/cxf/cxf.xml"/>
+   <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
+   <import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml" />
+   <!-- Added the import for testing the CAMEL-329 -->
+
+
+   <cxf:cxfEndpoint id="routerEndpoint" address="http://localhost:9013/pizza_service/services/PizzaService"
+    		serviceClass="org.apache.camel.pizza.Pizza"/>
+
+   <cxf:cxfEndpoint id="serviceEndpoint" address="http://localhost:9023/new_pizza_service/services/PizzaService"
+    		wsdlURL="pizza_service.wsdl"
+    		serviceClass="org.apache.camel.pizza.Pizza"
+    		endpointName="s:PizzaPort"
+    		serviceName="s:PizzaService"
+    	xmlns:s="http://camel.apache.org/pizza" />
+  
+
+</beans>
\ No newline at end of file

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/PizzaEndpoints.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/PizzaEndpoints.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/PizzaEndpoints.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: activemq/camel/trunk/components/camel-cxf/src/test/resources/pizza_service.wsdl
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/resources/pizza_service.wsdl?rev=713944&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/resources/pizza_service.wsdl (added)
+++ activemq/camel/trunk/components/camel-cxf/src/test/resources/pizza_service.wsdl Thu Nov
13 23:17:40 2008
@@ -0,0 +1,105 @@
+<?xml version="1.0" ?>
+<!--
+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.
+-->
+  <wsdl:definitions
+      name="PizzaService"
+      targetNamespace="http://camel.apache.org/pizza"
+      xmlns:tns="http://camel.apache.org/pizza"
+      xmlns:types="http://camel.apache.org/pizza/types"
+      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+
+    <wsdl:types>
+      <xsd:schema targetNamespace="http://camel.apache.org/pizza/types"
+                  xmlns:tns="http://camel.apache.org/pizza/types"
+                  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+                  elementFormDefault="qualified"
+                  version="1.0">
+
+        <xsd:element name="CallerIDHeader" type="tns:CallerIDHeaderType" />
+
+        <xsd:complexType name="CallerIDHeaderType">
+          <xsd:sequence>
+            <xsd:element name="Name" type="xsd:string" />
+            <xsd:element name="PhoneNumber" type="xsd:string" />
+          </xsd:sequence>
+        </xsd:complexType>
+
+        <xsd:element name="OrderRequest" type="tns:OrderPizzaType" />
+
+        <xsd:complexType name="OrderPizzaType">
+          <xsd:sequence>
+            <xsd:element name="Toppings" type="tns:ToppingsListType" />
+          </xsd:sequence>
+        </xsd:complexType>
+
+        <xsd:element name="OrderResponse" type="tns:OrderPizzaResponseType" />
+
+        <xsd:complexType name="OrderPizzaResponseType">
+          <xsd:sequence>
+            <xsd:element name="MinutesUntilReady" type="xsd:int" />
+          </xsd:sequence>
+        </xsd:complexType>
+
+        <xsd:complexType name="ToppingsListType">
+          <xsd:sequence>
+            <xsd:element name="Topping" type="xsd:string" minOccurs="0" maxOccurs="unbounded"
/>
+          </xsd:sequence>
+        </xsd:complexType>
+      </xsd:schema>
+    </wsdl:types>
+
+    <wsdl:portType name="Pizza">
+      <wsdl:operation name="OrderPizza">
+        <wsdl:input message="tns:OrderPizzaRequest" />
+        <wsdl:output message="tns:OrderPizzaResponse" />
+      </wsdl:operation>
+    </wsdl:portType>
+
+    <wsdl:message name="CallerIDHeader">
+      <wsdl:part name="callerID" element="types:CallerIDHeader"/>
+    </wsdl:message>
+
+    <wsdl:message name="OrderPizzaRequest">
+      <wsdl:part name="body" element="types:OrderRequest"/>
+    </wsdl:message>
+    <wsdl:message name="OrderPizzaResponse">
+      <wsdl:part name="body" element="types:OrderResponse"/>
+    </wsdl:message>
+
+  <wsdl:binding name="PizzaPortBinding" type="tns:Pizza">
+    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+    <wsdl:operation name="OrderPizza">
+      <soap:operation soapAction=""/>
+      <wsdl:input>
+        <soap:header message="tns:CallerIDHeader" part="callerID" use="literal" />
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+
+  <wsdl:service name="PizzaService">
+    <wsdl:port name="PizzaPort" binding="tns:PizzaPortBinding">
+      <soap:address location="http://localhost:9013/pizza_service/services/PizzaService"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/resources/pizza_service.wsdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/resources/pizza_service.wsdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/resources/pizza_service.wsdl
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message