Here you can find the source of getBodyContent(SOAPBody body)
Node
contaning the payload of a SOAPBody
/
Parameter | Description |
---|---|
body | the <code>SOAPBody</code> to extract the payload from |
Node
of the payload
public static Node getBodyContent(SOAPBody body)
//package com.java2s; //License from project: Apache License import javax.xml.soap.*; import java.util.Iterator; public class Main { /**//from w w w. ja va2 s . c o m * Extract the first <code>Node</code> contaning the payload of a <code>SOAPBody</code>/ * * @param body the <code>SOAPBody</code> to extract the payload from * @return the first <code>Node</code> of the payload */ public static Node getBodyContent(SOAPBody body) { Iterator iterator = body.getChildElements(); Node firstNode = null; while (iterator.hasNext()) { Node currentNode = (Node) iterator.next(); if (currentNode instanceof SOAPBodyElement) { firstNode = currentNode; break; } } return firstNode; } }