# JcxTest.jws Sample

This topic inludes the source code for the JcxTest.jws Sample.

## Sample Location

This sample is located in the following directory in your WebLogic Workshop installation:

BEA_HOME/weblogic81/samples/workshop/ExtensionDevKit/ControlDevKit/ControlTest/featuresTests/

## Sample Source Code

`01 package featuresTests; 02 03 import com.bea.control.JwsContext; 04 import com.bea.control.ControlException; 05 import java.io.File; 06 import com.bea.xml.XmlCursor; 07 import com.bea.xml.XmlObject; 08 import java.io.InputStream; 09 10 public class JcxTest implements com.bea.jws.WebService 11 { 12 13 /** 14 * @common:control 15 */ 16 private featuresTests.POXQueryControl pOXQueryControl; 17 18 /** 19 * Executes an XQuery expression against the XML specified by the xmlFilePath argument. 20 * The query expression itself is specified as an attribute value on the control 21 * method called by this code. 22 * <br/> 23 * Note that for debugging purposes, control exceptions are not caught by this service. 24 * This means that if there is a problem with the query expression, it will be 25 * written to Test View. 26 * <br/> 27 * When testing with this method, the method's argument can point to a file 28 * in the control's jar (use "/jcxCreate/testXML/po.xml" to find this). The 29 * parameter can also give an absolute path a po.xml file included 30 * in the testXML folder of this feature test project. 31 * 32 * @common:operation 33 */ 34 public String getXMLData(String filePath) 35 { 36 String resultsXML = null; 37 XmlCursor queryResults = pOXQueryControl.selectLineItem(filePath); 38 resultsXML = queryResults.xmlText(); 39 return resultsXML; 40 } 41 }`