I have an OMElement response coming from my web services written in Axis2.
<?xml version="1.0" encoding="UTF-8"?> <tns:XResponse xmlns:tns="mynamespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <tns:myObject xsi:type="tns:Type1_T"> <tns:name>aName</tns:name> </tns:myObject> </tns:XResponse> On the web services client side, I am trying to determine the xsi:type attribute value, using following code snippet, but type (in below code snippet) seems to be null : // response is the OMElement shown above. Iterator it = response.getChildElements(); while (it.hasNext()) { OMElement element = (OMElement) it.next(); if ((element.getLocalName()).compareTo("myObject") == 0) { OMAttribute type = element.getAttribute(new QName("xsi", "type")); // type is NULL...Why ????? } Could you please let me know what I am doing wrong ? Thanks
