Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-502

Soap envelope rpc-encoded namespace issue

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.6
    • Fix Version/s: 1.5.7
    • Component/s: Core, XML
    • Labels:
      None

      Description

      I have an rpc-encoded soap envelope containing the declarations of soapenv (xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/") and xsi (xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance") namespaces.
      The first element of the soap body references soapenv in one of his attributes (soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"). Some xml elements in the soap body reference the xsi namespace (xsi:type="soapenc:string") as well.
      When I try to parse the soap body (extracted from the soap envelope) using JDOM or DOM4J I get a SaxParseException because the soapenv and xsi namespaces are not bound:
      org.xml.sax.SAXParseException: The prefix "soapenv" for attribute "soapenv:encodingStyle" associated with an element type "ns1:sendMessage" is not bound.
      The issue seems to be creating a org.springframework.xml.transform.StaxSource using XMLStreamReader from Axiom payload element and transforming it to a StreamResult.
      I have found a workaround transforming the StaxSource in a JDOMResult instead of a StreamResult.
      The problem is the same as using javax.xml.transform.stax.StAXSource; some Axiom developers have suggested me to use OMSource from a snapshot version (https://issues.apache.org/jira/browse/WSCOMMONS-459) instead of StAXSource.
      The problem is in org.springframework.ws.soap.axiom.Payload#getSource() that uses XMLStreamReader class: namespace declarations is ok if I use OMSource from the snapshot version of axiom (the abstract method getStreamReader() is never used in this solution).

      1. AxiomSoap11MessageFactoryTest.java
        6 kB
        Luca Cavanna
      2. Payload.java
        3 kB
        Luca Cavanna
      3. soapresponse.xml
        0.9 kB
        Luca Cavanna
      4. SpringWsAxiomTestCase.java
        2 kB
        Luca Cavanna

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open In Progress In Progress
          24d 4h 15m 1 Arjen Poutsma 18/May/09 1:28 AM
          Resolved Resolved Reopened Reopened
          17h 50m 1 Arjen Poutsma 18/May/09 7:34 PM
          Reopened Reopened In Progress In Progress
          37m 2s 1 Arjen Poutsma 18/May/09 8:11 PM
          In Progress In Progress Resolved Resolved
          29m 22s 2 Arjen Poutsma 18/May/09 8:24 PM
          Resolved Resolved Closed Closed
          1081d 10h 38m 1 Arjen Poutsma 04/May/12 7:03 AM

            People

            • Assignee:
              arjen.poutsma Arjen Poutsma
              Reporter:
              lucacavanna Luca Cavanna
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: