本文整理汇总了Java中javax.wsdl.Fault类的典型用法代码示例。如果您正苦于以下问题:Java Fault类的具体用法?Java Fault怎么用?Java Fault使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Fault类属于javax.wsdl包,在下文中一共展示了Fault类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: OperationInfo
import javax.wsdl.Fault; //导入依赖的package包/类
public OperationInfo(Operation operation) {
targetMethodName = operation.getName();
Input inDef = operation.getInput();
if (inDef != null) {
Message inMsg = inDef.getMessage();
if (inMsg != null) {
input = getParameterFromMessage(inMsg);
}
}
Output outDef = operation.getOutput();
if (outDef != null) {
Message outMsg = outDef.getMessage();
if (outMsg != null) {
output = getParameterFromMessage(outMsg);
}
}
for (Fault fault : (Collection<Fault>) operation.getFaults().values()) {
Message faultMsg = fault.getMessage();
if (faultMsg != null) {
faults.add(getParameterFromMessage(faultMsg));
}
}
}
示例2: parseSoapFault
import javax.wsdl.Fault; //导入依赖的package包/类
public static Fault parseSoapFault(Element odeMsgEl, SOAPEnvelope envelope, Operation operation)
throws AxisFault {
SOAPFault flt = envelope.getBody().getFault();
SOAPFaultDetail detail = flt.getDetail();
Fault fdef = inferFault(operation, flt);
if (fdef == null) {
return null;
}
Part pdef = (Part) fdef.getMessage().getParts().values().iterator().next();
Element partel = odeMsgEl.getOwnerDocument().createElementNS(null, pdef.getName());
odeMsgEl.appendChild(partel);
if (detail.getFirstChildWithName(pdef.getElementName()) != null) {
partel.appendChild(odeMsgEl.getOwnerDocument().importNode(
OMUtils.toDOM(detail.getFirstChildWithName(pdef.getElementName())), true));
} else {
partel.appendChild(odeMsgEl.getOwnerDocument().importNode(OMUtils.toDOM(detail), true));
}
return fdef;
}
示例3: createFault
import javax.wsdl.Fault; //导入依赖的package包/类
public Fault createFault() {
if (isDebugEnabled) {
log.debug(myClassName + ".createFault()");
}
getWrappedDefinitionForUse();
Fault results = null;
if (wsdlDefinition != null) {
if (hasBeenSaved) {
hasBeenUpdatedSinceSaving = true;
}
results = wsdlDefinition.createFault();
}
doneUsingWrappedDefinition();
return results;
}
示例4: getFault
import javax.wsdl.Fault; //导入依赖的package包/类
/**
* Create a WsdlOpFault from the Fault.
*
* @param fault Fault to process.
* @return WsdlOpFault Result of processing.
*/
@SuppressWarnings("unchecked")
private WsdlOpFault getFault(Fault fault) {
Message m = fault.getMessage();
// a fault should only have one message part.
Map<?, Part> partMap = m.getParts();
if (partMap.size() != 1)
{
throw new IllegalArgumentException("Invalid part count for fault!!");
}
Part faultPart = partMap.values().iterator().next();
boolean complexType = false;
// type of fault is specified either in Part's type or element attribute.
QName type = faultPart.getTypeName();
if (type == null) {
type = faultPart.getElementName();
Element schemaElement = _wsdlTypes.findNamedElement(type);
type = _wsdlTypes.getTypeQName(schemaElement.getAttribute("type"));
complexType = true;
}
return new WsdlOpFault(fault.getName(), type, complexType, _wsdlTypes);
}
示例5: isDifferent
import javax.wsdl.Fault; //导入依赖的package包/类
private boolean isDifferent(Map<String, Fault> left, Map<String, Fault> right) {
if (left != null && right != null && left.size() != right.size()) {
return true;
} else {
MapDifference<String, Fault> mapDiff = Maps.difference(left, right);
if (!mapDiff.areEqual()) {
return true;
} else {
for (String name : mapDiff.entriesInCommon().keySet()) {
if (isDifferent(left.get(name), right.get(name))) {
return true;
}
}
}
}
return false;
}
示例6: getFault
import javax.wsdl.Fault; //导入依赖的package包/类
/**
* Create a WsdlOpFault from the Fault.
*
* @param fault Fault to process.
* @return WsdlOpFault Result of processing.
*/
@SuppressWarnings("unchecked")
private WsdlOpFault getFault(Fault fault)
throws KettleStepException {
Message m = fault.getMessage();
// a fault should only have one message part.
Map<?, Part> partMap = m.getParts();
if (partMap.size() != 1)
{
throw new IllegalArgumentException("Invalid part count for fault!!");
}
Part faultPart = partMap.values().iterator().next();
boolean complexType = false;
// type of fault is specified either in Part's type or element attribute.
QName type = faultPart.getTypeName();
if (type == null) {
type = faultPart.getElementName();
Element schemaElement = _wsdlTypes.findNamedElement(type);
type = _wsdlTypes.getTypeQName(schemaElement.getAttribute("type"));
complexType = true;
}
return new WsdlOpFault(fault.getName(), type, complexType, _wsdlTypes);
}
示例7: getFault
import javax.wsdl.Fault; //导入依赖的package包/类
/**
* Create a WsdlOpFault from the Fault.
*
* @param fault
* Fault to process.
* @return WsdlOpFault Result of processing.
*/
@SuppressWarnings( "unchecked" )
private WsdlOpFault getFault( Fault fault ) throws KettleStepException {
Message m = fault.getMessage();
// a fault should only have one message part.
Map<?, Part> partMap = m.getParts();
if ( partMap.size() != 1 ) {
throw new IllegalArgumentException( "Invalid part count for fault!!" );
}
Part faultPart = partMap.values().iterator().next();
boolean complexType = false;
// type of fault is specified either in Part's type or element attribute.
QName type = faultPart.getTypeName();
if ( type == null ) {
type = faultPart.getElementName();
Element schemaElement = _wsdlTypes.findNamedElement( type );
type = _wsdlTypes.getTypeQName( schemaElement.getAttribute( "type" ) );
complexType = true;
}
return new WsdlOpFault( fault.getName(), type, complexType, _wsdlTypes );
}
示例8: addRROperation2PT
import javax.wsdl.Fault; //导入依赖的package包/类
private Operation addRROperation2PT(Definition def, PortType pt, RequestResponseOperationDeclaration op) {
Operation wsdlOp = def.createOperation();
wsdlOp.setName(op.id());
wsdlOp.setStyle(OperationType.REQUEST_RESPONSE);
wsdlOp.setUndefined(false);
// creating input
Input in = def.createInput();
Message msg_req = addRequestMessage(localDef, op);
in.setMessage(msg_req);
wsdlOp.setInput(in);
// creating output
Output out = def.createOutput();
Message msg_resp = addResponseMessage(localDef, op);
out.setMessage(msg_resp);
wsdlOp.setOutput(out);
// creating faults
for (Entry<String, TypeDefinition> curFault : op.faults().entrySet()) {
Fault fault = localDef.createFault();
fault.setName(curFault.getKey());
Message flt_msg = addFaultMessage(localDef, op, curFault.getValue(), curFault.getKey());
fault.setMessage(flt_msg);
wsdlOp.addFault(fault);
}
pt.addOperation(wsdlOp);
return wsdlOp;
}
示例9: getFaultAction
import javax.wsdl.Fault; //导入依赖的package包/类
/**
* Get the fault action value for a given operation.
*
* @param fault The WSDL Fault.
* @param port The WSDL service port.
* @param operationName The SOAP Operation element QName.
* @return the fault action value.
*/
public static String getFaultAction(final Fault fault, final Port port, final QName operationName) {
String action = null;
String targetNamespace = operationName.getNamespaceURI();
Object value = fault.getExtensionAttribute(WSDL_ACTION_QNAME);
if (value != null) {
action = ((QName)value).getLocalPart();
}
if (action == null) {
// http://www.w3.org/TR/2006/WD-ws-addr-wsdl-20060216/#defactionwsdl11
// [target namespace][delimiter][port type name][delimiter][operation name][delimiter]Fault[delimiter][fault name]
String delimiter = targetNamespace.startsWith(SCHEME_URN) ? STR_COLON : STR_SLASH;
String namespace = targetNamespace.endsWith(delimiter) ? targetNamespace.substring(0, targetNamespace.length()-2) : targetNamespace;
action = namespace + delimiter + port.getBinding().getPortType().getQName().getLocalPart() + delimiter
+ operationName.getLocalPart() + delimiter + STR_FAULT + delimiter + fault.getName();
System.out.println("5." + action);
StringBuffer test = new StringBuffer(namespace);
test.append(delimiter);
if ((port.getBinding() != null)
&& (port.getBinding().getPortType() != null)
&& (port.getBinding().getPortType().getQName() != null)
&& (port.getBinding().getPortType().getQName().getLocalPart() != null)) {
test.append(port.getBinding().getPortType().getQName().getLocalPart());
}
test.append(delimiter);
test.append(operationName.getLocalPart());
test.append(delimiter);
test.append(STR_FAULT);
test.append(delimiter);
if (fault != null) {
test.append(fault.getName());
}
action = test.toString();
System.out.println("5a." + action);
}
return action;
}
示例10: getFaultQName
import javax.wsdl.Fault; //导入依赖的package包/类
/**
* Get the fault QName.
*
* @param operation The WSDL operation.
* @param faultName the name of the Fault
* @return the fault QName or null.
*/
public static QName getFaultQName(final Operation operation, final String faultName) {
Fault fault = operation.getFault(faultName);
QName qName = null;
if (fault != null) {
qName = fault.getMessage().getQName();
}
return qName;
}
示例11: getAllPaths
import javax.wsdl.Fault; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private Collection<String> getAllPaths() throws URISyntaxException {
final Set<String> paths = new HashSet<String>();
final Set<QName> portTypes = new HashSet<QName>();
final Set<QName> alreadyCreated = new HashSet<QName>();
for (Binding binding : (Collection<Binding>) wsdlDefinition.getAllBindings().values()) {
final QName portType = binding.getPortType().getQName();
if (portTypes.add(portType)) {
for (BindingOperation operation : (Collection<BindingOperation>) binding.getBindingOperations()) {
Operation oper = operation.getOperation();
Input inDef = oper.getInput();
if (inDef != null) {
Message inMsg = inDef.getMessage();
addParamsToPath(portType, oper, inMsg, paths, alreadyCreated);
}
Output outDef = oper.getOutput();
if (outDef != null) {
Message outMsg = outDef.getMessage();
addParamsToPath(portType, oper, outMsg, paths, alreadyCreated);
}
for (Fault fault : (Collection<Fault>) oper.getFaults().values()) {
Message faultMsg = fault.getMessage();
addParamsToPath(portType, oper, faultMsg, paths, alreadyCreated);
}
}
}
}
return paths;
}
示例12: buildSoapDetail
import javax.wsdl.Fault; //导入依赖的package包/类
private static OMElement buildSoapDetail(
final BPELMessageContext bpelMessageContext,
final MessageExchange odeMessageContext) throws AxisFault {
Element message = odeMessageContext.getResponse().getMessage();
QName faultName = odeMessageContext.getFault();
Operation operation = odeMessageContext.getOperation();
SOAPFactory soapFactory = bpelMessageContext.getSoapFactoryForCurrentMessageFlow();
if (faultName.getNamespaceURI() == null) {
return toFaultDetail(message, soapFactory);
}
Fault f = operation.getFault(faultName.getLocalPart());
if (f == null) {
return toFaultDetail(message, soapFactory);
}
// For faults, there will be exactly one part.
Part p = (Part) f.getMessage().getParts().values().iterator().next();
if (p == null) {
return toFaultDetail(message, soapFactory);
}
Element partEl = DOMUtils.findChildByName(message, new QName(null, p.getName()));
if (partEl == null) {
return toFaultDetail(message, soapFactory);
}
Element detail = DOMUtils.findChildByName(partEl, p.getElementName());
if (detail == null) {
return toFaultDetail(message, soapFactory);
}
return OMUtils.toOM(detail, soapFactory);
}
示例13: inferFault
import javax.wsdl.Fault; //导入依赖的package包/类
private static Fault inferFault(Operation operation, SOAPFault flt) {
if (flt.getDetail() == null) {
return null;
}
if (flt.getDetail().getFirstElement() == null) {
return null;
}
// The detail is a dummy <detail> node containing the interesting fault element
QName elName = flt.getDetail().getFirstElement().getQName();
return WsdlUtils.inferFault(operation, elName);
}
示例14: getActionFromFaultElement
import javax.wsdl.Fault; //导入依赖的package包/类
/**
* getActionFromFaultElement
*
* @param def the wsdl:definitions which contains the wsdl:portType
* @param wsdl4jPortType the wsdl:portType which contains the wsdl:operation
* @param op the wsdl:operation which contains the fault element
* @param fault the fault element to be examined to generate the wsa:Action
* @return either the wsaw:Action from the fault element or an action generated using the DefaultActionPattern
*/
public static String getActionFromFaultElement(Definition def, PortType wsdl4jPortType,
Operation op, Fault fault) {
String result = getWSAWActionExtensionAttribute(fault);
if (result == null || result.equals("")) {
result = WSDL11DefaultActionPatternHelper
.generateActionFromFaultElement(def, wsdl4jPortType, op, fault);
}
log.trace(result);
return result;
}
示例15: createFault
import javax.wsdl.Fault; //导入依赖的package包/类
public Fault createFault() {
if (isDebugEnabled) {
log.debug(myClassName + ".createFault()");
}
if (wsdlDefinition != null) {
return wsdlDefinition.createFault();
}
return null;
}