I have to write a generic template for finding an operation name and the namespace for that from a soap response. Generic i mean, that is applicable to any operation. So I don't know the operation name and the name space name but want to get them and modify back when I am sending the response.
Here is the structure of the response:
Type 1: namespace for operation is defined in <soapenv:Envelope>
:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:inf="http://bad.com/abc/infrastructure"
xmlns:ret="http://bad.com/FirstOperationToExecute"
xmlns:com="http://bad.com/commercial">
<soapenv:Header/>
<soapenv:Body>
<ret:retrieveSummaryRequest>
<!-- ... result ... -->
</ret:retrieveSummaryRequest>
</soapenv:Body>
</soapenv:Envelope>
Type 2: namespace defined in the element <ret:retrieveSummaryRequest>
:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:inf="http://bad.com/abc/infrastructure"
xmlns:ret="http://bad.com/FirstOperationToExecute"
xmlns:com="http://bad.com/commercial">
<soapenv:Header/>
<soapenv:Body>
<ret:retrieveSummaryRequest xmlns:ret="http://bad.com/FirstOperationToExecute" >
<!-- ... result ... -->
</ret:retrieveSummaryRequest>
</soapenv:Body>
</soapenv:Envelope>
Type 3: default namespace in <retrieveSummaryRequest>
:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:inf="http://bad.com/abc/infrastructure"
xmlns:ret="http://bad.com/FirstOperationToExecute"
xmlns:com="http://bad.com/commercial">
<soapenv:Header/>
<soapenv:Body>
<retrieveSummaryRequest xmlns="http://bad.com/FirstOperationToExecute" >
<!-- ... result ... -->
</retrieveSummaryRequest>
</soapenv:Body>
</soapenv:Envelope>
Can somebody help me telling if there is a simple XPath statement for this to get the operation name and namespace.