Here you can find the source of createQueryResourcePropertiesCallBody(String aXqueryExpression)
Parameter | Description |
---|---|
aXqueryExpression | a parameter |
Parameter | Description |
---|---|
ParserConfigurationException | an exception |
public static Element createQueryResourcePropertiesCallBody(String aXqueryExpression) throws ParserConfigurationException
//package com.java2s; //License from project: Open Source License import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; public class Main { /**//from w ww. ja va 2 s.com * Creates the frame for SOAP message body for calling 'QueryResourceProperties' method of a service * (getting metadata) * @param aXqueryExpression * @return * @throws ParserConfigurationException */ public static Element createQueryResourcePropertiesCallBody(String aXqueryExpression) throws ParserConfigurationException { DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document doc = builder.newDocument(); String methodName = "QueryResourceProperties"; String parameterName = "QueryExpression"; String nameSpace = "http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd"; Element methodElement = doc.createElementNS(nameSpace, methodName); Element parameterElement = doc.createElementNS(nameSpace, parameterName); parameterElement.setAttribute("Dialect", "http://www.w3.org/TR/1999/REC-xpath-19991116"); methodElement.appendChild(parameterElement); Node parameter = doc.createTextNode(aXqueryExpression); parameterElement.appendChild(parameter); return methodElement; } }