Search in sources :

Example 6 with SOAPBinding

use of javax.jws.soap.SOAPBinding in project cxf by apache.

the class CodeGenTest method testSupportXMLBindingBare.

@Test
public void testSupportXMLBindingBare() throws Exception {
    env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/xml_http_bare.wsdl"));
    processor.setContext(env);
    processor.execute();
    Class<?> clz = classLoader.loadClass("org.apache.xml_http_bare.GreetingPortType");
    Method method = clz.getMethod("sayHello", new Class[] { java.lang.String.class });
    assertNotNull("sayHello is not be generated", method);
    SOAPBinding soapBindingAnn = clz.getAnnotation(SOAPBinding.class);
    assertEquals(soapBindingAnn.parameterStyle(), SOAPBinding.ParameterStyle.BARE);
}
Also used : SOAPBinding(javax.jws.soap.SOAPBinding) Method(java.lang.reflect.Method) WebMethod(javax.jws.WebMethod) AbstractCodeGenTest(org.apache.cxf.tools.wsdlto.AbstractCodeGenTest) Test(org.junit.Test)

Example 7 with SOAPBinding

use of javax.jws.soap.SOAPBinding in project cxf by apache.

the class JaxWsServiceConfiguration method isRPC.

@Override
public Boolean isRPC(Method method) {
    SOAPBinding ann = method.getAnnotation(SOAPBinding.class);
    if (ann != null) {
        return ann.style().equals(SOAPBinding.Style.RPC);
    }
    ann = implInfo.getEndpointClass().getAnnotation(SOAPBinding.class);
    if (ann != null) {
        return ann.style().equals(SOAPBinding.Style.RPC);
    }
    return super.isRPC(method);
}
Also used : SOAPBinding(javax.jws.soap.SOAPBinding)

Example 8 with SOAPBinding

use of javax.jws.soap.SOAPBinding in project cxf by apache.

the class JaxWsServiceConfiguration method isDocumentBare.

private boolean isDocumentBare(Method method) {
    SOAPBinding ann = method.getAnnotation(SOAPBinding.class);
    if (ann != null) {
        return ann.style().equals(SOAPBinding.Style.DOCUMENT) && ann.parameterStyle().equals(SOAPBinding.ParameterStyle.BARE);
    }
    ann = implInfo.getEndpointClass().getAnnotation(SOAPBinding.class);
    if (ann != null) {
        return ann.style().equals(SOAPBinding.Style.DOCUMENT) && ann.parameterStyle().equals(SOAPBinding.ParameterStyle.BARE);
    }
    return false;
}
Also used : SOAPBinding(javax.jws.soap.SOAPBinding)

Example 9 with SOAPBinding

use of javax.jws.soap.SOAPBinding in project cxf by apache.

the class JaxWsServiceConfiguration method isWrapped.

@Override
public Boolean isWrapped(Method m) {
    // see if someone overrode the default value
    if (getServiceFactory().getWrapped() != null) {
        return getServiceFactory().getWrapped();
    }
    m = getDeclaredMethod(m);
    SOAPBinding ann = m.getAnnotation(SOAPBinding.class);
    if (ann != null) {
        if (ann.style().equals(Style.RPC)) {
            Message message = new Message("SOAPBinding_MESSAGE_RPC", LOG, m.getName());
            throw new Fault(new JaxWsConfigurationException(message));
        }
        return !(ann.parameterStyle().equals(ParameterStyle.BARE));
    }
    return isWrapped();
}
Also used : JaxWsConfigurationException(org.apache.cxf.jaxws.JaxWsConfigurationException) Message(org.apache.cxf.common.i18n.Message) SOAPBinding(javax.jws.soap.SOAPBinding) Fault(org.apache.cxf.interceptor.Fault) WebFault(javax.xml.ws.WebFault)

Aggregations

SOAPBinding (javax.jws.soap.SOAPBinding)9 Method (java.lang.reflect.Method)5 WebMethod (javax.jws.WebMethod)5 AbstractCodeGenTest (org.apache.cxf.tools.wsdlto.AbstractCodeGenTest)5 Test (org.junit.Test)5 File (java.io.File)3 WebParam (javax.jws.WebParam)3 WebService (javax.jws.WebService)2 ObjectStreamClass (java.io.ObjectStreamClass)1 Oneway (javax.jws.Oneway)1 WebResult (javax.jws.WebResult)1 Holder (javax.xml.ws.Holder)1 RequestWrapper (javax.xml.ws.RequestWrapper)1 ResponseWrapper (javax.xml.ws.ResponseWrapper)1 WebFault (javax.xml.ws.WebFault)1 Message (org.apache.cxf.common.i18n.Message)1 Fault (org.apache.cxf.interceptor.Fault)1 JaxWsConfigurationException (org.apache.cxf.jaxws.JaxWsConfigurationException)1 JAnnotation (org.apache.cxf.tools.common.model.JAnnotation)1 JAnnotationElement (org.apache.cxf.tools.common.model.JAnnotationElement)1