本文整理汇总了Java中org.apache.axis2.client.Options.setSoapVersionURI方法的典型用法代码示例。如果您正苦于以下问题:Java Options.setSoapVersionURI方法的具体用法?Java Options.setSoapVersionURI怎么用?Java Options.setSoapVersionURI使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.axis2.client.Options
的用法示例。
在下文中一共展示了Options.setSoapVersionURI方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getResponse
import org.apache.axis2.client.Options; //导入方法依赖的package包/类
private SOAPEnvelope getResponse(SOAPEnvelope inEnvelope) throws AxisFault {
ConfigurationContext confctx = ConfigurationContextFactory.
createConfigurationContextFromFileSystem(TestingUtils.prefixBaseDirectory("target/test-resources/integrationRepo"),
null);
ServiceClient client = new ServiceClient(confctx, null);
Options options = new Options();
client.setOptions(options);
options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
options.setTo(targetEPR);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
options.setExceptionToBeThrownOnSOAPFault(false);
MessageContext msgctx = new MessageContext();
msgctx.setEnvelope(inEnvelope);
OperationClient opClient = client.createClient(ServiceClient.ANON_OUT_IN_OP);
opClient.addMessageContext(msgctx);
opClient.execute(true);
return opClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE).getEnvelope();
}
示例2: getOptions
import org.apache.axis2.client.Options; //导入方法依赖的package包/类
protected Options getOptions(String action, boolean enableMTOM, String url) {
Options options = new Options();
options.setAction(action);
options.setProperty(WSDL2Constants.ATTRIBUTE_MUST_UNDERSTAND,"1");
options.setTo( new EndpointReference(url) );
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
// try {
// String from = InetAddress.getLocalHost().getHostAddress();
// options.setFrom(new EndpointReference(from));
// }catch(UnknownHostException e) {
// //ignore From
// }
if (enableMTOM)
options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
else
options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_FALSE);
//use SOAP12,
options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
return options;
}
示例3: testEchoXMLSync
import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public void testEchoXMLSync() throws Exception {
for (int i = 0; i < 10; i++) {
OMElement payload = createPayload();
Options clientOptions = new Options();
clientOptions.setTo(targetEPR);
clientOptions.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
clientOptions.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
ConfigurationContext configContext =
ConfigurationContextFactory
.createConfigurationContextFromFileSystem(null, null);
ServiceClient sender = new ServiceClient(configContext, null);
sender.setOptions(clientOptions);
OMElement result = sender.sendReceive(payload);
OMElement data = (OMElement)result.getFirstOMChild();
compareWithCreatedOMText(data.getText());
log.info("" + i);
UtilServer.unDeployClientService();
}
}
示例4: testLocalEchoXMLSync
import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public void testLocalEchoXMLSync() throws Exception {
OMElement payload = TestingUtils.createDummyOMElement();
Options options = new Options();
options.setTo(targetEPR);
options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
ConfigurationContext configContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
ServiceClient sender = new ServiceClient(configContext, null);
sender.setOptions(options);
OMElement result = sender.sendReceive(payload);
TestingUtils.compareWithCreatedOMElement(result);
}
示例5: testSaveAndRestoreOfMessage
import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public void testSaveAndRestoreOfMessage() throws Exception {
OMElement payload = TestingUtils.createDummyOMElement();
Options options = new Options();
options.setTo(TestConstants.targetEPR);
options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
options.setAction(TestConstants.operationName.getLocalPart());
options.setUseSeparateListener(true);
ConfigurationContext configContext = UtilServer.createClientConfigurationContext();
ServiceClient sender = new ServiceClient(configContext, null);
sender.setOptions(options);
sender.engageModule("addressing");
OMElement result = sender.sendReceive(payload);
TestingUtils.compareWithCreatedOMElement(result);
}
示例6: testSendRobust
import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public void testSendRobust() throws Exception {
EndpointReference targetEPR = new EndpointReference(
"http://127.0.0.1:" + (UtilServer.TESTING_PORT)
// "http://127.0.0.1:" + 5556
+ "/axis2/services/Echo/echoOMElementNoResponse");
OMElement payload = createDummyOMElement();
Options options = new Options();
options.setTo(targetEPR);
options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
options.setAction("urn:echoOMElementNoResponse");
ConfigurationContext configContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
ServiceClient sender = new ServiceClient(configContext, null);
sender.setOptions(options);
sender.sendRobust(payload);
String value = System.getProperty("echoOMElementNoResponse");
System.setProperty("echoOMElementNoResponse", "");
assertEquals(value, "echoOMElementNoResponse");
}
示例7: testFireAndForget
import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public void testFireAndForget() throws Exception {
EndpointReference targetEPR = new EndpointReference(
"http://127.0.0.1:" + (UtilServer.TESTING_PORT)
// "http://127.0.0.1:" + 5556
+ "/axis2/services/Echo/echoOMElementNoResponse");
OMElement payload = createDummyOMElement();
Options options = new Options();
options.setTo(targetEPR);
options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
options.setAction("urn:echoOMElementNoResponse");
ConfigurationContext configContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
ServiceClient sender = new ServiceClient(configContext, null);
sender.setOptions(options);
sender.fireAndForget(payload);
Thread.sleep(100);
String value = System.getProperty("echoOMElementNoResponse");
System.setProperty("echoOMElementNoResponse", "");
assertEquals(value, "echoOMElementNoResponse");
}
示例8: createClientSideAxisService
import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public static AxisService createClientSideAxisService(
Definition wsdlDefinition, QName wsdlServiceName, String portName,
Options options) throws AxisFault {
WSDL11ToAxisServiceBuilder serviceBuilder = new WSDL11ToAxisServiceBuilder(
wsdlDefinition, wsdlServiceName, portName);
serviceBuilder.setServerSide(false);
AxisService axisService = serviceBuilder.populateService();
AxisEndpoint axisEndpoint = (AxisEndpoint) axisService.getEndpoints()
.get(axisService.getEndpointName());
if (axisEndpoint != null) {
options.setTo(new EndpointReference(axisEndpoint.getEndpointURL()));
options.setSoapVersionURI((String) axisEndpoint.getBinding()
.getProperty(WSDL2Constants.ATTR_WSOAP_VERSION));
}
return axisService;
}
示例9: testMutipleInvocation
import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public void testMutipleInvocation() throws Exception {
OMElement payload = TestingUtils.createDummyOMElement();
Options options = new Options();
options.setAction("urn:echoOM");
options.setTo(targetEPR);
options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
options.setCallTransportCleanup(true);
ConfigurationContext configContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(
TestingUtils.prefixBaseDirectory(Constants.TESTING_REPOSITORY), null);
ServiceClient sender = new ServiceClient(configContext, null);
sender.engageModule("addressing");
sender.setOptions(options);
OMElement result = sender.sendReceive(payload);
TestingUtils.compareWithCreatedOMElement(result);
result = sender.sendReceive(payload);
TestingUtils.compareWithCreatedOMElement(result);
result = sender.sendReceive(payload);
TestingUtils.compareWithCreatedOMElement(result);
result = sender.sendReceive(payload);
TestingUtils.compareWithCreatedOMElement(result);
}
示例10: createClient
import org.apache.axis2.client.Options; //导入方法依赖的package包/类
private ServiceClient createClient() throws Exception {
Options options = new Options();
options.setTo(targetEPR);
options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
options.setAction(operationName.getLocalPart());
options.setUseSeparateListener(true);
options.setTimeOutInMilliSeconds(50000);
ConfigurationContext configContext = UtilServer.createClientConfigurationContext();
ServiceClient sender = new ServiceClient(configContext, null);
sender.setOptions(options);
sender.engageModule("addressing");
return sender;
}
示例11: testEchoXMLSyncSeperateListener
import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public void testEchoXMLSyncSeperateListener() throws Exception {
OMElement payload = createEnvelope();
Options options = new Options();
options.setTo(targetEPR);
options.setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
ConfigurationContext configContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(
TestingUtils.prefixBaseDirectory("target/test-resources/integrationRepo"), null);
ServiceClient sender = new ServiceClient(configContext, null);
sender.engageModule(new QName("addressing"));
options.setAction(Constants.AXIS2_NAMESPACE_URI + "/" + operationName.getLocalPart());
sender.setOptions(options);
options.setUseSeparateListener(true);
options.setTo(targetEPR);
OMElement result = sender.sendReceive(payload);
OMElement ele = (OMElement)result.getFirstOMChild();
OMText binaryNode = (OMText)ele.getFirstOMChild();
// to the assert equal
compareWithCreatedOMText(binaryNode);
}
示例12: create
import org.apache.axis2.client.Options; //导入方法依赖的package包/类
/**
* パラメータを元に設定インスタンスを生成します。
*
* @param uri URL
* @param scheme スキーマ (ex:http,https,...)
* @param actionName API名
* @return org.apache.axis2.client.Options パラメータを元に生成された設定
*/
public static Options create(URI uri, String scheme, String actionName) {
Options options = new Options();
EndpointReference targetEPR = new EndpointReference(uri.toString());
options.setTo(targetEPR);
options.setTransportInProtocol(scheme);
options.setProperty(HTTPConstants.CHUNKED, Constants.VALUE_FALSE);
options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
options.setAction(actionName);
return options;
}
示例13: cloneOptions
import org.apache.axis2.client.Options; //导入方法依赖的package包/类
public static Options cloneOptions(Options options) {
// create new options object and set the parent
Options clonedOptions = new Options(options.getParent());
// copy general options
clonedOptions.setCallTransportCleanup(options.isCallTransportCleanup());
clonedOptions.setExceptionToBeThrownOnSOAPFault(options.isExceptionToBeThrownOnSOAPFault());
clonedOptions.setManageSession(options.isManageSession());
clonedOptions.setSoapVersionURI(options.getSoapVersionURI());
clonedOptions.setTimeOutInMilliSeconds(options.getTimeOutInMilliSeconds());
clonedOptions.setUseSeparateListener(options.isUseSeparateListener());
// copy transport related options
clonedOptions.setListener(options.getListener());
clonedOptions.setTransportIn(options.getTransportIn());
clonedOptions.setTransportInProtocol(options.getTransportInProtocol());
clonedOptions.setTransportOut(clonedOptions.getTransportOut());
// copy username and password options
clonedOptions.setUserName(options.getUserName());
clonedOptions.setPassword(options.getPassword());
// cloen the property set of the current options object
for (Object o : options.getProperties().keySet()) {
String key = (String) o;
clonedOptions.setProperty(key, options.getProperty(key));
}
return clonedOptions;
}
示例14: cloneOptions
import org.apache.axis2.client.Options; //导入方法依赖的package包/类
/**
* Clones the given {@link org.apache.axis2.client.Options} object. This is not a deep copy
* because this will be called for each and every message going out from synapse. The parent
* of the cloning options object is kept as a reference.
*
* @param options clonning object
* @return clonned Options object
*/
public static Options cloneOptions(Options options) {
// create new options object and set the parent
Options clonedOptions = new Options(options.getParent());
// copy general options
clonedOptions.setCallTransportCleanup(options.isCallTransportCleanup());
clonedOptions.setExceptionToBeThrownOnSOAPFault(options.isExceptionToBeThrownOnSOAPFault());
clonedOptions.setManageSession(options.isManageSession());
clonedOptions.setSoapVersionURI(options.getSoapVersionURI());
clonedOptions.setTimeOutInMilliSeconds(options.getTimeOutInMilliSeconds());
clonedOptions.setUseSeparateListener(options.isUseSeparateListener());
// copy transport related options
clonedOptions.setListener(options.getListener());
clonedOptions.setTransportIn(options.getTransportIn());
clonedOptions.setTransportInProtocol(options.getTransportInProtocol());
clonedOptions.setTransportOut(clonedOptions.getTransportOut());
// copy username and password options
clonedOptions.setUserName(options.getUserName());
clonedOptions.setPassword(options.getPassword());
// cloen the property set of the current options object
for (Object o : options.getProperties().keySet()) {
String key = (String) o;
clonedOptions.setProperty(key, options.getProperty(key));
}
return clonedOptions;
}
示例15: getOptions
import org.apache.axis2.client.Options; //导入方法依赖的package包/类
/**
* Get an Options object initialized with the right transport info, defaulting to SOAP 1.2
*
* @return pre-initialized Options object
*/
protected Options getOptions() {
TransportOutDescription td = new TransportOutDescription("local");
td.setSender(sender);
Options opts = new Options();
opts.setTransportOut(td);
opts.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
return opts;
}