use of com.sun.xml.ws.developer.MemberSubmissionAddressingFeature in project metro-jax-ws by eclipse-ee4j.
the class WSServiceDelegate method createDispatch.
protected Dispatch<Object> createDispatch(QName portName, JAXBContext jaxbContext, Service.Mode mode, WebServiceFeatureList features) {
WSEndpointReference wsepr = null;
boolean isAddressingEnabled = false;
AddressingFeature af = features.get(AddressingFeature.class);
if (af == null) {
af = this.features.get(AddressingFeature.class);
}
if (af != null && af.isEnabled())
isAddressingEnabled = true;
MemberSubmissionAddressingFeature msa = features.get(MemberSubmissionAddressingFeature.class);
if (msa == null) {
msa = this.features.get(MemberSubmissionAddressingFeature.class);
}
if (msa != null && msa.isEnabled())
isAddressingEnabled = true;
if (isAddressingEnabled && wsdlService != null && wsdlService.get(portName) != null) {
wsepr = wsdlService.get(portName).getEPR();
}
return createDispatch(portName, wsepr, jaxbContext, mode, features);
}
use of com.sun.xml.ws.developer.MemberSubmissionAddressingFeature in project metro-jax-ws by eclipse-ee4j.
the class WSServiceDelegate method createDispatch.
public <T> Dispatch<T> createDispatch(QName portName, Class<T> aClass, Service.Mode mode, WebServiceFeatureList features) {
WSEndpointReference wsepr = null;
boolean isAddressingEnabled = false;
AddressingFeature af = features.get(AddressingFeature.class);
if (af == null) {
af = this.features.get(AddressingFeature.class);
}
if (af != null && af.isEnabled())
isAddressingEnabled = true;
MemberSubmissionAddressingFeature msa = features.get(MemberSubmissionAddressingFeature.class);
if (msa == null) {
msa = this.features.get(MemberSubmissionAddressingFeature.class);
}
if (msa != null && msa.isEnabled())
isAddressingEnabled = true;
if (isAddressingEnabled && wsdlService != null && wsdlService.get(portName) != null) {
wsepr = wsdlService.get(portName).getEPR();
}
return createDispatch(portName, wsepr, aClass, mode, features);
}
use of com.sun.xml.ws.developer.MemberSubmissionAddressingFeature 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 com.sun.xml.ws.developer.MemberSubmissionAddressingFeature in project metro-jax-ws by eclipse-ee4j.
the class AddNumbersClient method xxtestEPRGetPortVIII.
// UsingAddressing wsdl:required=true
// AddressingFeature Disabled expect Exception
// Expect no valid port created, so exception thrown
public void xxtestEPRGetPortVIII() 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(true, false);
WebServiceFeature[] features = new WebServiceFeature[] { feature, addr };
AddNumbersPortType port = epr.getPort(AddNumbersPortType.class, features);
assertTrue(port != null);
System.out.println("Adding numbers 2 and 4");
int result = port.addNumbers(2, 4);
assert (result == 6);
System.out.println("Addinion of 2 and 4 successful");
}
use of com.sun.xml.ws.developer.MemberSubmissionAddressingFeature in project metro-jax-ws by eclipse-ee4j.
the class AddNumbersClient method testEPRGetPortVIIIII.
public void testEPRGetPortVIIIII() 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(true, true);
WebServiceFeature[] features = new WebServiceFeature[] { feature, addr };
AddNumbersPortType port = epr.getPort(AddNumbersPortType.class, features);
assertTrue(port != null);
System.out.println("Adding numbers 2 and 4");
int result = port.addNumbers(2, 4);
assert (result == 6);
System.out.println("Addinion of 2 and 4 successful");
}
Aggregations