本文整理汇总了Java中org.apache.axis2.addressing.AddressingConstants类的典型用法代码示例。如果您正苦于以下问题:Java AddressingConstants类的具体用法?Java AddressingConstants怎么用?Java AddressingConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AddressingConstants类属于org.apache.axis2.addressing包,在下文中一共展示了AddressingConstants类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleAddressing
import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
private void handleAddressing(UnifiedEndpoint uep, MessageContext msgContext) {
String addressingVersion = uep.getAddressingVersion();
if (uep.isAddressingEnabled()) {
if (addressingVersion != null
&& UnifiedEndpointConstants.ADDRESSING_VERSION_SUBMISSION.equals(addressingVersion)) {
msgContext.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,
AddressingConstants.Submission.WSA_NAMESPACE);
} else if (addressingVersion != null
&& UnifiedEndpointConstants.ADDRESSING_VERSION_FINAL.equals(addressingVersion)) {
msgContext.setProperty(AddressingConstants.WS_ADDRESSING_VERSION,
AddressingConstants.Final.WSA_NAMESPACE);
}
msgContext.setProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.FALSE);
//Adding ReplyTo address
if (uep.getReplyToAddress() != null) {
msgContext.getOptions().setReplyTo(new EndpointReference(uep.getReplyToAddress().toString()));
}
} else {
msgContext.setProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.TRUE);
}
}
示例2: testWithoutUsingAddressing
import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
public void testWithoutUsingAddressing() {
File testResourceFile = new File(wsdlLocation);
try {
WSDL11ToAllAxisServicesBuilder builder = new WSDL11ToAllAxisServicesBuilder(
new FileInputStream(testResourceFile));
AxisService axisService = builder.populateService();
String addressingRequired = AddressingHelper
.getAddressingRequirementParemeterValue(axisService);
assertEquals("Unexpected addressingRequirementParameter value: "
+ addressingRequired,
AddressingConstants.ADDRESSING_UNSPECIFIED,
addressingRequired);
} catch (Exception e) {
System.out.println("Error in WSDL : " + testResourceFile.getName());
System.out.println("Exception: " + e.toString());
fail("Caught exception " + e.toString());
}
}
示例3: testUsingAddressing
import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
public void testUsingAddressing() {
wsdlLocation = System.getProperty("basedir", ".") + "/"
+ "test-resources/wsdl/UsingAddressing.wsdl";
File testResourceFile = new File(wsdlLocation);
try {
WSDL11ToAllAxisServicesBuilder builder = new WSDL11ToAllAxisServicesBuilder(
new FileInputStream(testResourceFile));
AxisService axisService = builder.populateService();
String addressingRequired = AddressingHelper
.getAddressingRequirementParemeterValue(axisService);
assertEquals("Unexpected addressingRequirementParameter value: "
+ addressingRequired,
AddressingConstants.ADDRESSING_OPTIONAL, addressingRequired);
} catch (Exception e) {
System.out.println("Error in WSDL : " + testResourceFile.getName());
System.out.println("Exception: " + e.toString());
fail("Caught exception " + e.toString());
}
}
示例4: testUsingAddressingOptional
import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
public void testUsingAddressingOptional() {
wsdlLocation = System.getProperty("basedir", ".") + "/"
+ "test-resources/wsdl/UsingAddressingOptional.wsdl";
File testResourceFile = new File(wsdlLocation);
try {
WSDL11ToAllAxisServicesBuilder builder = new WSDL11ToAllAxisServicesBuilder(
new FileInputStream(testResourceFile));
AxisService axisService = builder.populateService();
String addressingRequired = AddressingHelper
.getAddressingRequirementParemeterValue(axisService);
assertEquals("Unexpected addressingRequirementParameter value: "
+ addressingRequired,
AddressingConstants.ADDRESSING_OPTIONAL, addressingRequired);
} catch (Exception e) {
System.out.println("Error in WSDL : " + testResourceFile.getName());
System.out.println("Exception: " + e.toString());
fail("Caught exception " + e.toString());
}
}
示例5: testUsingAddressingRequired
import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
public void testUsingAddressingRequired() {
wsdlLocation = System.getProperty("basedir", ".") + "/"
+ "test-resources/wsdl/UsingAddressingRequired.wsdl";
File testResourceFile = new File(wsdlLocation);
try {
WSDL11ToAllAxisServicesBuilder builder = new WSDL11ToAllAxisServicesBuilder(
new FileInputStream(testResourceFile));
AxisService axisService = builder.populateService();
String addressingRequired = AddressingHelper
.getAddressingRequirementParemeterValue(axisService);
assertEquals("Unexpected addressingRequirementParameter value: "
+ addressingRequired,
AddressingConstants.ADDRESSING_REQUIRED, addressingRequired);
} catch (Exception e) {
System.out.println("Error in WSDL : " + testResourceFile.getName());
System.out.println("Exception: " + e.toString());
fail("Caught exception " + e.toString());
}
}
示例6: processMessageID
import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
private void processMessageID() {
String messageID = messageContextOptions.getMessageId();
//Check whether we want to force a message id to be sent.
if (messageID == null && includeOptionalHeaders) {
messageID = UIDGenerator.generateURNString();
messageContextOptions.setMessageId(messageID);
}
if (messageID != null && !isAddressingHeaderAlreadyAvailable(WSA_MESSAGE_ID, false))
{//optional
ArrayList attributes = (ArrayList)messageContext.getLocalProperty(
AddressingConstants.MESSAGEID_ATTRIBUTES);
createSOAPHeaderBlock(messageID, WSA_MESSAGE_ID, attributes);
}
}
示例7: assertMessageIDHasExtensibilityAttribute
import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
private void assertMessageIDHasExtensibilityAttribute(MessageContext mc) {
boolean attributeFound = false;
ArrayList attributes = (ArrayList)mc.getProperty(AddressingConstants.MESSAGEID_ATTRIBUTES);
if (attributes != null) {
Iterator iter = attributes.iterator();
while (iter.hasNext()) {
OMAttribute oa = (OMAttribute)iter.next();
if (oa.getLocalName().equals("AttrExt")) {
attributeFound = true;
assertEquals("Attribute value incorrectly deserialised", oa.getAttributeValue(),
"123456789");
}
}
}
assertTrue("Extensibility attribute not found on MessageID", attributeFound);
}
示例8: testMessageWithOmittedReplyTo
import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
public void testMessageWithOmittedReplyTo() {
try {
Options options = testMessageWithOmittedHeaders("noReplyTo");
EndpointReference epr = options.getReplyTo();
String address = epr.getAddress();
assertEquals("The address of the ReplyTo endpoint reference is not the none URI.",
AddressingConstants.Final.WSA_NONE_URI, address);
}
catch (AxisFault af) {
af.printStackTrace();
log.error(af.getMessage());
fail("An unexpected AxisFault was thrown due to a missing ReplyTo header.");
}
catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage());
fail(" An Exception has occured " + e.getMessage());
}
}
示例9: testMessageWithOmittedReplyTo
import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
public void testMessageWithOmittedReplyTo() {
try {
Options options = testMessageWithOmittedHeaders("noReplyTo");
EndpointReference epr = options.getReplyTo();
String address = epr.getAddress();
assertEquals("The address of the ReplyTo endpoint reference is not the anonymous URI.",
AddressingConstants.Final.WSA_ANONYMOUS_URL, address);
}
catch (AxisFault af) {
af.printStackTrace();
log.error(af.getMessage());
fail("An unexpected AxisFault was thrown due to a missing ReplyTo header.");
}
catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage());
fail(" An Exception has occured " + e.getMessage());
}
}
示例10: testMessageWithOmittedTo
import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
public void testMessageWithOmittedTo() {
try {
Options options = testMessageWithOmittedHeaders("noTo");
EndpointReference epr = options.getTo();
String address = epr.getAddress();
assertEquals("The address of the To endpoint reference is not the anonymous URI.",
AddressingConstants.Final.WSA_ANONYMOUS_URL, address);
}
catch (AxisFault af) {
af.printStackTrace();
log.error(af.getMessage());
fail("An unexpected AxisFault was thrown due to a missing To header.");
}
catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage());
fail(" An Exception has occured " + e.getMessage());
}
}
示例11: testWithoutUsingAddressing
import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
public void testWithoutUsingAddressing() {
String wsdlLocation = getClass().getResource("/wsdl/Test.wsdl").toExternalForm();
try {
Service svc = Service.create(new URL(wsdlLocation), serviceQName);
Sample s = svc.getPort(portQName, Sample.class);
org.apache.axis2.jaxws.spi.BindingProvider bp = (org.apache.axis2.jaxws.spi.BindingProvider) s;
Boolean addressingDisabled = (Boolean) bp.getRequestContext().get(
AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
assertTrue("Unexpected disableAddressingForOutMessages value: "
+ addressingDisabled, addressingDisabled);
} catch (MalformedURLException e) {
System.out.println("Error in WSDL : " + wsdlLocation);
System.out.println("Exception: " + e.toString());
fail("Caught exception " + e.toString());
}
}
示例12: testUsingAddressing
import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
public void testUsingAddressing() {
String wsdlLocation = getClass().getResource("/wsdl/UsingAddressing.wsdl").toExternalForm();
try {
Service svc = Service.create(new URL(wsdlLocation), serviceQName);
Sample s = svc.getPort(portQName, Sample.class);
org.apache.axis2.jaxws.spi.BindingProvider bp = (org.apache.axis2.jaxws.spi.BindingProvider) s;
Boolean addressingDisabled = (Boolean) bp.getRequestContext().get(
AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
// Do NOT change this to assertFalse since this allows us to
// differentiate from addressing being enabled by JAX-WS 2.1
// features and annotations which override the WSDL.
assertNull("Unexpected disableAddressingForOutMessages value: "
+ addressingDisabled, addressingDisabled);
} catch (MalformedURLException e) {
System.out.println("Error in WSDL : " + wsdlLocation);
System.out.println("Exception: " + e.toString());
fail("Caught exception " + e.toString());
}
}
示例13: testUsingAddressingOptional
import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
public void testUsingAddressingOptional() {
String wsdlLocation = getClass().getResource("/wsdl/UsingAddressingOptional.wsdl").toExternalForm();
try {
Service svc = Service.create(new URL(wsdlLocation), serviceQName);
Sample s = svc.getPort(portQName, Sample.class);
org.apache.axis2.jaxws.spi.BindingProvider bp = (org.apache.axis2.jaxws.spi.BindingProvider) s;
Boolean addressingDisabled = (Boolean) bp.getRequestContext().get(
AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
// Do NOT change this to assertFalse since this allows us to
// differentiate from addressing being enabled by JAX-WS 2.1
// features and annotations which override the WSDL.
assertNull("Unexpected disableAddressingForOutMessages value: "
+ addressingDisabled, addressingDisabled);
} catch (MalformedURLException e) {
System.out.println("Error in WSDL : " + wsdlLocation);
System.out.println("Exception: " + e.toString());
fail("Caught exception " + e.toString());
}
}
示例14: testUsingAddressingRequired
import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
public void testUsingAddressingRequired() {
String wsdlLocation = getClass().getResource("/wsdl/UsingAddressingRequired.wsdl").toExternalForm();
try {
Service svc = Service.create(new URL(wsdlLocation), serviceQName);
Sample s = svc.getPort(portQName, Sample.class);
org.apache.axis2.jaxws.spi.BindingProvider bp = (org.apache.axis2.jaxws.spi.BindingProvider) s;
Boolean addressingDisabled = (Boolean) bp.getRequestContext().get(
AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
// Do NOT change this to assertFalse since this allows us to
// differentiate from addressing being enabled by JAX-WS 2.1
// features and annotations which override the WSDL.
assertNull("Unexpected disableAddressingForOutMessages value: "
+ addressingDisabled, addressingDisabled);
} catch (MalformedURLException e) {
System.out.println("Error in WSDL : " + wsdlLocation);
System.out.println("Exception: " + e.toString());
fail("Caught exception " + e.toString());
}
}
示例15: testAddressingNoMetadata
import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
/**
* Validate when no addressing-related metadata is set.
*/
public void testAddressingNoMetadata() {
Service svc = Service.create(new QName("http://test", "ProxyAddressingService"));
ProxyAddressingService proxy = svc.getPort(ProxyAddressingService.class);
assertNotNull(proxy);
proxy.doSomething("12345");
TestClientInvocationController testController = getInvocationController();
InvocationContext ic = testController.getInvocationContext();
MessageContext request = ic.getRequestMessageContext();
String version = (String) request.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
Boolean disabled = (Boolean) request.getProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES);
String responses = (String) request.getProperty(AddressingConstants.WSAM_INVOCATION_PATTERN_PARAMETER_NAME);
String required = (String) request.getProperty(AddressingConstants.ADDRESSING_REQUIREMENT_PARAMETER);
assertNull(version);
assertTrue(disabled);
assertNull(responses);
assertNull(required);
}