use of jakarta.xml.ws.soap.SOAPFaultException in project metro-jax-ws by eclipse-ee4j.
the class DispatchHello method kktestHelloRequestResponseHelloMsgBadFooXML.
// needs to be looked at
public void kktestHelloRequestResponseHelloMsgBadFooXML() {
// test for bug6323952
Dispatch dispatch = getDispatchSource();
Source source = makeStreamSource(helloMsgBadFoo);
Source response = makeStreamSource(helloResponse);
try {
Source result = (Source) dispatch.invoke(source);
// assertTrue(result == null);
// printout result
// in actuality a soapFaultMessage need to be returned.
String xmlResult = sourceToXMLString(result);
System.out.println("Got result : " + xmlResult);
} catch (Exception e) {
try {
assertTrue(e instanceof SOAPFaultException);
SOAPFaultException sfe = (SOAPFaultException) e;
if (sfe.getMessage() != null)
System.out.println("sfe message " + sfe.getMessage());
System.out.println("e class " + e.getClass().getName());
if (e.getCause() != null)
System.out.println("Cause is " + e.getCause().getClass().getName());
// assertTrue(e instanceof SOAPFaultException);
System.out.println("testHelloRequestBadFooResponseXML Passed");
} catch (Exception ex) {
System.err.println("Expected SOAPFAULTException - got " + ex.getClass().getName());
System.out.println("testHelloRequestBadFooResponseXML FAILED");
fail("testHelloRequestBadFooResponseXML FAILED");
}
}
}
use of jakarta.xml.ws.soap.SOAPFaultException in project metro-jax-ws by eclipse-ee4j.
the class DispatchHello method testSQETestXML.
public void testSQETestXML() throws WebServiceException, Exception {
// System.err.println("----------------Expected Message ----------------------");
Dispatch dispatch = getDispatchSource();
Source source = null;
Source response = null;
try {
source = makeStreamSource(sqeTest);
} catch (Exception e) {
System.out.println("Error making msg source exiting");
}
try {
Object result = dispatch.invoke(source);
String xmlResult = sourceToXMLString((Source) result);
System.out.println("Got result : " + xmlResult);
assertTrue(result == null);
System.out.println("sqeXML Passed");
} catch (Exception ex) {
assertTrue(ex instanceof SOAPFaultException);
}
// System.err.println("----------------END Expected Message ----------------------");
}
use of jakarta.xml.ws.soap.SOAPFaultException in project metro-jax-ws by eclipse-ee4j.
the class AddNumbersClient method testEPRGetPortVI.
// UsingAddressing wsdl:required=true
// AddressingFeature Disabled expect Exception
// Expect no valid port created,
public void testEPRGetPortVI() throws Exception {
if (ClientServerTestUtil.useLocal()) {
System.out.println("HTTP Transport Only Exiting");
return;
}
AddNumbersPortType proxy = createStub();
EndpointReference epr = ((BindingProvider) proxy).getEndpointReference(MemberSubmissionEndpointReference.class);
RespectBindingFeature feature = new RespectBindingFeature(true);
MemberSubmissionAddressingFeature addr = new MemberSubmissionAddressingFeature(false, false);
WebServiceFeature[] features = new WebServiceFeature[] { feature, addr };
AddNumbersPortType port = epr.getPort(AddNumbersPortType.class, features);
assertTrue(port != null);
// expectation is that port is not configured for addressing and the invocation will fail
try {
System.out.println("Adding numbers 2 and 4");
int result = port.addNumbers(2, 4);
} catch (Exception ex) {
assertTrue(ex instanceof SOAPFaultException);
System.out.println(((SOAPFaultException) ex).getFault().getFaultString());
}
}
use of jakarta.xml.ws.soap.SOAPFaultException in project metro-jax-ws by eclipse-ee4j.
the class AddNumbersClient method testEPRGetPortVI.
public void testEPRGetPortVI() throws Exception {
if (ClientServerTestUtil.useLocal()) {
System.out.println("HTTP Transport Only Exiting");
return;
}
AddNumbersPortType proxy = createStub();
EndpointReference epr = ((BindingProvider) proxy).getEndpointReference(MemberSubmissionEndpointReference.class);
RespectBindingFeature feature = new RespectBindingFeature(true);
MemberSubmissionAddressingFeature addr = new MemberSubmissionAddressingFeature(false, false);
WebServiceFeature[] features = new WebServiceFeature[] { feature, addr };
AddNumbersPortType port = epr.getPort(AddNumbersPortType.class, features);
assertTrue(port != null);
// expectation is that port is not configured for addressing and the invocation will fail
try {
System.out.println("Adding numbers 2 and 4");
int result = port.addNumbers(2, 4);
} catch (Exception ex) {
assertTrue(ex instanceof SOAPFaultException);
System.out.println(((SOAPFaultException) ex).getFault().getFaultString());
}
}
use of jakarta.xml.ws.soap.SOAPFaultException in project metro-jax-ws by eclipse-ee4j.
the class AddNumbersClient method testEPRGetPortVIIII.
public void testEPRGetPortVIIII() throws Exception {
if (ClientServerTestUtil.useLocal()) {
System.out.println("HTTP Transport Only Exiting");
return;
}
AddNumbersPortType proxy = createStub();
// EndpointReference epr = ((BindingProvider) proxy).getEndpointReference(W3CEndpointReference.class);
EndpointReference epr = ((BindingProvider) proxy).getEndpointReference(MemberSubmissionEndpointReference.class);
RespectBindingFeature feature = new RespectBindingFeature(true);
AddressingFeature addr = new AddressingFeature(true, false);
WebServiceFeature[] features = new WebServiceFeature[] { feature, addr };
AddNumbersPortType port = epr.getPort(AddNumbersPortType.class, features);
assertTrue(port != null);
// expectation is that port is not configured for addressing and the invocation will fail
try {
System.out.println("Adding numbers 2 and 4");
int result = port.addNumbers(2, 4);
} catch (Exception ex) {
assertTrue(ex instanceof SOAPFaultException);
System.out.println(((SOAPFaultException) ex).getFault().getFaultString());
}
}
Aggregations