本文整理汇总了Java中javax.wsdl.Operation.getFault方法的典型用法代码示例。如果您正苦于以下问题:Java Operation.getFault方法的具体用法?Java Operation.getFault怎么用?Java Operation.getFault使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.wsdl.Operation
的用法示例。
在下文中一共展示了Operation.getFault方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFaultAction
import javax.wsdl.Operation; //导入方法依赖的package包/类
/**
* Get the fault action value for a given operation.
*
* @param port The WSDL service port.
* @param operationName The SOAP Operation element QName.
* @param faultName The fault name.
* @param documentStyle true if it is 'document', false if 'rpc'.
* @return the fault action value.
*/
public static String getFaultAction(final Port port, final QName operationName, String faultName, Boolean documentStyle) {
// Overloaded methods not supported
Operation operation = getOperationByElement(port, operationName, documentStyle);
if (operation.getFault(faultName) == null) {
throw SOAPMessages.MESSAGES.faultNameNotFoundOnOperation(faultName, operationName.getLocalPart());
}
return getFaultAction(operation.getFault(faultName), port, operationName);
}
示例2: getFaultQName
import javax.wsdl.Operation; //导入方法依赖的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;
}
示例3: buildSoapDetail
import javax.wsdl.Operation; //导入方法依赖的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);
}
示例4: testGenerateFaultAction
import javax.wsdl.Operation; //导入方法依赖的package包/类
public void testGenerateFaultAction() {
String expectedAction =
"http://ws.apache.org/axis2/actiontest/withoutWSAWAction/echo/Fault/echoFault";
PortType pt = definition.getPortType(
new QName("http://ws.apache.org/axis2/actiontest/", "withoutWSAWAction"));
List operations = pt.getOperations();
Operation op = (Operation) operations.get(0);
Fault fault = op.getFault("echoFault");
String actualAction =
WSDL11ActionHelper.getActionFromFaultElement(definition, pt, op, fault);
assertEquals(expectedAction, actualAction);
}
示例5: testGetWSAWFaultAction
import javax.wsdl.Operation; //导入方法依赖的package包/类
public void testGetWSAWFaultAction() {
String expectedAction = "http://example.org/action/echoFault";
PortType pt = definition
.getPortType(new QName("http://ws.apache.org/axis2/actiontest/", "withWSAWAction"));
List operations = pt.getOperations();
Operation op = (Operation) operations.get(0);
Fault fault = op.getFault("echoFault");
String actualAction =
WSDL11ActionHelper.getActionFromFaultElement(definition, pt, op, fault);
assertEquals(expectedAction, actualAction);
}