Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

dom4J Node or Element Get Detail

807580Jul 12 2010 — edited Jul 12 2010
I've ran through all the methods on the dom4J Element and Node. I'm having an issue. I have a SOAP envelope with an header and a body. In the body there is a detail xml that has the type of request.

I get the body Node here correctly below.
 try
    {
    	bodyNode = myDoc.selectSingleNode("//soapenv:Envelope/soapenv:Body");
    	LOG.debug("bodyNode as XML : " + bodyNode.asXML());
    }
    catch(Exception e)
    {
    	LOG.debug("Cant find bodyNode : ", e);
    }
If I do the asXML() method I get.
<SOAP-ENV:Body>
	<IdentifyMember xmlns="http://soa.com/IdentificationService/">
		<IdentifyMemberRequest xmlns="http://soa.com/IdentificationService/">
			<FirstName xmlns="http://soa.com/IdentifyRequestSchema">= John</FirstName>
			<LastName xmlns="http://soa.com/IdentifyRequestSchema">= Smith</LastName>
		</IdentifyMemberRequest>
	</IdentifyMember>
</SOAP-ENV:Body>
This is correct. But I need to just get any xml between the body. For instance in this one I want the entire IdentifyMember element. I don't want to use index and substring and all of that. I was assuming there was already a method that would return me the following in either the Node or the Element. And I don't know what is coming in between those body tags so it has to be generic. Any Ideas?
<IdentifyMember xmlns="http://soa.com/IdentificationService/">
		<IdentifyMemberRequest xmlns="http://soa.com/IdentificationService/">
			<FirstName xmlns="http://soa.com/IdentifyRequestSchema">= John</FirstName>
			<LastName xmlns="http://soa.com/IdentifyRequestSchema">= Smith</LastName>
		</IdentifyMemberRequest>
	</IdentifyMember>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 9 2010
Added on Jul 12 2010
2 comments
466 views