-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
jbossws-native-3.0.1
-
None
SOAPHandler uses SOAPMessageContext to get SOAPMessage.
Then get SOAPBody via SOAPMessage.getSOAPBody().
Since SOAPBody extends org.w3c.dom.Element, use the following to get at <arg0>
Element arg0Element = (Element) body.getElementsByTagName("arg0").item(0);
System.out.println("arg0Element is null: " + (arg0Element == null)); // IT'S NULL
Here's the code:
public boolean handleMessage(SOAPMessageContext msgContext)
{
try
}
Here's the output:
-----INCOMING--------
<soapenv:Envelope xmlns:jcat='http://catalog.javatunes.com/' xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'><soapenv:Body><jcat:findByKeyword xmlns:jcat='http://catalog.javatunes.com/'><arg0>nn
</arg0>
</jcat:findByKeyword>
</soapenv:Body></soapenv:Envelope>
------------------------
arg0Element is null: true
NOTE: the whitespace nodes in the message are added by JBoss somewhere, the source message contained no whitespace. (Shouldn't matter anyway.)
You can see that <soapenv:Body> indeed has an <arg0> element (in no namespace).
I also tried this with <jcat:findByKeyword> using both getElementsByTagName and getElementsByTagNameNS, both yielding same result.
- is duplicated by
-
JBWS-2346 Issue with SAAJ API: SOAPBody.getElementsByTagNameNS() appears non-recursive
- Closed