本文整理汇总了Java中org.apache.axiom.om.OMFactory.createOMElement方法的典型用法代码示例。如果您正苦于以下问题:Java OMFactory.createOMElement方法的具体用法?Java OMFactory.createOMElement怎么用?Java OMFactory.createOMElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.axiom.om.OMFactory
的用法示例。
在下文中一共展示了OMFactory.createOMElement方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPlaceOrderRequest
import org.apache.axiom.om.OMFactory; //导入方法依赖的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;
}
开发者ID:wso2,项目名称:product-ei,代码行数:18,代码来源:ESBJAVA4279_MPRetryUponResponseSC_500_withNonRetryStatusCodes_200_and_202_TestCase.java
示例2: getSleepOperationRequestForIterator
import org.apache.axiom.om.OMFactory; //导入方法依赖的package包/类
private OMElement getSleepOperationRequestForIterator() throws XMLStreamException {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMElement omeSleep = fac.createOMElement("sleepOperation", null);
OMElement omeLoad1 = fac.createOMElement("load", null);
omeLoad1.setText("1000");
omeSleep.addChild(omeLoad1);
OMElement omeLoad2 = fac.createOMElement("load", null);
omeLoad2.setText("1000");
omeSleep.addChild(omeLoad2);
OMElement omeLoad3 = fac.createOMElement("load", null);
omeLoad3.setText("8000");
omeSleep.addChild(omeLoad3);
return omeSleep;
}
示例3: createMarketActivityRequest
import org.apache.axiom.om.OMFactory; //导入方法依赖的package包/类
/**
* Create a new market activity request with a body as follows
* <m:getMarketActivity xmlns:m="http://services.samples">
* <m:request>
* <m:symbol>IBM</m:symbol>
* ...
* <m:symbol>MSFT</m:symbol>
* </m:request>
* </m:getMarketActivity>
* @return OMElement for SOAP body
*/
public static OMElement createMarketActivityRequest() {
OMFactory factory = OMAbstractFactory.getOMFactory();
OMNamespace ns = factory.createOMNamespace("http://services.samples", "m0");
OMElement getQuote = factory.createOMElement("getMarketActivity", ns);
OMElement request = factory.createOMElement("request", ns);
OMElement symb = null;
for (int i=0; i<100; i++) {
symb = factory.createOMElement("symbols", ns);
symb.setText(randomString(3));
request.addChild(symb);
}
getQuote.addChild(request);
return getQuote;
}
示例4: createPayload
import org.apache.axiom.om.OMFactory; //导入方法依赖的package包/类
private OMElement createPayload() { // creation of payload for placeOrder
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace("http://services.samples", "urn");
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;
}
示例5: insertNewRecord
import org.apache.axiom.om.OMFactory; //导入方法依赖的package包/类
private OMElement insertNewRecord(String idNum) {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace("http://ws.wso2.org/dataservice", "dat");
OMElement payload = fac.createOMElement("insertop", omNs);
OMElement id = fac.createOMElement("id", omNs);
OMElement mod = fac.createOMElement("mod", omNs);
OMElement classname = fac.createOMElement("classname", omNs);
id.setText(idNum);
mod.setText("mod111");
classname.setText("org.wso2.carbon.dss.test");
payload.addChild(id);
payload.addChild(mod);
payload.addChild(classname);
return payload;
}
示例6: getTimestampElement
import org.apache.axiom.om.OMFactory; //导入方法依赖的package包/类
/**
* ヘッダ内のタイムスタンプに関するノードを生成します。
* @return org.apache.axiom.om.OMElement タイムスタンプ情報
*/
private static OMElement getTimestampElement(Date createdTime, Date expiredTime) {
OMFactory omFactory = OMAbstractFactory.getOMFactory();
OMNamespace timestampNs = omFactory.createOMNamespace("http://schemas.xmlsoap.org/ws/2002/07/utility", "");
OMElement timestampElement = omFactory.createOMElement("Timestamp", timestampNs);
OMElement createdElement = omFactory.createOMElement("Created", timestampNs);
createdElement.addChild(omFactory.createOMText(createdElement, DateUtil.dateToString(createdTime)));
OMElement expiresElement = omFactory.createOMElement("Expires", timestampNs);
expiresElement.addChild(omFactory.createOMText(expiresElement, DateUtil.dateToString(expiredTime)));
timestampElement.addChild(createdElement);
timestampElement.addChild(expiresElement);
return timestampElement;
}
示例7: sendLoadBalanceRequest
import org.apache.axiom.om.OMFactory; //导入方法依赖的package包/类
/**
* This method is used to send a single request to the load balancing service
* @param proxyURL will be the location where load balancing proxy or sequence is defined.
* @param serviceURL will be the URL for LBService
* @return the response
* @throws org.apache.axis2.AxisFault
*/
public String sendLoadBalanceRequest(String proxyURL,String serviceURL) throws AxisFault {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMElement value = fac.createOMElement("Value", null);
value.setText("Sample string");
Options options = new Options();
if (proxyURL != null && !"null".equals(proxyURL)) {
options.setTo(new EndpointReference(proxyURL));
}
options.setAction("urn:sampleOperation");
long timeout = Integer.parseInt(getProperty("timeout", "10000000"));
System.out.println("timeout=" + timeout);
options.setTimeOutInMilliSeconds(timeout);
if (serviceURL != null && !"null".equals(serviceURL)) {
// set addressing, transport and proxy url
serviceClient.engageModule("addressing");
options.setTo(new EndpointReference(serviceURL));
}
serviceClient.setOptions(options);
serviceClient.getOptions().setManageSession(true);
OMElement responseElement = serviceClient.sendReceive(value);
String response = responseElement.getText();
return response;
}
示例8: createStandardQuoteRequest
import org.apache.axiom.om.OMFactory; //导入方法依赖的package包/类
/**
* Create a new quote request with a body as follows
* <m:GetQuote xmlns:m="http://services.samples">
* <m:request>
* <m:symbol>IBM</m:symbol>
* </m:request>
* </m:GetQuote>
* @param symbol the stock symbol
* @return OMElement for SOAP body
*/
public static OMElement createStandardQuoteRequest(String symbol, int itrCount) {
OMFactory factory = OMAbstractFactory.getOMFactory();
OMNamespace ns = factory.createOMNamespace("http://services.samples", "m0");
OMElement getQuote = factory.createOMElement("getQuote", ns);
for (int i =0; i<itrCount; i++) {
OMElement request = factory.createOMElement("request", ns);
OMElement symb = factory.createOMElement("symbol", ns);
request.addChild(symb);
getQuote.addChild(request);
symb.setText(symbol);
}
return getQuote;
}
示例9: addSecurityHeader
import org.apache.axiom.om.OMFactory; //导入方法依赖的package包/类
/**
* The reason for using explicit way of setting SOAP header is, WSDL classes does not work
* perfectly
*
* @param client
* @param authType
* @param orgName
* @param crmTicket
*/
private final void addSecurityHeader(final ServiceClient client, final String orgName, final String crmTicket) {
/* Creating an Axiom factory */
final OMFactory fac = OMAbstractFactory.getOMFactory();
/* Creating header name spaces */
final OMNamespace webNs = fac.createOMNamespace(MSCRMSchemaConstants.WEBSERVICES, "web");
final OMNamespace coreNS = fac.createOMNamespace(MSCRMSchemaConstants.CORETYPE, "core");
/* Creating a sub-element to set the text */
final OMElement value = fac.createOMElement(MSCRMSchemaConstants.CRM_AUTH_TOKEN_TAG, webNs);
/* Create an 'AuthenticationType' element for header */
final OMElement AuthenticationType = fac.createOMElement(MSCRMSchemaConstants.CRM_AUTH_TYPE_TAG, coreNS);
AuthenticationType.setText(crmAuthType);
/* Create an 'CrmTicket' element for header */
final OMElement CrmTicket = fac.createOMElement(MSCRMSchemaConstants.CRM_TICKET_TAG, coreNS);
CrmTicket.setText(crmTicket);
/* Create an 'OrganizationName' element for header */
final OMElement OrganizationName = fac.createOMElement(MSCRMSchemaConstants.CRM_ORG_NAME_TAG, coreNS);
OrganizationName.setText(orgName);
/* Add all values in parent node: 'CrmAuthenticationToken' */
value.addChild(AuthenticationType);
value.addChild(CrmTicket);
value.addChild(OrganizationName);
/* Add header information at the client */
client.addHeader(value);
}
示例10: deleteCustomer
import org.apache.axiom.om.OMFactory; //导入方法依赖的package包/类
private OMElement deleteCustomer() {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace("http://ws.wso2.org/dataservice/samples/" +
"gspread_sql_driver_sample_service", "gsp");
OMElement deleteCustomerSQL = fac.createOMElement("deleteCustomerSQL", omNs);
OMElement customerNumber = fac.createOMElement("customerNumber", omNs);
customerNumber.setText(inputValue);
deleteCustomerSQL.addChild(customerNumber);
return deleteCustomerSQL;
}
示例11: getProductByCodePayload
import org.apache.axiom.om.OMFactory; //导入方法依赖的package包/类
private OMElement getProductByCodePayload() {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace("http://ws.wso2.org/dataservice/samples/eventing_sample", "even");
OMElement productCodeId = fac.createOMElement("productCode", omNs);
productCodeId.setText(productCode);
OMElement getProduct = fac.createOMElement("getProductByCode", omNs);
getProduct.addChild(productCodeId);
return getProduct;
}
示例12: getSleepOperationRequest
import org.apache.axiom.om.OMFactory; //导入方法依赖的package包/类
private OMElement getSleepOperationRequest() throws XMLStreamException {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMElement omeSleep = fac.createOMElement("sleepOperation", null);
OMElement omeLoad = fac.createOMElement("load", null);
omeLoad.setText("2000");
omeSleep.addChild(omeLoad);
return omeSleep;
}
示例13: createStandardRequest
import org.apache.axiom.om.OMFactory; //导入方法依赖的package包/类
private OMElement createStandardRequest(String symbol) {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace("http://services.samples", "m");
OMElement method = fac.createOMElement("getQuote", omNs);
OMElement value1 = fac.createOMElement("testRequest", omNs);
OMElement value2 = fac.createOMElement("testSymbol", omNs);
value2.addChild(fac.createOMText(value1, symbol));
value1.addChild(value2);
method.addChild(value1);
return method;
}
示例14: getParameters
import org.apache.axiom.om.OMFactory; //导入方法依赖的package包/类
@Override
public OMElement getParameters() {
OMFactory omFactory = OMAbstractFactory.getOMFactory();
OMElement parameters = omFactory.createOMElement("parameters", null);
for( Integer id : ids ){
OMElement eventIdNode = omFactory.createOMElement("event_id", null);
eventIdNode.setText(id.toString());
parameters.addChild(eventIdNode);
}
return parameters;
}
示例15: getHeader
import org.apache.axiom.om.OMFactory; //导入方法依赖的package包/类
private static OMElement getHeader(OMFactory factory) {
OMElement header = factory.createOMElement("header", null);
OMElement msgType = factory.createOMElement("field", null);
msgType.addAttribute(factory.createOMAttribute("id", null, "35"));
factory.createOMText(msgType, "D");
header.addChild(msgType);
OMElement sendingTime = factory.createOMElement("field", null);
sendingTime.addAttribute(factory.createOMAttribute("id", null, "52"));
factory.createOMText(sendingTime, new Date().toString());
header.addChild(sendingTime);
return header;
}