Disregard please.. Got it working with the following:
String xpathString = "//u:providerInfoRequest/u:consumerId";
AXIOMXPath xpathExpression = new AXIOMXPath(xpathString);
xpathExpression.addNamespace("u", "urn:my:schema:messages:2007-01-01");
String consumerIdValue = xpathExpression.stringValueOf(request);
Where request is the inbound SOAP Request (OMElement)
Regards,
- Anil
-----Original Message-----
Sent: Saturday, October 06, 2007 9:49 PM
I currently have the following SOAP request being sent to an Axis2 service:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:my:schema:messages:2007-01-01">
<soapenv:Header/>
<soapenv:Body>
<urn:providerInfoRequest>
<urn:consumerId>SomeValue</urn:consumerId>
</urn:providerInfoRequest>
</soapenv:Body>
</soapenv:Envelope>
On the service side, I am trying to parse out the value of "consumerId". I
am using the following code and am getting a SOAP fault:
String xpathString =
"/s:Envelope/s:Body/u:providerInfoRequest/u:consumerId";
AXIOMXPath xpathExpression = new AXIOMXPath(xpathString);
xpathExpression.addNamespace("u", "urn:my:schema:messages:2007-01-01");
xpathExpression.addNamespace("s",
"http://schemas.xmlsoap.org/soap/envelope/");
OMElement consumerId = (OMElement)
xpathExpression.selectSingleNode(element);
String idValue = consumerId.toString();
I am a newbie to using XPath with AXIOM and am more than likely doing
something wrong here.. Would appreciate some help in troubleshooting.
Regards,
- Anil
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]