本文整理汇总了Java中org.apache.axiom.om.OMElement.addChild方法的典型用法代码示例。如果您正苦于以下问题:Java OMElement.addChild方法的具体用法?Java OMElement.addChild怎么用?Java OMElement.addChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.axiom.om.OMElement
的用法示例。
在下文中一共展示了OMElement.addChild方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateESBRegistry
import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
protected void updateESBRegistry(String resourcePath) throws Exception {
SynapseConfigAdminClient synapseConfigAdminClient =
new SynapseConfigAdminClient(contextUrls.getBackEndUrl(), getSessionCookie());
//getting current configuration
OMElement synapseConfig = AXIOMUtil.stringToOM(synapseConfigAdminClient.getConfiguration());
synapseConfig.getFirstChildWithName(new QName(synapseConfig.getNamespace().getNamespaceURI()
, "registry")).detach();
//adding registry configuration
synapseConfig.addChild(esbUtils.loadResource(resourcePath).getFirstElement());
synapseConfigAdminClient.updateConfiguration(synapseConfig);
esbUtils.verifySynapseDeployment(synapseConfig, contextUrls.getBackEndUrl(), getSessionCookie());
//let server to persist the configuration
Thread.sleep(3000);
}
示例2: generateInsertProducts
import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
/**
* Helper method to generate insertProduct operation Request OME element.
*
* @param id
* @return
*/
private OMElement generateInsertProducts(int id) {
OMElement insertProductOpEl = fac.createOMElement("insert_into_products_operation", omNs);
OMElement productCodeEl = fac.createOMElement("productCode", omNs);
productCodeEl.setText("productCode" + id);
insertProductOpEl.addChild(productCodeEl);
OMElement productNameEl = fac.createOMElement("productName", omNs);
productNameEl.setText("productName" + id);
insertProductOpEl.addChild(productNameEl);
OMElement productLineEl = fac.createOMElement("productLine", omNs);
productLineEl.setText("productLine" + id);
insertProductOpEl.addChild(productLineEl);
OMElement productDescriptionEl = fac.createOMElement("productDescription", omNs);
productDescriptionEl.setText("productDescription" + id);
insertProductOpEl.addChild(productDescriptionEl);
OMElement quantityInStockEl = fac.createOMElement("quantityInStock", omNs);
quantityInStockEl.setText((((id * 3) + 13) * 5) + 15 + "");
insertProductOpEl.addChild(quantityInStockEl);
return insertProductOpEl;
}
示例3: generateSampleStockQuoteRequest
import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
/**
* Generate a request payload similar to what is sent by the test-axis2-client for SimpleStockQuoteService.
* @param symbol parameter used for payload
* @return sample request payload
*/
private String generateSampleStockQuoteRequest(String symbol) {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace soapNs = fac.createOMNamespace("http://schemas.xmlsoap.org/soap/envelope/", "soapenv");
OMNamespace omNs = fac.createOMNamespace("http://services.samples", "ns");
OMElement soapEnvelope = fac.createOMElement("Envelope", soapNs);
OMElement soapBody = fac.createOMElement("Body", soapNs);
OMElement method = fac.createOMElement("getSimpleQuote", omNs);
OMElement value1 = fac.createOMElement("symbol", omNs);
value1.addChild(fac.createOMText(method, symbol));
method.addChild(value1);
soapBody.addChild(method);
soapEnvelope.addChild(soapBody);
return "<?xml version='1.0' encoding='utf-8'?>" + soapEnvelope.toString();
}
示例4: createPlaceOrderRequest
import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
/**
* Create a new order for a quantiry of a stock at a given price
* <m:placeOrder xmlns:m="http://services.samples">
* <m:order>
* <m:price>3.141593E0</m:price>
* <m:quantity>4</m:quantity>
* <m:symbol>IBM</m:symbol>
* </m:order>
* </m:placeOrder>
*
* @param purchPrice the purchase price
* @param qty the quantiry
* @param symbol the stock
* @return an OMElement payload for the order
*/
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;
}
示例5: create
import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
/**
* SOAPリクエストで送るヘッダを作成します。
*
* @param actionName 利用するAPI名
* @param username APIを利用するユーザー名
* @param password APIを利用するユーザーのパスワード
* @param createdTime SOAPメッセージの作成日時
* @param expiredTime SOAPメッセージの有効期限
* @return org.apache.axiom.om.OMElement 生成されたヘッダ
*/
public static OMElement create(String actionName, String username, String password, Date createdTime,
Date expiredTime) {
OMElement soapHeader = getHeaderElement();
OMElement actionElement = getActionElement(actionName);
soapHeader.addChild(actionElement);
OMElement securityElement = getSecurityElement(username, password);
soapHeader.addChild(securityElement);
OMElement timestampElement = getTimestampElement(createdTime, expiredTime);
soapHeader.addChild(timestampElement);
return soapHeader;
}
示例6: createCustomQuoteRequest
import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
private OMElement createCustomQuoteRequest(String symbol) {
OMFactory factory = OMAbstractFactory.getOMFactory();
OMNamespace ns = factory.createOMNamespace("http://services.samples", "ns");
OMElement chkPrice = factory.createOMElement("CheckPriceRequest", ns);
OMElement code = factory.createOMElement("Code", ns);
chkPrice.addChild(code);
code.setText(symbol);
return chkPrice;
}
示例7: createStandardRequest
import org.apache.axiom.om.OMElement; //导入方法依赖的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;
}
示例8: createStandardSimpleRequest
import org.apache.axiom.om.OMElement; //导入方法依赖的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;
}
示例9: createQuoteRequestBody
import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
private OMElement createQuoteRequestBody() {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace("http://services.samples", "ns");
OMElement method = fac.createOMElement("getQuote", omNs);
OMElement value1 = fac.createOMElement("request", omNs);
method.addChild(value1);
return method;
}
示例10: createPayLoad
import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
private static OMElement createPayLoad() {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace("http://test.com", "test");
OMElement method = fac.createOMElement("add", omNs);
OMElement valueOfa = fac.createOMElement("a", omNs);
OMElement valueOfb = fac.createOMElement("b", omNs);
valueOfa.addChild(fac.createOMText(valueOfa, "200"));
valueOfb.addChild(fac.createOMText(valueOfb, "220"));
method.addChild(valueOfa);
method.addChild(valueOfb);
return method;
}
示例11: createStandardRequest
import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
private OMElement createStandardRequest(String symbol) {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace("http://services.samples", "ns");
OMElement method = fac.createOMElement("getQuote", 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;
}
示例12: generateSelectOrderByNumberElement
import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
/**
* Helper method to generate SelectOrderByNumber operation Request OME element.
*
* @param id
* @return
*/
private OMElement generateSelectOrderByNumberElement(int id) {
OMElement selectOrderByNumberOpEl = fac.createOMElement("select_order_by_number_operation", omNs);
OMElement orderNumberEl = fac.createOMElement("orderNumber", omNs);
orderNumberEl.setText("" + id);
selectOrderByNumberOpEl.addChild(orderNumberEl);
return selectOrderByNumberOpEl;
}
示例13: getParameters
import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
public final OMElement getParameters() {
OMFactory omFactory = OMAbstractFactory.getOMFactory();
OMElement parameters = omFactory.createOMElement("parameters", null);
for (Map.Entry<Integer, Integer> e : this.users.entrySet()) {
OMElement user = omFactory.createOMElement("user_item", null);
user.addAttribute("id", e.getKey().toString(), null);
user.addAttribute("version", e.getValue().toString(), null);
parameters.addChild(user);
}
return parameters;
}
示例14: getParameters
import org.apache.axiom.om.OMElement; //导入方法依赖的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;
}
示例15: createMultipleSymbolPayLoad
import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
private OMElement createMultipleSymbolPayLoad(int iterations) {
SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
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("SYM" + i);
method.addChild(chkPrice);
}
return method;
}