本文整理汇总了Java中org.apache.axis2.addressing.AddressingConstants类的典型用法代码示例。如果您正苦于以下问题:Java AddressingConstants类的具体用法?Java AddressingConstants怎么用?Java AddressingConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AddressingConstants类属于org.apache.axis2.addressing包,在下文中一共展示了AddressingConstants类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
}
开发者ID:wso2,项目名称:carbon-business-process,代码行数:24,代码来源:UnifiedEndpointHandler.java
示例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());
}
}
开发者ID:wso2,项目名称:wso2-axis2,代码行数:19,代码来源:WSDL11ToAxisServiceBuilderTest.java
示例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());
}
}
开发者ID:wso2,项目名称:wso2-axis2,代码行数:20,代码来源:WSDL11ToAxisServiceBuilderTest.java
示例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());
}
}
开发者ID:wso2,项目名称:wso2-axis2,代码行数:20,代码来源:WSDL11ToAxisServiceBuilderTest.java
示例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());
}
}
开发者ID:wso2,项目名称:wso2-axis2,代码行数:20,代码来源:WSDL11ToAxisServiceBuilderTest.java
示例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);
}
}
开发者ID:wso2,项目名称:wso2-axis2,代码行数:17,代码来源:AddressingOutHandler.java
示例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);
}
开发者ID:wso2,项目名称:wso2-axis2,代码行数:17,代码来源:AddressingInHandlerTestBase.java
示例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());
}
}
开发者ID:wso2,项目名称:wso2-axis2,代码行数:21,代码来源:AddressingSubmissionInHandlerTest.java
示例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());
}
}
开发者ID:wso2,项目名称:wso2-axis2,代码行数:21,代码来源:AddressingFinalInHandlerTest.java
示例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());
}
}
开发者ID:wso2,项目名称:wso2-axis2,代码行数:21,代码来源:AddressingFinalInHandlerTest.java
示例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());
}
}
开发者ID:wso2,项目名称:wso2-axis2,代码行数:19,代码来源:UsingAddressingTests.java
示例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());
}
}
开发者ID:wso2,项目名称:wso2-axis2,代码行数:22,代码来源:UsingAddressingTests.java
示例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());
}
}
开发者ID:wso2,项目名称:wso2-axis2,代码行数:22,代码来源:UsingAddressingTests.java
示例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());
}
}
开发者ID:wso2,项目名称:wso2-axis2,代码行数:22,代码来源:UsingAddressingTests.java
示例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);
}
开发者ID:wso2,项目名称:wso2-axis2,代码行数:25,代码来源:ProxyAddressingMetadataTest.java
示例16: testNoSubmissionAddressingFeature
import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
public void testNoSubmissionAddressingFeature() {
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 required = (String) request.getProperty(AddressingConstants.ADDRESSING_REQUIREMENT_PARAMETER);
assertNull(version);
assertTrue(disabled);
assertNull(required);
org.apache.axis2.context.MessageContext axis2Request =
request.getAxisMessageContext();
org.apache.axis2.addressing.EndpointReference epr =
axis2Request.getTo();
assertNull(epr);
}
开发者ID:wso2,项目名称:wso2-axis2,代码行数:27,代码来源:ProxySubmissionAddressingFeatureTest.java
示例17: testNoSubmissionAddressingFeature
import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
public void testNoSubmissionAddressingFeature() {
Service svc = Service.create(new QName("http://test", "TestService"));
svc.addPort(new QName("http://test", "TestPort"), SOAPBinding.SOAP11HTTP_BINDING, "http://localhost");
Dispatch<Source> d = svc.createDispatch(subEPR, Source.class, Service.Mode.PAYLOAD);
d.invoke(null);
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 required = (String) request.getProperty(AddressingConstants.ADDRESSING_REQUIREMENT_PARAMETER);
assertNull(version);
assertTrue(disabled);
assertNull(required);
org.apache.axis2.context.MessageContext axis2Request =
request.getAxisMessageContext();
org.apache.axis2.addressing.EndpointReference epr =
axis2Request.getTo();
assertNull(epr);
}
开发者ID:wso2,项目名称:wso2-axis2,代码行数:27,代码来源:DispatchSubmissionAddressingFeatureTest.java
示例18: getRelatesTo
import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
/**
* Return a single instance of WS-Addressing RelatesTo that has a relationship
* type of either "http://www.w3.org/2005/08/addressing/reply" or "wsa:Reply".
* If no such instance of RelatesTo can be found then return <code>null</code>.
*
* @return an instance of {@link RelatesTo}
*/
public RelatesTo getRelatesTo() {
if (relationships == null && parent != null) {
return parent.getRelatesTo();
}
if (relationships == null) {
return null;
}
for (int i = 0, size = relationships.size(); i < size; i++) {
RelatesTo relatesTo = (RelatesTo) relationships.get(i);
String relationshipType = relatesTo.getRelationshipType();
if (relationshipType.equals(AddressingConstants.Final.WSA_DEFAULT_RELATIONSHIP_TYPE)
|| relationshipType
.equals(AddressingConstants.Submission.WSA_DEFAULT_RELATIONSHIP_TYPE)) {
return relatesTo;
}
}
return null;
}
开发者ID:wso2,项目名称:wso2-axis2,代码行数:26,代码来源:Options.java
示例19: processEmbeddedEPR
import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
private void processEmbeddedEPR(List extensibilityElements, AxisEndpoint axisEndpoint) {
Iterator eelts = extensibilityElements.iterator();
while(eelts.hasNext()){
ExtensibilityElement ee = (ExtensibilityElement)eelts.next();
if(AddressingConstants.Final.WSA_ENDPOINT_REFERENCE.equals(ee.getElementType())){
try {
Element elt = ((UnknownExtensibilityElement)ee).getElement();
OMElement eprOMElement = XMLUtils.toOM(elt);
EndpointReference epr = EndpointReferenceHelper.fromOM(eprOMElement);
Map referenceParameters = epr.getAllReferenceParameters();
if(referenceParameters != null){
axisEndpoint.addParameter(AddressingConstants.REFERENCE_PARAMETER_PARAMETER, new ArrayList(referenceParameters.values()));
}
} catch (Exception e) {
if(log.isDebugEnabled()){
log.debug("Exception encountered processing embedded wsa:EndpointReference", e);
}
}
}
}
}
开发者ID:wso2,项目名称:wso2-axis2,代码行数:22,代码来源:WSDL11ToAxisServiceBuilder.java
示例20: generateIdentityElement
import org.apache.axis2.addressing.AddressingConstants; //导入依赖的package包/类
/**
* Generate the Identity element according to the WS-AddressingAndIdentity if the
* AddressingConstants.IDENTITY_PARAMETER parameter is set.
* http://schemas.xmlsoap.org/ws/2006/02/addressingidentity/
*/
private void generateIdentityElement(OMFactory fac,OMElement epr, Parameter wsaIdParam) {
// Create the Identity element
OMElement identity = fac.createOMElement(AddressingConstants.QNAME_IDENTITY);
OMElement keyInfo = fac.createOMElement(AddressingConstants.QNAME_IDENTITY_KEY_INFO);
OMElement x509Data = fac.createOMElement(AddressingConstants.QNAME_IDENTITY_X509_DATA);
OMElement x509cert = fac.createOMElement(AddressingConstants.QNAME_IDENTITY_X509_CERT);
x509cert.setText((String)wsaIdParam.getValue());
x509Data.addChild(x509cert);
keyInfo.addChild(x509Data);
identity.addChild(keyInfo);
epr.addChild(identity);
}
开发者ID:wso2,项目名称:wso2-axis2,代码行数:23,代码来源:AxisService2WSDL11.java
注:本文中的org.apache.axis2.addressing.AddressingConstants类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论