本文整理汇总了Java中com.sun.xml.internal.ws.addressing.model.InvalidAddressingHeaderException类的典型用法代码示例。如果您正苦于以下问题:Java InvalidAddressingHeaderException类的具体用法?Java InvalidAddressingHeaderException怎么用?Java InvalidAddressingHeaderException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InvalidAddressingHeaderException类属于com.sun.xml.internal.ws.addressing.model包,在下文中一共展示了InvalidAddressingHeaderException类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: checkNonAnonymousAddresses
import com.sun.xml.internal.ws.addressing.model.InvalidAddressingHeaderException; //导入依赖的package包/类
@SuppressWarnings("ResultOfObjectAllocationIgnored")
private void checkNonAnonymousAddresses(WSEndpointReference replyTo, WSEndpointReference faultTo) {
if (!replyTo.isAnonymous()) {
try {
new EndpointAddress(URI.create(replyTo.getAddress()));
} catch (Exception e) {
throw new InvalidAddressingHeaderException(addressingVersion.replyToTag, addressingVersion.invalidAddressTag);
}
}
//for now only validate ReplyTo
/*
if (!faultTo.isAnonymous()) {
try {
new EndpointAddress(URI.create(faultTo.getAddress()));
} catch (IllegalArgumentException e) {
throw new InvalidAddressingHeaderException(addressingVersion.faultToTag, addressingVersion.invalidAddressTag);
}
}
*/
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:WsaServerTube.java
示例2: checkNonAnonymousAddresses
import com.sun.xml.internal.ws.addressing.model.InvalidAddressingHeaderException; //导入依赖的package包/类
private void checkNonAnonymousAddresses(WSEndpointReference replyTo, WSEndpointReference faultTo) {
if (!replyTo.isAnonymous()) {
try {
new EndpointAddress(URI.create(replyTo.getAddress()));
} catch (Exception e) {
throw new InvalidAddressingHeaderException(addressingVersion.replyToTag, addressingVersion.invalidAddressTag);
}
}
//for now only validate ReplyTo
/*
if (!faultTo.isAnonymous()) {
try {
new EndpointAddress(URI.create(faultTo.getAddress()));
} catch (IllegalArgumentException e) {
throw new InvalidAddressingHeaderException(addressingVersion.faultToTag, addressingVersion.invalidAddressTag);
}
}
*/
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:21,代码来源:WsaServerTube.java
示例3: checkAnonymousSemantics
import com.sun.xml.internal.ws.addressing.model.InvalidAddressingHeaderException; //导入依赖的package包/类
@Override
protected void checkAnonymousSemantics(WSDLBoundOperation wbo, WSEndpointReference replyTo, WSEndpointReference faultTo) {
String replyToValue = null;
String faultToValue = null;
if (replyTo != null)
replyToValue = replyTo.getAddress();
if (faultTo != null)
faultToValue = faultTo.getAddress();
WSDLBoundOperation.ANONYMOUS responseRequirement = getResponseRequirement(wbo);
switch (responseRequirement) {
case prohibited:
if (replyToValue != null && replyToValue.equals(addressingVersion.anonymousUri))
throw new InvalidAddressingHeaderException(addressingVersion.replyToTag, ONLY_NON_ANONYMOUS_ADDRESS_SUPPORTED);
if (faultToValue != null && faultToValue.equals(addressingVersion.anonymousUri))
throw new InvalidAddressingHeaderException(addressingVersion.faultToTag, ONLY_NON_ANONYMOUS_ADDRESS_SUPPORTED);
break;
case required:
if (replyToValue != null && !replyToValue.equals(addressingVersion.anonymousUri))
throw new InvalidAddressingHeaderException(addressingVersion.replyToTag, ONLY_ANONYMOUS_ADDRESS_SUPPORTED);
if (faultToValue != null && !faultToValue.equals(addressingVersion.anonymousUri))
throw new InvalidAddressingHeaderException(addressingVersion.faultToTag, ONLY_ANONYMOUS_ADDRESS_SUPPORTED);
break;
default:
// ALL: no check
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:32,代码来源:W3CWsaServerTube.java
示例4: validateSOAPAction
import com.sun.xml.internal.ws.addressing.model.InvalidAddressingHeaderException; //导入依赖的package包/类
protected void validateSOAPAction(Packet packet) {
String gotA = AddressingUtils.getAction(
packet.getMessage().getHeaders(),
addressingVersion, soapVersion);
if (gotA == null)
throw new WebServiceException(AddressingMessages.VALIDATION_SERVER_NULL_ACTION());
if(packet.soapAction != null && !packet.soapAction.equals("\"\"") && !packet.soapAction.equals("\""+gotA+"\"")) {
throw new InvalidAddressingHeaderException(addressingVersion.actionTag, addressingVersion.actionMismatchTag);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:WsaTube.java
示例5: createInvalidAddressingHeaderFault
import com.sun.xml.internal.ws.addressing.model.InvalidAddressingHeaderException; //导入依赖的package包/类
public SOAPFault createInvalidAddressingHeaderFault(InvalidAddressingHeaderException e, AddressingVersion av) {
QName name = e.getProblemHeader();
QName subsubcode = e.getSubsubcode();
QName subcode = av.invalidMapTag;
String faultstring = String.format(av.getInvalidMapText(), name, subsubcode);
try {
SOAPFactory factory;
SOAPFault fault;
if (soapVer == SOAPVersion.SOAP_12) {
factory = SOAPVersion.SOAP_12.getSOAPFactory();
fault = factory.createFault();
fault.setFaultCode(SOAPConstants.SOAP_SENDER_FAULT);
fault.appendFaultSubcode(subcode);
fault.appendFaultSubcode(subsubcode);
getInvalidMapDetail(name, fault.addDetail());
} else {
factory = SOAPVersion.SOAP_11.getSOAPFactory();
fault = factory.createFault();
fault.setFaultCode(subsubcode);
}
fault.setFaultString(faultstring);
return fault;
} catch (SOAPException se) {
throw new WebServiceException(se);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:WsaTubeHelper.java
示例6: validateSOAPAction
import com.sun.xml.internal.ws.addressing.model.InvalidAddressingHeaderException; //导入依赖的package包/类
protected void validateSOAPAction(Packet packet) {
String gotA = packet.getMessage().getHeaders().getAction(addressingVersion, soapVersion);
if (gotA == null)
throw new WebServiceException(AddressingMessages.VALIDATION_SERVER_NULL_ACTION());
if(packet.soapAction != null && !packet.soapAction.equals("\"\"") && !packet.soapAction.equals("\""+gotA+"\"")) {
throw new InvalidAddressingHeaderException(addressingVersion.actionTag, addressingVersion.actionMismatchTag);
}
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:9,代码来源:WsaTube.java
示例7: createInvalidAddressingHeaderFault
import com.sun.xml.internal.ws.addressing.model.InvalidAddressingHeaderException; //导入依赖的package包/类
public SOAPFault createInvalidAddressingHeaderFault(InvalidAddressingHeaderException e, AddressingVersion av) {
QName name = e.getProblemHeader();
QName subsubcode = e.getSubsubcode();
QName subcode = av.invalidMapTag;
String faultstring = String.format(av.getInvalidMapText(), name, subsubcode);
try {
SOAPFactory factory;
SOAPFault fault;
if (soapVer == SOAPVersion.SOAP_12) {
factory = SOAPVersion.SOAP_12.saajSoapFactory;
fault = factory.createFault();
fault.setFaultCode(SOAPConstants.SOAP_SENDER_FAULT);
fault.appendFaultSubcode(subcode);
fault.appendFaultSubcode(subsubcode);
getInvalidMapDetail(name, fault.addDetail());
} else {
factory = SOAPVersion.SOAP_11.saajSoapFactory;
fault = factory.createFault();
fault.setFaultCode(subsubcode);
}
fault.setFaultString(faultstring);
return fault;
} catch (SOAPException se) {
throw new WebServiceException(se);
}
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:30,代码来源:WsaTubeHelper.java
示例8: populateAddressingHeaders
import com.sun.xml.internal.ws.addressing.model.InvalidAddressingHeaderException; //导入依赖的package包/类
private void populateAddressingHeaders(Packet responsePacket, AddressingVersion av, SOAPVersion sv, String action, boolean mustUnderstand) {
// populate WS-A headers only if WS-A is enabled
if (av == null) return;
// if one-way, then dont populate any WS-A headers
if (responsePacket.getMessage() == null)
return;
HeaderList hl = responsePacket.getMessage().getHeaders();
// wsa:To
WSEndpointReference replyTo;
try {
replyTo = message.getHeaders().getReplyTo(av, sv);
if (replyTo != null)
hl.add(new StringHeader(av.toTag, replyTo.getAddress()));
} catch (InvalidAddressingHeaderException e) {
replyTo = null;
}
// wsa:Action, add if the message doesn't already contain it,
// generally true for SEI case where there is SEIModel or WSDLModel
// false for Provider with no wsdl, Expects User to set the coresponding header on the Message.
if(responsePacket.getMessage().getHeaders().getAction(av,sv) == null) {
//wsa:Action header is not set in the message, so use the wsa:Action passed as the parameter.
hl.add(new StringHeader(av.actionTag, action, sv, mustUnderstand));
}
// wsa:MessageID
hl.add(new StringHeader(av.messageIDTag, responsePacket.getMessage().getID(av, sv)));
// wsa:RelatesTo
String mid = getMessage().getHeaders().getMessageID(av,sv);
if (mid != null)
hl.add(new RelatesToHeader(av.relatesToTag, mid));
// populate reference parameters
WSEndpointReference refpEPR;
if (responsePacket.getMessage().isFault()) {
// choose FaultTo
refpEPR = message.getHeaders().getFaultTo(av, sv);
// if FaultTo is null, then use ReplyTo
if (refpEPR == null)
refpEPR = replyTo;
} else {
// choose ReplyTo
refpEPR = replyTo;
}
if (refpEPR != null) {
refpEPR.addReferenceParameters(hl);
}
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:54,代码来源:Packet.java
注:本文中的com.sun.xml.internal.ws.addressing.model.InvalidAddressingHeaderException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论