本文整理匯總了Java中javax.xml.soap.SOAPFault.getFaultActor方法的典型用法代碼示例。如果您正苦於以下問題:Java SOAPFault.getFaultActor方法的具體用法?Java SOAPFault.getFaultActor怎麽用?Java SOAPFault.getFaultActor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.xml.soap.SOAPFault
的用法示例。
在下文中一共展示了SOAPFault.getFaultActor方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: SOAP11Fault
import javax.xml.soap.SOAPFault; //導入方法依賴的package包/類
SOAP11Fault(SOAPFault fault) {
this.faultcode = fault.getFaultCodeAsQName();
this.faultstring = fault.getFaultString();
this.faultactor = fault.getFaultActor();
if (fault.getDetail() != null) {
detail = new DetailType();
Iterator iter = fault.getDetail().getDetailEntries();
while(iter.hasNext()){
Element fd = (Element)iter.next();
detail.getDetails().add(fd);
}
}
}
示例2: handleResultFault
import javax.xml.soap.SOAPFault; //導入方法依賴的package包/類
protected void handleResultFault(SOAPFault fault)
{
StringBuilder errorMsg = new StringBuilder();
errorMsg.append("XML/A fault: ");
String faultString = fault.getFaultString();
if (faultString != null)
{
errorMsg.append(faultString);
errorMsg.append("; ");
}
String faultActor = fault.getFaultActor();
if (faultActor != null)
{
errorMsg.append("Actor: ");
errorMsg.append(faultActor);
errorMsg.append("; ");
}
String faultCode = fault.getFaultCode();
if (faultCode != null)
{
errorMsg.append("Code: ");
errorMsg.append(faultCode);
errorMsg.append("; ");
}
throw new JRRuntimeException(errorMsg.toString());
}
示例3: handleResultFault
import javax.xml.soap.SOAPFault; //導入方法依賴的package包/類
protected void handleResultFault(SOAPFault fault)
{
StringBuffer errorMsg = new StringBuffer();
errorMsg.append("XML/A fault: ");
String faultString = fault.getFaultString();
if (faultString != null)
{
errorMsg.append(faultString);
errorMsg.append("; ");
}
String faultActor = fault.getFaultActor();
if (faultActor != null)
{
errorMsg.append("Actor: ");
errorMsg.append(faultActor);
errorMsg.append("; ");
}
String faultCode = fault.getFaultCode();
if (faultCode != null)
{
errorMsg.append("Code: ");
errorMsg.append(faultCode);
errorMsg.append("; ");
}
throw new JRRuntimeException(errorMsg.toString());
}
示例4: testCustomRoleNodeFault12
import javax.xml.soap.SOAPFault; //導入方法依賴的package包/類
/**
* Tests that Role and Node
* are set properly on SOAP 1.2 Fault.
* @throws Exception
*/
public void testCustomRoleNodeFault12() throws Exception {
MessageFactory mf = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
SOAPMessage sm = mf.createMessage();
SOAPBody body = sm.getSOAPBody();
SOAPFault fault = body.addFault();
fault.setFaultRole("TestRole");
fault.setFaultNode("http://XMLFaultTest/testCustomRoleNodeFault/");
XMLFault xmlFault = XMLFaultUtils.createXMLFault(fault);
SOAPFault retFault = XMLFaultUtils.createSAAJFault(xmlFault, body);
assertTrue(retFault != null);
String role = retFault.getFaultRole();
assertTrue(role != null);
assertTrue(role.equals("TestRole"));
// Actor and role should be the same
String actor = retFault.getFaultActor();
assertTrue(actor != null);
assertTrue(actor.equals("TestRole"));
String node = retFault.getFaultNode();
assertTrue(node != null);
assertTrue(node.equals("http://XMLFaultTest/testCustomRoleNodeFault/"));
}
示例5: testGetFaultActor
import javax.xml.soap.SOAPFault; //導入方法依賴的package包/類
@Validated @Test
public void testGetFaultActor() throws Exception {
SOAPMessage msg = MessageFactory.newInstance().createMessage();
SOAPFault sf = msg.getSOAPBody().addFault();
sf.setFaultActor("/faultActorURI");
sf.setFaultActor("/faultActorURI2");
String result = sf.getFaultActor();
if (!result.equals("/faultActorURI2")) {
fail("Fault Actor not properly set");
}
}