本文整理汇总了Java中org.apache.axiom.om.OMAbstractFactory.getOMFactory方法的典型用法代码示例。如果您正苦于以下问题:Java OMAbstractFactory.getOMFactory方法的具体用法?Java OMAbstractFactory.getOMFactory怎么用?Java OMAbstractFactory.getOMFactory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.axiom.om.OMAbstractFactory
的用法示例。
在下文中一共展示了OMAbstractFactory.getOMFactory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTokenCancelerConfigParameter
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
public static Parameter getTokenCancelerConfigParameter() {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMElement paramElem = fac.createOMElement(new QName("parameter"), null);
paramElem.addAttribute(fac.createOMAttribute("name",
null,
TokenCancelerConfig.TOKEN_CANCELER_CONFIG.
getLocalPart()));
paramElem.addAttribute(fac.createOMAttribute("type",
null, Integer.toString(Parameter.OM_PARAMETER).
toString()));
fac.createOMElement(TokenCancelerConfig.TOKEN_CANCELER_CONFIG,
paramElem);
Parameter param = new Parameter();
param.setName(TokenCancelerConfig.TOKEN_CANCELER_CONFIG.getLocalPart());
param.setParameterElement(paramElem);
param.setValue(paramElem);
param.setParameterType(Parameter.OM_PARAMETER);
return param;
}
示例2: createPayload
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
private OMElement createPayload() { // creation of payload for placeOrder
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace("http://services.samples", "ser");
OMNamespace xsdNs = fac.createOMNamespace("http://services.samples", "xsd");
OMElement payload = fac.createOMElement("placeOrder", omNs);
OMElement order = fac.createOMElement("order", omNs);
OMElement price = fac.createOMElement("price", xsdNs);
price.setText("10");
OMElement quantity = fac.createOMElement("quantity", xsdNs);
quantity.setText("100");
OMElement symbol = fac.createOMElement("symbol", xsdNs);
symbol.setText("WSO2");
order.addChild(price);
order.addChild(quantity);
order.addChild(symbol);
payload.addChild(order);
return payload;
}
示例3: createPlaceOrderRequest
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
public static OMElement createPlaceOrderRequest(double purchPrice, int qty, String symbol) {
OMFactory factory = OMAbstractFactory.getOMFactory();
OMNamespace ns = factory.createOMNamespace("http://services.samples", "m0");
OMElement placeOrder = factory.createOMElement("placeOrder", ns);
OMElement order = factory.createOMElement("order", ns);
OMElement price = factory.createOMElement("price", ns);
OMElement quantity = factory.createOMElement("quantity", ns);
OMElement symb = factory.createOMElement("symbol", ns);
price.setText(Double.toString(purchPrice));
quantity.setText(Integer.toString(qty));
symb.setText(symbol);
order.addChild(price);
order.addChild(quantity);
order.addChild(symb);
placeOrder.addChild(order);
return placeOrder;
}
示例4: updateRecord
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
private OMElement updateRecord(String idNum) {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace("http://ws.wso2.org/dataservice", "dat");
OMElement payload = fac.createOMElement("Update", omNs);
OMElement id = fac.createOMElement("id", omNs);
OMElement mod = fac.createOMElement("mod", omNs);
OMElement classname = fac.createOMElement("classname", omNs);
id.setText(idNum);
mod.setText("mod1112" + idNum);
classname.setText("org.wso2.carbon.dss.test2");
payload.addChild(id);
payload.addChild(mod);
payload.addChild(classname);
return payload;
}
示例5: selectOperation
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
@Test(groups = {"wso2.dss"}, invocationCount = 5)
public void selectOperation() throws AxisFault, XPathExpressionException {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace("http://ws.wso2.org/dataservice/samples/csv_sample_service", "ns1");
OMElement payload = fac.createOMElement("getProducts", omNs);
OMElement result = new AxisServiceClient().sendReceive(payload, getServiceUrlHttp(serviceName), "getProducts");
Assert.assertTrue((result.toString().indexOf("Products") == 1), "Expected Result not found on response message");
Assert.assertTrue(result.toString().contains("<Product>"), "Expected Result not found on response message");
Assert.assertTrue(result.toString().contains("<ID>"), "Expected Result not found on response message");
Assert.assertTrue(result.toString().contains("<Category>"), "Expected Result not found on response message");
Assert.assertTrue(result.toString().contains("<Price>"), "Expected Result not found on response message");
Assert.assertTrue(result.toString().contains("<Name>"), "Expected Result not found on response message");
log.info("Service invocation success");
}
示例6: sendUsingMTOM
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
public void sendUsingMTOM(String fileName, String targetEPR) throws IOException {
final String EXPECTED = "<m0:uploadFileUsingMTOMResponse xmlns:m0=\"http://services.samples\"><m0:response>" +
"<m0:image>PHByb3h5PkFCQzwvcHJveHk+</m0:image></m0:response></m0:uploadFileUsingMTOMResponse>";
OMFactory factory = OMAbstractFactory.getOMFactory();
OMNamespace ns = factory.createOMNamespace("http://services.samples", "m0");
OMElement payload = factory.createOMElement("uploadFileUsingMTOM", ns);
OMElement request = factory.createOMElement("request", ns);
OMElement image = factory.createOMElement("image", ns);
FileDataSource fileDataSource = new FileDataSource(new File(fileName));
DataHandler dataHandler = new DataHandler(fileDataSource);
OMText textData = factory.createOMText(dataHandler, true);
image.addChild(textData);
request.addChild(image);
payload.addChild(request);
ServiceClient serviceClient = new ServiceClient();
Options options = new Options();
options.setTo(new EndpointReference(targetEPR));
options.setAction("urn:uploadFileUsingMTOM");
options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
options.setCallTransportCleanup(true);
serviceClient.setOptions(options);
OMElement response = serviceClient.sendReceive(payload);
Assert.assertTrue(response.toString().contains(EXPECTED), "Attachment is missing in the response");
}
示例7: createMultipleCustomQuoteRequest
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
private OMElement createMultipleCustomQuoteRequest(String symbol, int iterations) {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace("http://services.samples", "ns");
OMElement method = fac.createOMElement("getQuote", omNs);
for (int i = 0; i < iterations; i++) {
OMElement chkPrice = fac.createOMElement("CheckPriceRequest", omNs);
OMElement code = fac.createOMElement("Code", omNs);
chkPrice.addChild(code);
code.setText(symbol);
method.addChild(chkPrice);
}
return method;
}
示例8: deleteRecord
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
private OMElement deleteRecord(String idNum) {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace("http://ws.wso2.org/dataservice", "dat");
OMElement payload = fac.createOMElement("delete", omNs);
OMElement id = fac.createOMElement("id", omNs);
id.setText(idNum);
payload.addChild(id);
return payload;
}
示例9: sessionlessClient
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
public String sessionlessClient() throws AxisFault {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMElement value = fac.createOMElement("Value", null);
value.setText("Sample string");
Options options = new Options();
options.setTo(new EndpointReference("http://localhost:8480/services/LBService1"));
options.setAction("urn:sampleOperation");
long timeout = Integer.parseInt(getProperty("timeout", "10000000"));
System.out.println("timeout=" + timeout);
options.setTimeOutInMilliSeconds(timeout);
// set addressing, transport and proxy url
serviceClient.engageModule("addressing");
options.setTo(new EndpointReference("http://localhost:8480"));
serviceClient.setOptions(options);
String testString = "";
long i = 0;
while (i < 100) {
serviceClient.getOptions().setManageSession(true);
OMElement responseElement = serviceClient.sendReceive(value);
String response = responseElement.getText();
i++;
System.out.println("Request: " + i + " ==> " + response);
testString = testString.concat(":" + i + ">" + response + ":");
}
return testString;
}
示例10: ServiceInvoker
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
public ServiceInvoker(String epr, String operation) {
this.operation = operation;
Options options = new Options();
options.setTo(new EndpointReference(epr));
options.setAction(operation);
try {
ConfigurationContext configContext = ConfigurationContextFactory.
createConfigurationContextFromFileSystem("client_repo", null);
client = new ServiceClient(configContext, null);
options.setTimeOutInMilliSeconds(10000000);
client.setOptions(options);
client.engageModule("addressing");
} catch (AxisFault axisFault) {
axisFault.printStackTrace();
}
fac = OMAbstractFactory.getOMFactory();
msg = fac.createOMElement("SampleMsg", null);
OMElement load = fac.createOMElement("load", null);
load.setText("1000");
msg.addChild(load);
}
示例11: createStandardSimpleRequest
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
private OMElement createStandardSimpleRequest(String symbol) {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace("http://services.samples", "ns");
OMElement method = fac.createOMElement("getSimpleQuote", omNs);
OMElement value1 = fac.createOMElement("symbol", omNs);
value1.addChild(fac.createOMText(method, symbol));
method.addChild(value1);
return method;
}
示例12: getParameters
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
@Override
public OMElement getParameters() {
OMFactory omFactory = OMAbstractFactory.getOMFactory();
OMElement parameters = omFactory.createOMElement("parameters", null);
for( Integer id : eventIds )
{
OMElement eventNode = omFactory.createOMElement("event_id", null);
eventNode.setText( String.valueOf(id) );
parameters.addChild( eventNode );
}
return parameters;
}
示例13: createRequest
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
private OMElement createRequest(String symbol) {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace("http://services.samples", "ns");
OMElement method = fac.createOMElement("payload", omNs);
OMElement value1 = fac.createOMElement("request", omNs);
OMElement value2 = fac.createOMElement("symbol", omNs);
value2.addChild(fac.createOMText(value1, symbol));
value1.addChild(value2);
method.addChild(value1);
return method;
}
示例14: getThrowAxisFaultRequest
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
public OMElement getThrowAxisFaultRequest() {
OMFactory factory = OMAbstractFactory.getOMFactory();
OMNamespace ns = factory.createOMNamespace("http://processor.message.mediator.carbon.wso2.org", "proc");
OMElement throwFault = factory.createOMElement("throwAxisFault", ns);
OMElement str = factory.createOMElement("s", ns);
str.setText("Throw_Fault");
throwFault.addChild(str);
return throwFault;
}
示例15: getSimpleQuoteRequest
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
public static OMElement getSimpleQuoteRequest(String symbol) {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace("http://services.samples", "ns");
OMElement omGetQuote = fac.createOMElement("getSimpleQuote", omNs);
OMElement value1 = fac.createOMElement("symbol", omNs);
value1.addChild(fac.createOMText(omGetQuote, symbol));
omGetQuote.addChild(value1);
return omGetQuote;
}