1 2 Previous Next 16 Replies Latest reply on Jul 5, 2013 11:49 PM by Freeman(Yue) Fang

    Cannot route SOAP messages

    Anirban Gupta Newbie



      I was unable to route SOAP messages using Apache Camel. I was trying a simple example. The SOAP message is


      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:java="http://java.com/">










      My camel-context.xml defined in Spring DSL is:


      <?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


          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"

        <import resource="classpath:META-INF/spring/camel-cxf.xml" />

        <camelContext xmlns="http://camel.apache.org/schema/spring"
              <from uri="cxf:bean:helloConsumerEndpoint"/>
                      <xpath>/soapenv:Envelope/soapenv:Body/java:sayHello/arg0 = 'Anirban'</xpath>
                      <log message="UK message"/>
                      <to uri="file:D:/workspace/ExposeWS/target/messages/uk"/>
                      <log message="Other message"/>
                      <to uri="file:D:/workspace/ExposeWS/target/messages/others"/>



      I deployed the project containing this route in JBoss Fuse and when I hit it with the above SOAP message using SOAP UI, I was not expecting any response in SOAP UI and the SOAP message in target locations, but I received the following error in SOAP UI:


      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">




               <faultstring>Error during type conversion from type: org.apache.cxf.message.MessageContentsList to the required type: org.w3c.dom.Document with value [test] due org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.</faultstring>





      Please help.




        1 2 Previous Next