-
Notifications
You must be signed in to change notification settings - Fork 317
Description
Luca Cavanna opened SWS-502 and commented
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).
Affects: 1.5.6
Attachments:
- AxiomSoap11MessageFactoryTest.java (6.01 kB)
- Payload.java (2.54 kB)
- soapresponse.xml (916 bytes)
- SpringWsAxiomTestCase.java (2.09 kB)
Issue Links:
- Namespace prefix in attribute value not resolved correctly [SWS-509] #639 Namespace prefix in attribute value not resolved correctly
("is duplicated by")