I am facing this problem for over than one month , so i would be realy pleased by your help , in fact i am asking about a way that can let me parse a SOAP message (request) to can retrieve the needed information , such as the security information if there is any and informations from the body of the message
Thanks for answering me , but know i am dealing with another problerm which is the WS-SecurityPolicy and i have to finaly parse an xml file like this one :
<?xml version="1.0" encoding="UTF-8"?>
<sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
<wsp:Policy>
<sp:TransportToken>
<wsp:Policy>
<sp:HttpsToken RequireClientCertificate="false"/>
</wsp:Policy>
</sp:TransportToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic128/>
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Lax/>
</wsp:Policy>
</sp:Layout>
<sp:IncludeTimestamp/>
</wsp:Policy>
</sp:TransportBinding>
<sp:SignedSupportingTokens xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
<wsp:Policy>
<sp:UsernameToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient" />
</wsp:Policy>
</sp:SignedSupportingTokens>
'
knowing that this XML file is named Policy.xml and contains the rules of WS-SecurityPolicy, which must be present.
i'm guessing you already have a soap object and want to parse the contents of the message.
if you have the soap message as a string then you can start from building the Document object using the string.
It depends on what's inside your message. You've tagged your question with
jaxb
which makes me think that you have xml-serialized data inside soap message. If this is the case you could use JAXB unmarshaller to convert your message to an instance of Java class:I've found this code to unmarshall from a SOAPResponse Message to POJO class, I hope be helpful.