javax.jws.soap.SOAPBinding Java Examples

The following examples show how to use javax.jws.soap.SOAPBinding. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WebServiceVisitor.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
protected SOAPBinding popSoapBinding() {
    if (pushedSoapBinding)
        soapBindingStack.pop();
    SOAPBinding soapBinding = null;
    if (!soapBindingStack.empty()) {
        soapBinding = soapBindingStack.peek();
        if (soapBinding.style().equals(SOAPBinding.Style.RPC)) {
            soapStyle = SOAPStyle.RPC;
            wrapped = true;
        } else {
            soapStyle = SOAPStyle.DOCUMENT;
            wrapped = soapBinding.parameterStyle().equals(ParameterStyle.WRAPPED);
        }
    } else {
            pushedSoapBinding = false;
    }
    return soapBinding;
}
 
Example #2
Source File: WebServiceVisitor.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
protected void preProcessWebService(WebService webService, TypeElement element) {
    processedMethods = new HashSet<String>();
    seiContext = context.getSeiContext(element);
    String targetNamespace = null;
    if (webService != null)
        targetNamespace = webService.targetNamespace();
    PackageElement packageElement = builder.getProcessingEnvironment().getElementUtils().getPackageOf(element);
    if (targetNamespace == null || targetNamespace.length() == 0) {
        String packageName = packageElement.getQualifiedName().toString();
        if (packageName == null || packageName.length() == 0) {
            builder.processError(WebserviceapMessages.WEBSERVICEAP_NO_PACKAGE_CLASS_MUST_HAVE_TARGETNAMESPACE(
                    element.getQualifiedName()), element);
        }
        targetNamespace = RuntimeModeler.getNamespace(packageName);
    }
    seiContext.setNamespaceUri(targetNamespace);
    if (serviceImplName == null)
        serviceImplName = seiContext.getSeiImplName();
    if (serviceImplName != null) {
        seiContext.setSeiImplName(serviceImplName);
        context.addSeiContext(serviceImplName, seiContext);
    }
    portName = ClassNameInfo.getName(element.getSimpleName().toString().replace('$', '_'));
    packageName = packageElement.getQualifiedName();
    portName = webService != null && webService.name() != null && webService.name().length() > 0 ?
            webService.name() : portName;
    serviceName = ClassNameInfo.getName(element.getQualifiedName().toString()) + WebServiceConstants.SERVICE.getValue();
    serviceName = webService != null && webService.serviceName() != null && webService.serviceName().length() > 0 ?
            webService.serviceName() : serviceName;
    wsdlNamespace = seiContext.getNamespaceUri();
    typeNamespace = wsdlNamespace;

    SOAPBinding soapBinding = element.getAnnotation(SOAPBinding.class);
    if (soapBinding != null) {
        pushedSoapBinding = pushSoapBinding(soapBinding, element, element);
    } else if (element.equals(typeElement)) {
        pushedSoapBinding = pushSoapBinding(new MySoapBinding(), element, element);
    }
}
 
Example #3
Source File: Media.java    From onvif with Apache License 2.0 5 votes vote down vote up
/**
 * Get the OSD.
 */
@WebMethod(operationName = "GetOSD", action = "http://www.onvif.org/ver10/media/wsdl/GetOSD")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@WebResult(name = "GetOSDResponse", targetNamespace = "http://www.onvif.org/ver10/media/wsdl", partName = "parameters")
public GetOSDResponse getOSD(

    @WebParam(partName = "parameters", name = "GetOSD", targetNamespace = "http://www.onvif.org/ver10/media/wsdl")
    GetOSD parameters
);
 
Example #4
Source File: RuntimeModeler.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * creates a runtime model <code>SOAPBinding</code> from a <code>javax.jws.soap.SOAPBinding</code> object
 * @param soapBinding the <code>javax.jws.soap.SOAPBinding</code> to model
 * @return returns the runtime model SOAPBinding corresponding to <code>soapBinding</code>
 */
protected SOAPBindingImpl createBinding(SOAPBinding soapBinding) {
    SOAPBindingImpl rtSOAPBinding = new SOAPBindingImpl();
    Style style = soapBinding!=null ? soapBinding.style() : Style.DOCUMENT;
    rtSOAPBinding.setStyle(style);
    assert bindingId != null;
    model.bindingId = bindingId;
    SOAPVersion soapVersion = bindingId.getSOAPVersion();
    rtSOAPBinding.setSOAPVersion(soapVersion);
    return rtSOAPBinding;
}
 
Example #5
Source File: DisplayPort.java    From onvif with Apache License 2.0 5 votes vote down vote up
/**
 * The Display Options contain the supported layouts (LayoutOptions) and the
 *         decoding and
 *         encoding capabilities (CodingCapabilities) of the device. The GetDisplayOptions command
 *         returns both, Layout and Coding Capabilities, of a VideoOutput.
 *       
 */
@WebMethod(operationName = "GetDisplayOptions", action = "http://www.onvif.org/ver10/display/wsdl/GetDisplayOptions")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@WebResult(name = "GetDisplayOptionsResponse", targetNamespace = "http://www.onvif.org/ver10/display/wsdl", partName = "parameters")
public GetDisplayOptionsResponse getDisplayOptions(

    @WebParam(partName = "parameters", name = "GetDisplayOptions", targetNamespace = "http://www.onvif.org/ver10/display/wsdl")
    GetDisplayOptions parameters
);
 
Example #6
Source File: WebServiceVisitor.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
protected void preProcessWebService(WebService webService, TypeElement element) {
    processedMethods = new HashSet<String>();
    seiContext = context.getSeiContext(element);
    String targetNamespace = null;
    if (webService != null)
        targetNamespace = webService.targetNamespace();
    PackageElement packageElement = builder.getProcessingEnvironment().getElementUtils().getPackageOf(element);
    if (targetNamespace == null || targetNamespace.length() == 0) {
        String packageName = packageElement.getQualifiedName().toString();
        if (packageName == null || packageName.length() == 0) {
            builder.processError(WebserviceapMessages.WEBSERVICEAP_NO_PACKAGE_CLASS_MUST_HAVE_TARGETNAMESPACE(
                    element.getQualifiedName()), element);
        }
        targetNamespace = RuntimeModeler.getNamespace(packageName);
    }
    seiContext.setNamespaceUri(targetNamespace);
    if (serviceImplName == null)
        serviceImplName = seiContext.getSeiImplName();
    if (serviceImplName != null) {
        seiContext.setSeiImplName(serviceImplName);
        context.addSeiContext(serviceImplName, seiContext);
    }
    portName = ClassNameInfo.getName(element.getSimpleName().toString().replace('$', '_'));
    packageName = packageElement.getQualifiedName();
    portName = webService != null && webService.name() != null && webService.name().length() > 0 ?
            webService.name() : portName;
    serviceName = ClassNameInfo.getName(element.getQualifiedName().toString()) + WebServiceConstants.SERVICE.getValue();
    serviceName = webService != null && webService.serviceName() != null && webService.serviceName().length() > 0 ?
            webService.serviceName() : serviceName;
    wsdlNamespace = seiContext.getNamespaceUri();
    typeNamespace = wsdlNamespace;

    SOAPBinding soapBinding = element.getAnnotation(SOAPBinding.class);
    if (soapBinding != null) {
        pushedSoapBinding = pushSoapBinding(soapBinding, element, element);
    } else if (element.equals(typeElement)) {
        pushedSoapBinding = pushSoapBinding(new MySoapBinding(), element, element);
    }
}
 
Example #7
Source File: DisplayPort.java    From onvif with Apache License 2.0 5 votes vote down vote up
/**
 * Modify one or more configurations of the specified video output.
 *         This method will only modify the provided configurations and leave the others unchanged.
 *         Use  to remove pane
 *         configurations.
 *       
 */
@WebMethod(operationName = "SetPaneConfigurations", action = "http://www.onvif.org/ver10/display/wsdl/SetPaneConfigurations")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@WebResult(name = "SetPaneConfigurationsResponse", targetNamespace = "http://www.onvif.org/ver10/display/wsdl", partName = "parameters")
public SetPaneConfigurationsResponse setPaneConfigurations(

    @WebParam(partName = "parameters", name = "SetPaneConfigurations", targetNamespace = "http://www.onvif.org/ver10/display/wsdl")
    SetPaneConfigurations parameters
);
 
Example #8
Source File: JUDDIApiPortType.java    From juddi with Apache License 2.0 5 votes vote down vote up
/**
 * 
 * @param body
 * @return
 *     returns org.apache.juddi.api_v3.PublisherDetail
 * @throws DispositionReportFaultMessage
 */
@WebMethod(operationName = "get_allPublisherDetail", action = "get_allPublisherDetail")
@WebResult(name = "publisherDetail", targetNamespace = "urn:juddi-apache-org:api_v3", partName = "body")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public PublisherDetail getAllPublisherDetail(
    @WebParam(name = "get_allPublisherDetail", targetNamespace = "urn:juddi-apache-org:api_v3", partName = "body")
    GetAllPublisherDetail body)
    throws DispositionReportFaultMessage, RemoteException
;
 
Example #9
Source File: WebServiceVisitor.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Void visitExecutable(ExecutableElement method, Object o) {
    // Methods must be public
    if (!method.getModifiers().contains(Modifier.PUBLIC))
        return null;
    if (processedMethod(method))
        return null;
    WebMethod webMethod = method.getAnnotation(WebMethod.class);
    if (webMethod != null && webMethod.exclude())
        return null;
    SOAPBinding soapBinding = method.getAnnotation(SOAPBinding.class);
    if (soapBinding == null && !method.getEnclosingElement().equals(typeElement)) {
        if (method.getEnclosingElement().getKind().equals(ElementKind.CLASS)) {
            soapBinding = method.getEnclosingElement().getAnnotation(SOAPBinding.class);
            if (soapBinding != null)
                builder.log("using " + method.getEnclosingElement() + "'s SOAPBinding.");
            else {
                soapBinding = new MySoapBinding();
            }
        }
    }
    boolean newBinding = false;
    if (soapBinding != null) {
        newBinding = pushSoapBinding(soapBinding, method, typeElement);
    }
    try {
        if (shouldProcessMethod(method, webMethod)) {
            processMethod(method, webMethod);
        }
    } finally {
        if (newBinding) {
            popSoapBinding();
        }
    }
    return null;
}
 
Example #10
Source File: WebServiceVisitor.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected void preProcessWebService(WebService webService, TypeElement element) {
    processedMethods = new HashSet<String>();
    seiContext = context.getSeiContext(element);
    String targetNamespace = null;
    if (webService != null)
        targetNamespace = webService.targetNamespace();
    PackageElement packageElement = builder.getProcessingEnvironment().getElementUtils().getPackageOf(element);
    if (targetNamespace == null || targetNamespace.length() == 0) {
        String packageName = packageElement.getQualifiedName().toString();
        if (packageName == null || packageName.length() == 0) {
            builder.processError(WebserviceapMessages.WEBSERVICEAP_NO_PACKAGE_CLASS_MUST_HAVE_TARGETNAMESPACE(
                    element.getQualifiedName()), element);
        }
        targetNamespace = RuntimeModeler.getNamespace(packageName);
    }
    seiContext.setNamespaceUri(targetNamespace);
    if (serviceImplName == null)
        serviceImplName = seiContext.getSeiImplName();
    if (serviceImplName != null) {
        seiContext.setSeiImplName(serviceImplName);
        context.addSeiContext(serviceImplName, seiContext);
    }
    portName = ClassNameInfo.getName(element.getSimpleName().toString().replace('$', '_'));
    packageName = packageElement.getQualifiedName();
    portName = webService != null && webService.name() != null && webService.name().length() > 0 ?
            webService.name() : portName;
    serviceName = ClassNameInfo.getName(element.getQualifiedName().toString()) + WebServiceConstants.SERVICE.getValue();
    serviceName = webService != null && webService.serviceName() != null && webService.serviceName().length() > 0 ?
            webService.serviceName() : serviceName;
    wsdlNamespace = seiContext.getNamespaceUri();
    typeNamespace = wsdlNamespace;

    SOAPBinding soapBinding = element.getAnnotation(SOAPBinding.class);
    if (soapBinding != null) {
        pushedSoapBinding = pushSoapBinding(soapBinding, element, element);
    } else if (element.equals(typeElement)) {
        pushedSoapBinding = pushSoapBinding(new MySoapBinding(), element, element);
    }
}
 
Example #11
Source File: JUDDIApiPortType.java    From juddi with Apache License 2.0 5 votes vote down vote up
/**
 * 
 * @param body
 * @throws DispositionReportFaultMessage
 */
@WebMethod(operationName = "delete_publisher", action = "delete_publisher")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public void deletePublisher(
    @WebParam(name = "delete_publisher", targetNamespace = "urn:juddi-apache-org:api_v3", partName = "body")
    DeletePublisher body)
    throws DispositionReportFaultMessage, RemoteException
;
 
Example #12
Source File: WebParamAnnotatorTest.java    From cxf with Apache License 2.0 5 votes vote down vote up
@Test
public void testAnnotateDOCWrapped() throws Exception {
    init(method, parameter, SOAPBinding.Style.DOCUMENT, true);
    parameter.annotate(new WebParamAnnotator());

    JAnnotation annotation = parameter.getAnnotation("WebParam");
    assertEquals("@WebParam(name = \"x\", targetNamespace = \"http://apache.org/cxf\")",
                     annotation.toString());
    List<JAnnotationElement> elements = annotation.getElements();
    assertEquals(2, elements.size());
    assertEquals("http://apache.org/cxf", elements.get(1).getValue());
    assertEquals("x", elements.get(0).getValue());
}
 
Example #13
Source File: DeviceIOPort.java    From onvif with Apache License 2.0 5 votes vote down vote up
/**
 * Modify a video input configuration. A device that has one or more video
 *         sources shall support the setting of the VideoSourceConfiguration through this command.
 *       
 */
@WebMethod(operationName = "SetVideoSourceConfiguration", action = "http://www.onvif.org/ver10/deviceio/wsdl/SetVideoSourceConfiguration")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@WebResult(name = "SetVideoSourceConfigurationResponse", targetNamespace = "http://www.onvif.org/ver10/deviceIO/wsdl", partName = "parameters")
public SetVideoSourceConfigurationResponse setVideoSourceConfiguration(

    @WebParam(partName = "parameters", name = "SetVideoSourceConfiguration", targetNamespace = "http://www.onvif.org/ver10/deviceIO/wsdl")
    SetVideoSourceConfiguration parameters
);
 
Example #14
Source File: JUDDIApiPortType.java    From juddi with Apache License 2.0 5 votes vote down vote up
/**
 * 
 * @param body
 * @return
 *     returns org.apache.juddi.api_v3.NodeDetail
 * @throws DispositionReportFaultMessage
 */
@WebMethod(operationName = "save_Node", action = "save_Node")
@WebResult(name = "save_NodeResponse", targetNamespace = "urn:juddi-apache-org:v3_service", partName = "save_NodeResponse")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public NodeDetail saveNode(
    @WebParam(name = "save_NodeRequest", targetNamespace = "urn:juddi-apache-org:api_v3", partName = "body")
    SaveNode body)
    throws DispositionReportFaultMessage, RemoteException
;
 
Example #15
Source File: WebServiceVisitor.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Void visitExecutable(ExecutableElement method, Object o) {
    // Methods must be public
    if (!method.getModifiers().contains(Modifier.PUBLIC))
        return null;
    if (processedMethod(method))
        return null;
    WebMethod webMethod = method.getAnnotation(WebMethod.class);
    if (webMethod != null && webMethod.exclude())
        return null;
    SOAPBinding soapBinding = method.getAnnotation(SOAPBinding.class);
    if (soapBinding == null && !method.getEnclosingElement().equals(typeElement)) {
        if (method.getEnclosingElement().getKind().equals(ElementKind.CLASS)) {
            soapBinding = method.getEnclosingElement().getAnnotation(SOAPBinding.class);
            if (soapBinding != null)
                builder.log("using " + method.getEnclosingElement() + "'s SOAPBinding.");
            else {
                soapBinding = new MySoapBinding();
            }
        }
    }
    boolean newBinding = false;
    if (soapBinding != null) {
        newBinding = pushSoapBinding(soapBinding, method, typeElement);
    }
    try {
        if (shouldProcessMethod(method, webMethod)) {
            processMethod(method, webMethod);
        }
    } finally {
        if (newBinding) {
            popSoapBinding();
        }
    }
    return null;
}
 
Example #16
Source File: DeviceIOPort.java    From onvif with Apache License 2.0 5 votes vote down vote up
/**
 * Modify an audio output configuration. A device that has one ore more audio
 *         outputs shall support the setting of the AudioOutputConfiguration through this command.
 *       
 */
@WebMethod(operationName = "SetAudioOutputConfiguration", action = "http://www.onvif.org/ver10/deviceio/wsdl/SetAudioOutputConfiguration")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@WebResult(name = "SetAudioOutputConfigurationResponse", targetNamespace = "http://www.onvif.org/ver10/deviceIO/wsdl", partName = "parameters")
public SetAudioOutputConfigurationResponse setAudioOutputConfiguration(

    @WebParam(partName = "parameters", name = "SetAudioOutputConfiguration", targetNamespace = "http://www.onvif.org/ver10/deviceIO/wsdl")
    SetAudioOutputConfiguration parameters
);
 
Example #17
Source File: CodeGenTest.java    From cxf with Apache License 2.0 5 votes vote down vote up
@Test
public void testHolderHeader() throws Exception {
    env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/hello_world_holder.wsdl"));
    env.remove(ToolConstants.CFG_VALIDATE_WSDL); // testing multiple parts in body
    processor.setContext(env);
    processor.execute();

    Class<?> clz = classLoader.loadClass("org.apache.cxf.w2j.hello_world_holder.Greeter");
    assertEquals(2, clz.getMethods().length);

    Class<?> para = classLoader.loadClass("org.apache.cxf.w2j.hello_world_holder.types.GreetMe");
    Method method = clz.getMethod("sayHi", new Class[] {Holder.class, para});
    assertEquals("GreetMeResponse", method.getReturnType().getSimpleName());

    SOAPBinding soapBindingAnno = AnnotationUtil.getPrivClassAnnotation(clz, SOAPBinding.class);
    if (soapBindingAnno == null) {
        soapBindingAnno = method.getAnnotation(SOAPBinding.class);
    }
    assertNotNull(soapBindingAnno);
    assertEquals("BARE", soapBindingAnno.parameterStyle().name());
    assertEquals("LITERAL", soapBindingAnno.use().name());
    assertEquals("DOCUMENT", soapBindingAnno.style().name());


    WebParam webParamAnno = AnnotationUtil.getWebParam(method, "greetMe");
    assertTrue(webParamAnno.header());

    webParamAnno = AnnotationUtil.getWebParam(method, "sayHi");
    assertEquals("INOUT", webParamAnno.mode().name());

    method = clz.getMethod("testInOut", Holder.class, Integer.TYPE);
}
 
Example #18
Source File: EPCISServicePortType.java    From fosstrak-epcis with GNU Lesser General Public License v2.1 5 votes vote down vote up
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@WebResult(name = "GetSubscriptionIDsResult", targetNamespace = "urn:epcglobal:epcis-query:xsd:1", partName = "getSubscriptionIDsReturn")
@WebMethod
public org.fosstrak.epcis.model.ArrayOfString getSubscriptionIDs(
        @WebParam(partName = "parms", name = "GetSubscriptionIDs", targetNamespace = "urn:epcglobal:epcis-query:xsd:1")
        org.fosstrak.epcis.model.GetSubscriptionIDs parms) throws ImplementationExceptionResponse,
        SecurityExceptionResponse, ValidationExceptionResponse, NoSuchNameExceptionResponse;
 
Example #19
Source File: DeviceIOPort.java    From onvif with Apache License 2.0 5 votes vote down vote up
/**
 * List the configuration of an Audio Input. A device with one or more audio
 *         inputs shall support the GetAudioSourceConfiguration command.
 *       
 */
@WebMethod(operationName = "GetAudioSourceConfiguration", action = "http://www.onvif.org/ver10/deviceio/wsdl/GetAudioSourceConfiguration")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@WebResult(name = "GetAudioSourceConfigurationResponse", targetNamespace = "http://www.onvif.org/ver10/deviceIO/wsdl", partName = "parameters")
public GetAudioSourceConfigurationResponse getAudioSourceConfiguration(

    @WebParam(partName = "parameters", name = "GetAudioSourceConfiguration", targetNamespace = "http://www.onvif.org/ver10/deviceIO/wsdl")
    GetAudioSourceConfiguration parameters
);
 
Example #20
Source File: JaxWsServiceConfiguration.java    From cxf with Apache License 2.0 5 votes vote down vote up
@Override
public Boolean isWrapped() {
    SOAPBinding ann = implInfo.getEndpointClass().getAnnotation(SOAPBinding.class);
    if (ann != null) {
        return !(ann.parameterStyle().equals(ParameterStyle.BARE) || ann.style().equals(Style.RPC));
    }
    return null;
}
 
Example #21
Source File: JaxWsServiceConfiguration.java    From cxf with Apache License 2.0 5 votes vote down vote up
@Override
public String getStyle() {
    SOAPBinding ann = implInfo.getEndpointClass().getAnnotation(SOAPBinding.class);
    if (ann != null) {
        return ann.style().toString().toLowerCase();
    }
    return super.getStyle();
}
 
Example #22
Source File: WebServiceVisitor.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Void visitExecutable(ExecutableElement method, Object o) {
    // Methods must be public
    if (!method.getModifiers().contains(Modifier.PUBLIC))
        return null;
    if (processedMethod(method))
        return null;
    WebMethod webMethod = method.getAnnotation(WebMethod.class);
    if (webMethod != null && webMethod.exclude())
        return null;
    SOAPBinding soapBinding = method.getAnnotation(SOAPBinding.class);
    if (soapBinding == null && !method.getEnclosingElement().equals(typeElement)) {
        if (method.getEnclosingElement().getKind().equals(ElementKind.CLASS)) {
            soapBinding = method.getEnclosingElement().getAnnotation(SOAPBinding.class);
            if (soapBinding != null)
                builder.log("using " + method.getEnclosingElement() + "'s SOAPBinding.");
            else {
                soapBinding = new MySoapBinding();
            }
        }
    }
    boolean newBinding = false;
    if (soapBinding != null) {
        newBinding = pushSoapBinding(soapBinding, method, typeElement);
    }
    try {
        if (shouldProcessMethod(method, webMethod)) {
            processMethod(method, webMethod);
        }
    } finally {
        if (newBinding) {
            popSoapBinding();
        }
    }
    return null;
}
 
Example #23
Source File: JUDDIApiPortType.java    From juddi with Apache License 2.0 5 votes vote down vote up
/**
 * 
 * @param body
 * @throws DispositionReportFaultMessage
 */
@WebMethod(operationName = "adminDelete_tModel", action = "adminDelete_tmodel")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public void adminDeleteTModel(
    @WebParam(name = "adminDelete_tmodel", targetNamespace = "urn:juddi-apache-org:api_v3", partName = "body")
    DeleteTModel body)
    throws DispositionReportFaultMessage, RemoteException
;
 
Example #24
Source File: WebServiceVisitor.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected void preProcessWebService(WebService webService, TypeElement element) {
    processedMethods = new HashSet<String>();
    seiContext = context.getSeiContext(element);
    String targetNamespace = null;
    if (webService != null)
        targetNamespace = webService.targetNamespace();
    PackageElement packageElement = builder.getProcessingEnvironment().getElementUtils().getPackageOf(element);
    if (targetNamespace == null || targetNamespace.length() == 0) {
        String packageName = packageElement.getQualifiedName().toString();
        if (packageName == null || packageName.length() == 0) {
            builder.processError(WebserviceapMessages.WEBSERVICEAP_NO_PACKAGE_CLASS_MUST_HAVE_TARGETNAMESPACE(
                    element.getQualifiedName()), element);
        }
        targetNamespace = RuntimeModeler.getNamespace(packageName);
    }
    seiContext.setNamespaceUri(targetNamespace);
    if (serviceImplName == null)
        serviceImplName = seiContext.getSeiImplName();
    if (serviceImplName != null) {
        seiContext.setSeiImplName(serviceImplName);
        context.addSeiContext(serviceImplName, seiContext);
    }
    portName = ClassNameInfo.getName(element.getSimpleName().toString().replace('$', '_'));
    packageName = packageElement.getQualifiedName();
    portName = webService != null && webService.name() != null && webService.name().length() > 0 ?
            webService.name() : portName;
    serviceName = ClassNameInfo.getName(element.getQualifiedName().toString()) + WebServiceConstants.SERVICE.getValue();
    serviceName = webService != null && webService.serviceName() != null && webService.serviceName().length() > 0 ?
            webService.serviceName() : serviceName;
    wsdlNamespace = seiContext.getNamespaceUri();
    typeNamespace = wsdlNamespace;

    SOAPBinding soapBinding = element.getAnnotation(SOAPBinding.class);
    if (soapBinding != null) {
        pushedSoapBinding = pushSoapBinding(soapBinding, element, element);
    } else if (element.equals(typeElement)) {
        pushedSoapBinding = pushSoapBinding(new MySoapBinding(), element, element);
    }
}
 
Example #25
Source File: EPCISServicePortType.java    From fosstrak-epcis with GNU Lesser General Public License v2.1 5 votes vote down vote up
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@WebResult(name = "GetQueryNamesResult", targetNamespace = "urn:epcglobal:epcis-query:xsd:1", partName = "getQueryNamesReturn")
@WebMethod
public org.fosstrak.epcis.model.ArrayOfString getQueryNames(
        @WebParam(partName = "parms", name = "GetQueryNames", targetNamespace = "urn:epcglobal:epcis-query:xsd:1")
        org.fosstrak.epcis.model.EmptyParms parms) throws ImplementationExceptionResponse, SecurityExceptionResponse,
        ValidationExceptionResponse;
 
Example #26
Source File: WebServiceVisitor.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected void preProcessWebService(WebService webService, TypeElement element) {
    processedMethods = new HashSet<String>();
    seiContext = context.getSeiContext(element);
    String targetNamespace = null;
    if (webService != null)
        targetNamespace = webService.targetNamespace();
    PackageElement packageElement = builder.getProcessingEnvironment().getElementUtils().getPackageOf(element);
    if (targetNamespace == null || targetNamespace.length() == 0) {
        String packageName = packageElement.getQualifiedName().toString();
        if (packageName == null || packageName.length() == 0) {
            builder.processError(WebserviceapMessages.WEBSERVICEAP_NO_PACKAGE_CLASS_MUST_HAVE_TARGETNAMESPACE(
                    element.getQualifiedName()), element);
        }
        targetNamespace = RuntimeModeler.getNamespace(packageName);
    }
    seiContext.setNamespaceUri(targetNamespace);
    if (serviceImplName == null)
        serviceImplName = seiContext.getSeiImplName();
    if (serviceImplName != null) {
        seiContext.setSeiImplName(serviceImplName);
        context.addSeiContext(serviceImplName, seiContext);
    }
    portName = ClassNameInfo.getName(element.getSimpleName().toString().replace('$', '_'));
    packageName = packageElement.getQualifiedName();
    portName = webService != null && webService.name() != null && webService.name().length() > 0 ?
            webService.name() : portName;
    serviceName = ClassNameInfo.getName(element.getQualifiedName().toString()) + WebServiceConstants.SERVICE.getValue();
    serviceName = webService != null && webService.serviceName() != null && webService.serviceName().length() > 0 ?
            webService.serviceName() : serviceName;
    wsdlNamespace = seiContext.getNamespaceUri();
    typeNamespace = wsdlNamespace;

    SOAPBinding soapBinding = element.getAnnotation(SOAPBinding.class);
    if (soapBinding != null) {
        pushedSoapBinding = pushSoapBinding(soapBinding, element, element);
    } else if (element.equals(typeElement)) {
        pushedSoapBinding = pushSoapBinding(new MySoapBinding(), element, element);
    }
}
 
Example #27
Source File: SeiGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void writeSOAPBinding(Port port, JDefinedClass cls) {
    JAnnotationUse soapBindingAnn = null;
    isDocStyle = port.getStyle() == null || port.getStyle().equals(SOAPStyle.DOCUMENT);
    if(!isDocStyle){
        soapBindingAnn = cls.annotate(SOAPBinding.class);
        soapBindingAnn.param("style", SOAPBinding.Style.RPC);
        port.setWrapped(true);
    }
    if(isDocStyle){
        boolean first = true;
        boolean isWrapper = true;
        for(Operation operation:port.getOperations()){
            if(first){
                isWrapper = operation.isWrapped();
                first = false;
                continue;
            }
            sameParamStyle = (isWrapper == operation.isWrapped());
            if (!sameParamStyle) {
                break;
            }
        }
        if (sameParamStyle) {
            port.setWrapped(isWrapper);
        }
    }
    if(sameParamStyle && !port.isWrapped()){
        if (soapBindingAnn == null) {
            soapBindingAnn = cls.annotate(SOAPBinding.class);
        }
        soapBindingAnn.param("parameterStyle", SOAPBinding.ParameterStyle.BARE);
    }
}
 
Example #28
Source File: RuntimeModeler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * creates a runtime model <code>SOAPBinding</code> from a <code>javax.jws.soap.SOAPBinding</code> object
 * @param soapBinding the <code>javax.jws.soap.SOAPBinding</code> to model
 * @return returns the runtime model SOAPBinding corresponding to <code>soapBinding</code>
 */
protected SOAPBindingImpl createBinding(SOAPBinding soapBinding) {
    SOAPBindingImpl rtSOAPBinding = new SOAPBindingImpl();
    Style style = soapBinding!=null ? soapBinding.style() : Style.DOCUMENT;
    rtSOAPBinding.setStyle(style);
    assert bindingId != null;
    model.bindingId = bindingId;
    SOAPVersion soapVersion = bindingId.getSOAPVersion();
    rtSOAPBinding.setSOAPVersion(soapVersion);
    return rtSOAPBinding;
}
 
Example #29
Source File: EPCISServicePortType.java    From fosstrak-epcis with GNU Lesser General Public License v2.1 5 votes vote down vote up
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
@WebResult(name = "QueryResults", targetNamespace = "urn:epcglobal:epcis-query:xsd:1", partName = "pollReturn")
@WebMethod
public org.fosstrak.epcis.model.QueryResults poll(
        @WebParam(partName = "parms", name = "Poll", targetNamespace = "urn:epcglobal:epcis-query:xsd:1")
        org.fosstrak.epcis.model.Poll parms) throws ImplementationExceptionResponse,
        QueryTooComplexExceptionResponse, QueryTooLargeExceptionResponse, SecurityExceptionResponse,
        ValidationExceptionResponse, NoSuchNameExceptionResponse, QueryParameterExceptionResponse;
 
Example #30
Source File: JAXWSDefinitionBuilder.java    From cxf with Apache License 2.0 5 votes vote down vote up
private boolean isRPCEncoded(Definition def) {
    Iterator<?> ite1 = def.getBindings().values().iterator();
    while (ite1.hasNext()) {
        Binding binding = (Binding)ite1.next();
        String bindingStyle = SOAPBindingUtil.getBindingStyle(binding);

        Iterator<?> ite2 = binding.getBindingOperations().iterator();
        while (ite2.hasNext()) {
            BindingOperation bop = (BindingOperation)ite2.next();
            String bopStyle = SOAPBindingUtil.getSOAPOperationStyle(bop);

            String outputUse = "";
            if (SOAPBindingUtil.getBindingOutputSOAPBody(bop) != null) {
                outputUse = SOAPBindingUtil.getBindingOutputSOAPBody(bop).getUse();
            }
            String inputUse = "";
            if (SOAPBindingUtil.getBindingInputSOAPBody(bop) != null) {
                inputUse = SOAPBindingUtil.getBindingInputSOAPBody(bop).getUse();
            }
            if ((SOAPBinding.Style.RPC.name().equalsIgnoreCase(bindingStyle) || SOAPBinding.Style.RPC
                .name().equalsIgnoreCase(bopStyle))
                && (SOAPBinding.Use.ENCODED.name().equalsIgnoreCase(inputUse) || SOAPBinding.Use.ENCODED
                    .name().equalsIgnoreCase(outputUse))) {
                return true;
            }
        }
    }
    return false;
}