use of javax.jws.Oneway in project narayana by jbosstm.
the class CoordinationFaultPortTypeImpl method soapFault.
@WebMethod(operationName = "SoapFault", action = "http://www.w3.org/2005/08/addressing/soap/fault")
@Oneway
@Action(input = "http://www.w3.org/2005/08/addressing/soap/fault")
public void soapFault(@WebParam(name = "Fault", targetNamespace = "http://schemas.xmlsoap.org/soap/envelope/", partName = "fault") Fault fault) {
MessageContext ctx = webServiceCtx.getMessageContext();
MAP inboundMap = AddressingHelper.inboundMap(ctx);
if (inboundMap.getRelatesTo() != null) {
WSCLogger.logger.tracev("CoordinationFaultPortTypeImpl receiving fault for message={0} - string={1} code={2} details={3}", inboundMap.getRelatesTo().getRelatesTo(), fault.getFaultstring(), fault.getFaultcode(), fault.getDetail() == null ? "null" : fault.getDetail().getAny());
AsynchronousRegistrationMapper.getInstance().assignFault(inboundMap.getRelatesTo().getRelatesTo(), fault);
} else {
WSCLogger.i18NLogger.error_empty_messageId_received_by_async_endpoint();
}
}
use of javax.jws.Oneway in project narayana by jbosstm.
the class InitiatorPortTypeImpl method soapFault.
@WebMethod(operationName = "SoapFault", action = "http://www.wstf.org/docs/scenarios/sc007/SoapFault")
@Oneway
@Action(input = "http://www.wstf.org/docs/scenarios/sc007/SoapFault")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public void soapFault(@WebParam(name = "Fault", targetNamespace = "http://schemas.xmlsoap.org/soap/envelope/", partName = "parameters") Fault fault) {
MessageContext ctx = webServiceCtx.getMessageContext();
MAP inboundMap = AddressingHelper.inboundMap(ctx);
SoapFault11 soapFaultInternal = SoapFault11.fromFault(fault);
InitiatorProcessor.getInitiator().handleSoapFault(soapFaultInternal, inboundMap);
}
use of javax.jws.Oneway in project narayana by jbosstm.
the class InitiatorPortTypeImpl method soapFault.
@WebMethod(operationName = "SoapFault", action = "http://fabrikam123.com/SoapFault")
@Oneway
@Action(input = "http://fabrikam123.com/SoapFault")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public void soapFault(@WebParam(name = "Fault", targetNamespace = "http://schemas.xmlsoap.org/soap/envelope/", partName = "parameters") Fault fault) {
MessageContext ctx = webServiceCtx.getMessageContext();
MAP inboundMap = AddressingHelper.inboundMap(ctx);
SoapFault11 soapFaultInternal = SoapFault11.fromFault(fault);
ATInitiatorProcessor.getInitiator().handleSoapFault(soapFaultInternal, inboundMap);
}
use of javax.jws.Oneway in project narayana by jbosstm.
the class InitiatorPortTypeImpl method response.
/**
*/
@WebMethod(operationName = "Response", action = "http://fabrikam123.com/wsba/Response")
@Oneway
@Action(input = "http://fabrikam123.com/wsba/Response")
@RequestWrapper(localName = "Response", targetNamespace = "http://fabrikam123.com/wsba", className = "com.jboss.transaction.txinterop.webservices.bainterop.generated.TestMessageType")
public void response() {
MessageContext ctx = webServiceCtx.getMessageContext();
MAP inboundMap = AddressingHelper.inboundMap(ctx);
BAInitiatorProcessor.getInitiator().handleResponse(inboundMap);
}
use of javax.jws.Oneway in project cxf by apache.
the class CodeGenTest method testHelloWorld.
@Test
public void testHelloWorld() throws Exception {
env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/hello_world.wsdl"));
processor.setContext(env);
processor.execute();
assertNotNull(output);
File org = new File(output, "org");
assertTrue(org.exists());
File apache = new File(org, "apache");
assertTrue(apache.exists());
File cxf = new File(apache, "cxf");
assertTrue(cxf.exists());
File w2j = new File(cxf, "w2j");
assertTrue(w2j.exists());
File helloworldsoaphttp = new File(w2j, "hello_world_soap_http");
assertTrue(helloworldsoaphttp.exists());
File types = new File(helloworldsoaphttp, "types");
assertTrue(types.exists());
File[] files = helloworldsoaphttp.listFiles();
assertEquals(9, files.length);
files = types.listFiles();
assertEquals(17, files.length);
Class<?> clz = classLoader.loadClass("org.apache.cxf.w2j.hello_world_soap_http.Greeter");
assertTrue("class " + clz.getName() + " modifier is not public", Modifier.isPublic(clz.getModifiers()));
assertTrue("class " + clz.getName() + " modifier is interface", Modifier.isInterface(clz.getModifiers()));
WebService webServiceAnn = AnnotationUtil.getPrivClassAnnotation(clz, WebService.class);
assertEquals("Greeter", webServiceAnn.name());
Method method = clz.getMethod("sayHi", new Class[] {});
WebMethod webMethodAnno = AnnotationUtil.getPrivMethodAnnotation(method, WebMethod.class);
if (webMethodAnno.operationName() != null && !"".equals(webMethodAnno.operationName())) {
assertEquals(method.getName() + "()" + " Annotation : WebMethod.operationName ", "sayHi", webMethodAnno.operationName());
}
RequestWrapper requestWrapperAnn = AnnotationUtil.getPrivMethodAnnotation(method, RequestWrapper.class);
assertEquals("org.apache.cxf.w2j.hello_world_soap_http.types.SayHi", requestWrapperAnn.className());
ResponseWrapper resposneWrapperAnn = AnnotationUtil.getPrivMethodAnnotation(method, ResponseWrapper.class);
assertEquals("sayHiResponse", resposneWrapperAnn.localName());
WebResult webResultAnno = AnnotationUtil.getPrivMethodAnnotation(method, WebResult.class);
assertEquals("responseType", webResultAnno.name());
method = clz.getMethod("greetMe", new Class[] { String.class });
assertEquals("String", method.getReturnType().getSimpleName());
WebParam webParamAnn = AnnotationUtil.getWebParam(method, "requestType");
// if is wrapped, tns should be empty
assertEquals("http://cxf.apache.org/w2j/hello_world_soap_http/types", webParamAnn.targetNamespace());
// assertEquals("", webParamAnn.targetNamespace());
method = clz.getMethod("greetMeOneWay", new Class[] { String.class });
Oneway oneWayAnn = AnnotationUtil.getPrivMethodAnnotation(method, Oneway.class);
assertNotNull("OneWay Annotation is not generated", oneWayAnn);
assertEquals("void", method.getReturnType().getSimpleName());
method = clz.getMethod("greetMeSometime", new Class[] { String.class });
assertEquals("String", method.getReturnType().getSimpleName());
method = clz.getMethod("testDocLitFault", new Class[] { java.lang.String.class });
assertEquals("void", method.getReturnType().getSimpleName());
assertEquals("Exception class is not generated ", 2, method.getExceptionTypes().length);
method = clz.getMethod("testDocLitBare", new Class[] { java.lang.String.class });
webResultAnno = AnnotationUtil.getPrivMethodAnnotation(method, WebResult.class);
assertEquals("out", webResultAnno.partName());
SOAPBinding soapBindingAnno = AnnotationUtil.getPrivMethodAnnotation(method, SOAPBinding.class);
assertNotNull(soapBindingAnno);
assertEquals(SOAPBinding.ParameterStyle.BARE, soapBindingAnno.parameterStyle());
assertEquals("BareDocumentResponse", method.getReturnType().getSimpleName());
}
Aggregations