Cocoon
  1. Cocoon
  2. COCOON-1883

SOAPHelper only accepts replies with an XML declaration

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.1.9
    • Fix Version/s: 2.1.10, 2.2
    • Component/s: Blocks: XSP
    • Labels:
      None
    • Urgency:
      Normal

      Description

      The SOAPHelper class [1] forces the SOAP-Reply to start with a XML declaration. I think this should be removed as the WS-I Soap Binding [2] states that an xml declaration is not necessary. So a valid WS-I reply may not work with the SOAPHelper at the moment.

      Instead of
                  int startOfXML = ret.indexOf("<?xml");
                  if (startOfXML == -1) { // No xml?!
                      throw new ProcessingException("Invalid response - no xml");
                  }
                  return new XScriptObjectInlineXML(
                          xscriptManager,
                          ret.substring(startOfXML));

      I just use
                  return new XScriptObjectInlineXML(
                          xscriptManager,
                          ret);

      I do not know why the position of the declaration is used to substring the answer. Is this necessary? If so would it be enough to just search for the first opening tag?


      [1] blocks/xsp/java/org/apache/cocoon/components/language/markup/xsp/SOAPHelper.java
      [2] http://www.ws-i.org/Profiles/SimpleSoapBindingProfile-1.0-2004-08-24.html#XML_Declarations

        Activity

        Hide
        Jörg Heinicke added a comment -
        Yes, I think your fix is appropriate. The instantiated XScriptObjectInlineXML even has a constructor that - when no string is passed - adds a string just consisting of the XML declaration.
        Show
        Jörg Heinicke added a comment - Yes, I think your fix is appropriate. The instantiated XScriptObjectInlineXML even has a constructor that - when no string is passed - adds a string just consisting of the XML declaration.

          People

          • Assignee:
            Jörg Heinicke
            Reporter:
            Fabian Linz
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development