Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9137253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:04:46+00:00 2026-06-17T09:04:46+00:00

I have deployed a bundle in FuseESB which will log incoming soap request. I

  • 0

I have deployed a bundle in FuseESB which will log incoming soap request.
I have used Java DSL as

from("cxf:bean:comprovaWS?dataFormat=MESSAGE").setHeader("SOAPAction", new ConstantExpression("http://www.about.com")).streamCaching()
            .choice()
            .when(xPathBuilder).log("Request is:"+getParsedXPath(simple("${body}").getText().trim(),"//item[2]/stringValue/text()", false))
            .to("callService")
            .otherwise().log("Error");

When I use method getParsedXPath here the Fuse ESB shows exception as org.xml.sax.SAXParseException: Content is not allowed in prolog.

I am using abovementioned method to get CDATA information.
The method os as folows:

 public String getParsedXPath(String xmlStringToParse, String xPathExpression, boolean isNamespaceAware) {

    String parsedXMLPath="";
    try {
        DocumentBuilderFactory xmlFact =
                DocumentBuilderFactory.newInstance();

        DocumentBuilder builder = xmlFact.newDocumentBuilder();
        Document doc = builder.parse(new java.io.ByteArrayInputStream(xmlStringToParse.getBytes()));


        XPath xpath = XPathFactory.newInstance().newXPath();

        xmlFact.setNamespaceAware(isNamespaceAware);

        if(isNamespaceAware){

        xpath.setNamespaceContext(new NamespaceContext() {
    public String getNamespaceURI(String prefix) {
    // we know there's only one namespace uri, just return it!
    return "http://www.about.com";
    }

    // this is not used by XPath
    public String getPrefix(String namespaceURI) {
    System.out.println("getPrefix: " + namespaceURI);
    return null;
    }

    // this is not used by XPath
    public Iterator getPrefixes(String namespaceURI) {
    System.out.println("getPrefixes: " + namespaceURI);
    return null;
    }
});
        }



        NodeList nodes = (NodeList) xpath.evaluate(xPathExpression, doc, XPathConstants.NODESET);
    if (nodes.getLength() == 0) {
    parsedXMLPath="<error>Wrong xPath value: "+xPathExpression+"</error>";
    }
    else {

            parsedXMLPath = nodes.item(0).getNodeValue();
    }

    } catch (Exception e) {
        e.printStackTrace();
    }
    return parsedXMLPath;
}

If I use some demo XML in code itself which is equivalent of real soap request, Fuse installs bundle without any exception.

How can Fuse throw exception prior to accepting the SOAP request?
Can anyone tell me solution?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:04:47+00:00Added an answer on June 17, 2026 at 9:04 am

    The exception says that there is content in prolog. It means that your DSL may write some byte before the xml document. Verify that nothing is present at the top of the stream.

    Check also: Content is not allowed in Prolog SAXParserException

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple CXF RS bundle deployed in Fuse 4.2 that works fine
I have an OSGi bundle which is deployed into Apache Karaf 2.2.8 . In
I have created a Java app (deployed by Java Web Start) which needs to
I have created a bundle. However its not working when deployed to production server.
Have deployed numerous report parts which reference the same view however one of them
We have deployed a java webapplication in Elastic Beanstalk with the minimum instance count
I have deployed a website in my server, how i know which what my
I have an OSGi bundle (deployed into Karaf 2.2.4) that starts a Camel (2.10.0)
I have a flash app (deployed as Air or regular app for iOS) which
I have a php app which is deployed on Heroku. How do I get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.