当前位置: 首页>>代码示例>>Java>>正文


Java OMElement.setText方法代码示例

本文整理汇总了Java中org.apache.axiom.om.OMElement.setText方法的典型用法代码示例。如果您正苦于以下问题:Java OMElement.setText方法的具体用法?Java OMElement.setText怎么用?Java OMElement.setText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.axiom.om.OMElement的用法示例。


在下文中一共展示了OMElement.setText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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;
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:33,代码来源:StockQuoteHandler.java

示例2: sampleOperation

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
public OMElement sampleOperation(OMElement param) {
    param.build();
    param.detach();
    
    String sName = "";
    if (System.getProperty("test_mode") != null) {
        sName = org.apache.axis2.context.MessageContext.getCurrentMessageContext().getTo().getAddress();
    } else {
        sName = System.getProperty("server_name");
    }
    if (sName != null) {
        param.setText("Response from server: " + sName);
    } else {
        param.setText("Response from anonymous server");
    }
    return param;
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:18,代码来源:LBService1.java

示例3: addEmployee

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
private void addEmployee(String employeeNumber) throws AxisFault {
    OMElement payload = fac.createOMElement("addEmployee", omNs);

    OMElement empNo = fac.createOMElement("employeeNumber", omNs);
    empNo.setText(employeeNumber);
    payload.addChild(empNo);

    OMElement lastName = fac.createOMElement("lastName", omNs);
    lastName.setText("BBB");
    payload.addChild(lastName);

    OMElement fName = fac.createOMElement("firstName", omNs);
    fName.setText("AAA");
    payload.addChild(fName);

    OMElement email = fac.createOMElement("email", omNs);
    email.setText("[email protected]");
    payload.addChild(email);

    OMElement salary = fac.createOMElement("salary", omNs);
    salary.setText("50000");
    payload.addChild(salary);

    new AxisServiceClient().sendRobust(payload, serviceEndPoint, "addEmployee");

}
 
开发者ID:wso2,项目名称:product-ei,代码行数:27,代码来源:AddScheduleTaskTestCase.java

示例4: createPlaceOrderRequest

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
/**
 * Create place order request
 *
 * @param purchasePrice purchase price
 * @param qty           quantity
 * @param symbol        symbol
 * @return OMElement of request
 */
public OMElement createPlaceOrderRequest(double purchasePrice, 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(purchasePrice));
    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,代码行数:26,代码来源:StockQuoteClient.java

示例5: setInvokerName

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
public void setInvokerName(String invokerName) {
    this.invokerName = invokerName;

    if (statefull) {
        client.getOptions().setManageSession(true);
        client.getOptions().setAction("setClientName");

        OMElement cName = fac.createOMElement("cName", null);
        cName.setText(invokerName);

        try {
            OMElement response = client.sendReceive(cName);
            System.out.println(response.getText());
        } catch (AxisFault axisFault) {
            axisFault.printStackTrace();
        }
    }
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:19,代码来源:ServiceInvoker.java

示例6: createPayload

import org.apache.axiom.om.OMElement; //导入方法依赖的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;
    }
 
开发者ID:wso2,项目名称:product-ei,代码行数:22,代码来源:Sample700TestCase.java

示例7: IncreaseEmployeeSalary

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
private void IncreaseEmployeeSalary(String employeeNumber)
        throws AxisFault, InterruptedException {
    OMElement payload = fac.createOMElement("incrementEmployeeSalary", omNs);

    OMElement empNo = fac.createOMElement("employeeNumber", omNs);
    empNo.setText(employeeNumber);
    payload.addChild(empNo);

    OMElement salary = fac.createOMElement("increment", omNs);
    salary.setText("10000");
    payload.addChild(salary);

    new AxisServiceClient().sendRobust(payload, serviceEndPoint, "incrementEmployeeSalary");

    OMElement result = getEmployeeById(employeeNumber);
    Assert.assertTrue(result.toString().contains("<salary>60000.0</salary>"), "Expected Result Mismatched");
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:18,代码来源:ReScheduleTaskTestCase.java

示例8: getCustomPayload

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
public static OMElement getCustomPayload(String symbol) {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace omNs = fac.createOMNamespace("http://services.samples", "ns");
    OMElement payload = fac.createOMElement("getQuote", omNs);
    OMElement request = fac.createOMElement("request", omNs);
    OMElement code = fac.createOMElement("Code", omNs);
    code.setText(symbol);

    request.addChild(code);
    payload.addChild(request);
    return payload;
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:13,代码来源:Utils.java

示例9: 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;
}
 
开发者ID:cybozu,项目名称:garoon-google,代码行数:15,代码来源:ScheduleLeaveEvents.java

示例10: getThrowAxisFaultRequest

import org.apache.axiom.om.OMElement; //导入方法依赖的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;
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:11,代码来源:ESBJAVA2006RetryOnSOAPFaultTestCase.java

示例11: 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 : ids )
       {
        OMElement eventNode = omFactory.createOMElement("facility_id", null);
        eventNode.setText( String.valueOf(id) );
        parameters.addChild( eventNode );
       }

	return parameters;
}
 
开发者ID:cybozu,项目名称:garoon-google,代码行数:15,代码来源:ScheduleGetFacilitiesById.java

示例12: verifyDeletion

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
private void verifyDeletion(String employeeNumber) throws AxisFault {
    OMElement payload = fac.createOMElement("employeesByNumber", omNs);

    OMElement empNo = fac.createOMElement("employeeNumber", omNs);
    empNo.setText(employeeNumber);
    payload.addChild(empNo);

    OMElement result = new AxisServiceClient().sendReceive(payload, serviceEndPoint, "employeesByNumber");
    Assert.assertFalse(result.toString().contains("<employee>"), "Employee record found. deletion is now working fine");
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:11,代码来源:WhiteSpaceWithQueryParamsTest.java

示例13: 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;
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:10,代码来源:StockQuoteClient.java

示例14: createAccountUpdatePayload

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
private OMElement createAccountUpdatePayload(int intValue) {
	OMElement addToAccount = fac.createOMElement("addToAccountBalanceInBank2", omNs);
	OMElement accountId1 = fac.createOMElement("accountId", omNs);
	OMElement value1 = fac.createOMElement("value", omNs);
	addToAccount.addChild(accountId1);
	addToAccount.addChild(value1);
	accountId1.setText(""+intValue);
	value1.setText("h100");
	return addToAccount;
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:11,代码来源:DTPBatchRequestSampleTestcase.java

示例15: insertTimeStampToDb

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
/**
 * helper method to insert timestamp values to the database
 *
 * @param idString
 * @param timeStamp
 * @throws org.apache.axis2.AxisFault
 */
private void insertTimeStampToDb(String idString, String timeStamp) throws Exception {
    OMElement payload = fac.createOMElement("insertTimeStamp", omNs);

    OMElement idStringElmnt = fac.createOMElement("idString", omNs);
    idStringElmnt.setText(idString + "");
    payload.addChild(idStringElmnt);

    OMElement timeStampElmnt = fac.createOMElement("testTimeStamp", omNs);
    timeStampElmnt.setText(timeStamp + "");
    payload.addChild(timeStampElmnt);

    new AxisServiceClient().sendRobust(payload, backendUrl + serviceName, "insertTimeStamp");
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:21,代码来源:DS1189LeagyTimeStampModeTestCase.java


注:本文中的org.apache.axiom.om.OMElement.setText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。