本文整理汇总了Java中org.apache.axiom.om.OMAbstractFactory.getSOAP11Factory方法的典型用法代码示例。如果您正苦于以下问题:Java OMAbstractFactory.getSOAP11Factory方法的具体用法?Java OMAbstractFactory.getSOAP11Factory怎么用?Java OMAbstractFactory.getSOAP11Factory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.axiom.om.OMAbstractFactory
的用法示例。
在下文中一共展示了OMAbstractFactory.getSOAP11Factory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDefaultSOAPEnvelope
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
private SOAPEnvelope createDefaultSOAPEnvelope(MessageContext inMsgCtx) {
String soapNamespace = inMsgCtx.getEnvelope().getNamespace()
.getNamespaceURI();
SOAPFactory soapFactory = null;
if (soapNamespace.equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
soapFactory = OMAbstractFactory.getSOAP11Factory();
} else if (soapNamespace
.equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
soapFactory = OMAbstractFactory.getSOAP12Factory();
} else {
log.error("Unknown SOAP Envelope");
}
if (soapFactory != null) {
return soapFactory.getDefaultEnvelope();
}
return null;
}
示例2: createPayload
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
private OMElement createPayload() {
// creation of payload for placeOrder
SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
OMNamespace omXsdNs = fac.createOMNamespace("http://services.samples", "xsd");
OMNamespace omSerNs = fac.createOMNamespace("http://services.samples", "ser");
OMElement operation = fac.createOMElement("placeOrder", omSerNs);
OMElement method = fac.createOMElement("order", omSerNs);
OMElement getPrice = fac.createOMElement("price", omXsdNs);
OMElement getQuantity = fac.createOMElement("quantity", omXsdNs);
OMElement getSymbol = fac.createOMElement("symbol", omXsdNs);
method.addChild(fac.createOMText(getPrice, "123.32"));
method.addChild(fac.createOMText(getQuantity, "4"));
method.addChild(fac.createOMText(getSymbol, "IBM"));
operation.addChild(method);
return operation;
}
示例3: createMultipleQuoteRequestBody
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
private OMElement createMultipleQuoteRequestBody(String symbol, int iterations) {
SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
OMNamespace omNs = fac.createOMNamespace("http://services.samples", "ns");
OMElement method1 = fac.createOMElement("getQuotes", omNs);
OMElement method2 = fac.createOMElement("getQuote", omNs);
for (int i = 0; i < iterations; i++) {
OMElement value1 = fac.createOMElement("request", omNs);
OMElement value2 = fac.createOMElement("symbol", omNs);
value2.addChild(fac.createOMText(value1, symbol));
value1.addChild(value2);
method2.addChild(value1);
method1.addChild(method2);
}
return method1;
}
示例4: createGetQuotesRequestBody
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
private OMElement createGetQuotesRequestBody(String symbol, int iterations) {
SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
OMNamespace omNs = fac.createOMNamespace("http://services.samples", "ns");
OMElement top = fac.createOMElement("getQuotes", omNs);
for (int i = 0; i < iterations; i++) {
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);
top.addChild(method);
}
return top;
}
示例5: createNestedQuoteRequestBody
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
private OMElement createNestedQuoteRequestBody(String symbol, int noOfItr) {
SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
OMNamespace omNs = fac.createOMNamespace("http://services.samples", "ns");
OMElement method1 = fac.createOMElement("getQuotes", omNs);
for (int i = 0; i < noOfItr; i++) {
OMElement method2 = fac.createOMElement("getQuote", omNs);
for (int j = 0; j < noOfItr; j++) {
OMElement value1 = fac.createOMElement("request", omNs);
OMElement value2 = fac.createOMElement("symbol", omNs);
value2.addChild(fac.createOMText(value1, symbol));
value1.addChild(value2);
method2.addChild(value1);
}
method1.addChild(method2);
}
return method1;
}
示例6: createSimpleQuoteRequestBody
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
private OMElement createSimpleQuoteRequestBody(String symbol) {
SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
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;
}
示例7: createMultipleQuoteRequestBody
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
private OMElement createMultipleQuoteRequestBody(String symbol, 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 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;
}
示例8: createMultipleCustomQuoteRequestBody
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
private OMElement createMultipleCustomQuoteRequestBody(String symbol, 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(symbol);
method.addChild(chkPrice);
}
return method;
}
示例9: createMultipleSymbolPayLoad
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的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;
}
示例10: createMultipleQuoteRequestBody
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
private OMElement createMultipleQuoteRequestBody(String symbol, 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 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;
}
示例11: createQuoteRequestBody
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
private OMElement createQuoteRequestBody(String symbol) {
SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
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: createQuoteRequestBody
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
private OMElement createQuoteRequestBody(String symbol) {
SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
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;
}
示例13: createSimpleQuoteRequestBody
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
private OMElement createSimpleQuoteRequestBody(String symbol) {
SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
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;
}
示例14: createAndSendSOAPResponse
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
private void createAndSendSOAPResponse(Map<String, Object> serviceResults, String serviceName, HttpServletResponse response) throws EventHandlerException {
try {
// setup the response
Debug.logVerbose("[EventHandler] : Setting up response message", module);
String xmlResults = SoapSerializer.serialize(serviceResults);
//Debug.logInfo("xmlResults ==================" + xmlResults, module);
XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(xmlResults));
StAXOMBuilder resultsBuilder = new StAXOMBuilder(reader);
OMElement resultSer = resultsBuilder.getDocumentElement();
// create the response soap
SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
SOAPEnvelope resEnv = factory.createSOAPEnvelope();
SOAPBody resBody = factory.createSOAPBody();
OMElement resService = factory.createOMElement(new QName(serviceName + "Response"));
resService.addChild(resultSer.getFirstElement());
resBody.addChild(resService);
resEnv.addChild(resBody);
// The declareDefaultNamespace method doesn't work see (https://issues.apache.org/jira/browse/AXIS2-3156)
// so the following doesn't work:
// resService.declareDefaultNamespace(ModelService.TNS);
// instead, create the xmlns attribute directly:
OMAttribute defaultNS = factory.createOMAttribute("xmlns", null, ModelService.TNS);
resService.addAttribute(defaultNS);
// log the response message
if (Debug.verboseOn()) {
try {
Debug.logInfo("Response Message:\n" + resEnv + "\n", module);
} catch (Throwable t) {
}
}
resEnv.serialize(response.getOutputStream());
response.getOutputStream().flush();
} catch (Exception e) {
Debug.logError(e, module);
throw new EventHandlerException(e.getMessage(), e);
}
}
示例15: createPayload
import org.apache.axiom.om.OMAbstractFactory; //导入方法依赖的package包/类
private OMElement createPayload() { // creation of payload for echoString
SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
OMNamespace omNs = fac.createOMNamespace("http://service.carbon.wso2.org", "ns");
OMElement operation = fac.createOMElement("echoString", omNs);
OMElement getName = fac.createOMElement("s", omNs);
getName.addChild(fac.createOMText(getName, "name"));
operation.addChild(getName);
return operation;
}