Java Code Examples for com.sun.tools.internal.ws.processor.model.Operation#getResponse()

The following examples show how to use com.sun.tools.internal.ws.processor.model.Operation#getResponse() . 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: WSDLModeler.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private void createJavaMethodForAsyncOperation(Port port, Operation operation,
                                               JavaInterface intf) {
    String candidateName = getJavaNameForOperation(operation);
    JavaMethod method = new JavaMethod(candidateName, options, errReceiver);

    assert (operation.getRequest() != null);
    Response response = operation.getResponse();

    // build a signature of the form "opName%arg1type%arg2type%...%argntype so that we
    // detect overloading conflicts in the generated java interface/classes
    for (Iterator iter = operation.getRequest().getParameters(); iter.hasNext();) {
        Parameter parameter = (Parameter) iter.next();

        if (parameter.getJavaParameter() != null) {
            error(operation.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION(operation.getName().getLocalPart()));
        }

        JavaType parameterType = parameter.getType().getJavaType();
        JavaParameter javaParameter =
                new JavaParameter(
                            BindingHelper.mangleNameToVariableName(parameter.getName()),
                        parameterType,
                        parameter,
                        parameter.getLinkedParameter() != null);
        if (javaParameter.isHolder()) {
            javaParameter.setHolderName(javax.xml.ws.Holder.class.getName());
        }
        method.addParameter(javaParameter);
        parameter.setJavaParameter(javaParameter);

    }

    if (response != null) {
        String resultParameterName =
                (String) operation.getProperty(WSDL_RESULT_PARAMETER);
        Parameter resultParameter =
                response.getParameterByName(resultParameterName);
        JavaType returnType = resultParameter.getType().getJavaType();
        method.setReturnType(returnType);

    }
    operation.setJavaMethod(method);
    intf.addMethod(method);
}
 
Example 2
Source File: WSDLModeler.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private void createJavaMethodForAsyncOperation(Port port, Operation operation,
                                               JavaInterface intf) {
    String candidateName = getJavaNameForOperation(operation);
    JavaMethod method = new JavaMethod(candidateName, options, errReceiver);

    assert (operation.getRequest() != null);
    Response response = operation.getResponse();

    // build a signature of the form "opName%arg1type%arg2type%...%argntype so that we
    // detect overloading conflicts in the generated java interface/classes
    for (Iterator iter = operation.getRequest().getParameters(); iter.hasNext();) {
        Parameter parameter = (Parameter) iter.next();

        if (parameter.getJavaParameter() != null) {
            error(operation.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION(operation.getName().getLocalPart()));
        }

        JavaType parameterType = parameter.getType().getJavaType();
        JavaParameter javaParameter =
                new JavaParameter(
                            BindingHelper.mangleNameToVariableName(parameter.getName()),
                        parameterType,
                        parameter,
                        parameter.getLinkedParameter() != null);
        if (javaParameter.isHolder()) {
            javaParameter.setHolderName(javax.xml.ws.Holder.class.getName());
        }
        method.addParameter(javaParameter);
        parameter.setJavaParameter(javaParameter);

    }

    if (response != null) {
        String resultParameterName =
                (String) operation.getProperty(WSDL_RESULT_PARAMETER);
        Parameter resultParameter =
                response.getParameterByName(resultParameterName);
        JavaType returnType = resultParameter.getType().getJavaType();
        method.setReturnType(returnType);

    }
    operation.setJavaMethod(method);
    intf.addMethod(method);
}
 
Example 3
Source File: WSDLModeler.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private void createJavaMethodForAsyncOperation(Port port, Operation operation,
                                               JavaInterface intf) {
    String candidateName = getJavaNameForOperation(operation);
    JavaMethod method = new JavaMethod(candidateName, options, errReceiver);

    assert (operation.getRequest() != null);
    Response response = operation.getResponse();

    // build a signature of the form "opName%arg1type%arg2type%...%argntype so that we
    // detect overloading conflicts in the generated java interface/classes
    for (Iterator iter = operation.getRequest().getParameters(); iter.hasNext();) {
        Parameter parameter = (Parameter) iter.next();

        if (parameter.getJavaParameter() != null) {
            error(operation.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION(operation.getName().getLocalPart()));
        }

        JavaType parameterType = parameter.getType().getJavaType();
        JavaParameter javaParameter =
                new JavaParameter(
                            BindingHelper.mangleNameToVariableName(parameter.getName()),
                        parameterType,
                        parameter,
                        parameter.getLinkedParameter() != null);
        if (javaParameter.isHolder()) {
            javaParameter.setHolderName(javax.xml.ws.Holder.class.getName());
        }
        method.addParameter(javaParameter);
        parameter.setJavaParameter(javaParameter);

    }

    if (response != null) {
        String resultParameterName =
                (String) operation.getProperty(WSDL_RESULT_PARAMETER);
        Parameter resultParameter =
                response.getParameterByName(resultParameterName);
        JavaType returnType = resultParameter.getType().getJavaType();
        method.setReturnType(returnType);

    }
    operation.setJavaMethod(method);
    intf.addMethod(method);
}
 
Example 4
Source File: WSDLModeler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private void createJavaMethodForAsyncOperation(Port port, Operation operation,
                                               JavaInterface intf) {
    String candidateName = getJavaNameForOperation(operation);
    JavaMethod method = new JavaMethod(candidateName, options, errReceiver);

    assert (operation.getRequest() != null);
    Response response = operation.getResponse();

    // build a signature of the form "opName%arg1type%arg2type%...%argntype so that we
    // detect overloading conflicts in the generated java interface/classes
    for (Iterator iter = operation.getRequest().getParameters(); iter.hasNext();) {
        Parameter parameter = (Parameter) iter.next();

        if (parameter.getJavaParameter() != null) {
            error(operation.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION(operation.getName().getLocalPart()));
        }

        JavaType parameterType = parameter.getType().getJavaType();
        JavaParameter javaParameter =
                new JavaParameter(
                            BindingHelper.mangleNameToVariableName(parameter.getName()),
                        parameterType,
                        parameter,
                        parameter.getLinkedParameter() != null);
        if (javaParameter.isHolder()) {
            javaParameter.setHolderName(javax.xml.ws.Holder.class.getName());
        }
        method.addParameter(javaParameter);
        parameter.setJavaParameter(javaParameter);

    }

    if (response != null) {
        String resultParameterName =
                (String) operation.getProperty(WSDL_RESULT_PARAMETER);
        Parameter resultParameter =
                response.getParameterByName(resultParameterName);
        JavaType returnType = resultParameter.getType().getJavaType();
        method.setReturnType(returnType);

    }
    operation.setJavaMethod(method);
    intf.addMethod(method);
}
 
Example 5
Source File: WSDLModeler.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
private void createJavaMethodForAsyncOperation(Port port, Operation operation,
                                               JavaInterface intf) {
    String candidateName = getJavaNameForOperation(operation);
    JavaMethod method = new JavaMethod(candidateName, options, errReceiver);

    assert (operation.getRequest() != null);
    Response response = operation.getResponse();

    // build a signature of the form "opName%arg1type%arg2type%...%argntype so that we
    // detect overloading conflicts in the generated java interface/classes
    for (Iterator iter = operation.getRequest().getParameters(); iter.hasNext();) {
        Parameter parameter = (Parameter) iter.next();

        if (parameter.getJavaParameter() != null) {
            error(operation.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION(operation.getName().getLocalPart()));
        }

        JavaType parameterType = parameter.getType().getJavaType();
        JavaParameter javaParameter =
                new JavaParameter(
                            BindingHelper.mangleNameToVariableName(parameter.getName()),
                        parameterType,
                        parameter,
                        parameter.getLinkedParameter() != null);
        if (javaParameter.isHolder()) {
            javaParameter.setHolderName(javax.xml.ws.Holder.class.getName());
        }
        method.addParameter(javaParameter);
        parameter.setJavaParameter(javaParameter);

    }

    if (response != null) {
        String resultParameterName =
                (String) operation.getProperty(WSDL_RESULT_PARAMETER);
        Parameter resultParameter =
                response.getParameterByName(resultParameterName);
        JavaType returnType = resultParameter.getType().getJavaType();
        method.setReturnType(returnType);

    }
    operation.setJavaMethod(method);
    intf.addMethod(method);
}
 
Example 6
Source File: WSDLModeler.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private void createJavaMethodForAsyncOperation(Port port, Operation operation,
                                               JavaInterface intf) {
    String candidateName = getJavaNameForOperation(operation);
    JavaMethod method = new JavaMethod(candidateName, options, errReceiver);

    assert (operation.getRequest() != null);
    Response response = operation.getResponse();

    // build a signature of the form "opName%arg1type%arg2type%...%argntype so that we
    // detect overloading conflicts in the generated java interface/classes
    for (Iterator iter = operation.getRequest().getParameters(); iter.hasNext();) {
        Parameter parameter = (Parameter) iter.next();

        if (parameter.getJavaParameter() != null) {
            error(operation.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION(operation.getName().getLocalPart()));
        }

        JavaType parameterType = parameter.getType().getJavaType();
        JavaParameter javaParameter =
                new JavaParameter(
                            BindingHelper.mangleNameToVariableName(parameter.getName()),
                        parameterType,
                        parameter,
                        parameter.getLinkedParameter() != null);
        if (javaParameter.isHolder()) {
            javaParameter.setHolderName(javax.xml.ws.Holder.class.getName());
        }
        method.addParameter(javaParameter);
        parameter.setJavaParameter(javaParameter);

    }

    if (response != null) {
        String resultParameterName =
                (String) operation.getProperty(WSDL_RESULT_PARAMETER);
        Parameter resultParameter =
                response.getParameterByName(resultParameterName);
        JavaType returnType = resultParameter.getType().getJavaType();
        method.setReturnType(returnType);

    }
    operation.setJavaMethod(method);
    intf.addMethod(method);
}
 
Example 7
Source File: WSDLModeler.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private void createJavaMethodForAsyncOperation(Port port, Operation operation,
                                               JavaInterface intf) {
    String candidateName = getJavaNameForOperation(operation);
    JavaMethod method = new JavaMethod(candidateName, options, errReceiver);

    assert (operation.getRequest() != null);
    Response response = operation.getResponse();

    // build a signature of the form "opName%arg1type%arg2type%...%argntype so that we
    // detect overloading conflicts in the generated java interface/classes
    for (Iterator iter = operation.getRequest().getParameters(); iter.hasNext();) {
        Parameter parameter = (Parameter) iter.next();

        if (parameter.getJavaParameter() != null) {
            error(operation.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION(operation.getName().getLocalPart()));
        }

        JavaType parameterType = parameter.getType().getJavaType();
        JavaParameter javaParameter =
                new JavaParameter(
                            BindingHelper.mangleNameToVariableName(parameter.getName()),
                        parameterType,
                        parameter,
                        parameter.getLinkedParameter() != null);
        if (javaParameter.isHolder()) {
            javaParameter.setHolderName(javax.xml.ws.Holder.class.getName());
        }
        method.addParameter(javaParameter);
        parameter.setJavaParameter(javaParameter);

    }

    if (response != null) {
        String resultParameterName =
                (String) operation.getProperty(WSDL_RESULT_PARAMETER);
        Parameter resultParameter =
                response.getParameterByName(resultParameterName);
        JavaType returnType = resultParameter.getType().getJavaType();
        method.setReturnType(returnType);

    }
    operation.setJavaMethod(method);
    intf.addMethod(method);
}
 
Example 8
Source File: WSDLModeler.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
private void createJavaMethodForAsyncOperation(Port port, Operation operation,
                                               JavaInterface intf) {
    String candidateName = getJavaNameForOperation(operation);
    JavaMethod method = new JavaMethod(candidateName, options, errReceiver);

    assert (operation.getRequest() != null);
    Response response = operation.getResponse();

    // build a signature of the form "opName%arg1type%arg2type%...%argntype so that we
    // detect overloading conflicts in the generated java interface/classes
    for (Iterator iter = operation.getRequest().getParameters(); iter.hasNext();) {
        Parameter parameter = (Parameter) iter.next();

        if (parameter.getJavaParameter() != null) {
            error(operation.getEntity(), ModelerMessages.WSDLMODELER_INVALID_OPERATION(operation.getName().getLocalPart()));
        }

        JavaType parameterType = parameter.getType().getJavaType();
        JavaParameter javaParameter =
                new JavaParameter(
                            BindingHelper.mangleNameToVariableName(parameter.getName()),
                        parameterType,
                        parameter,
                        parameter.getLinkedParameter() != null);
        if (javaParameter.isHolder()) {
            javaParameter.setHolderName(javax.xml.ws.Holder.class.getName());
        }
        method.addParameter(javaParameter);
        parameter.setJavaParameter(javaParameter);

    }

    if (response != null) {
        String resultParameterName =
                (String) operation.getProperty(WSDL_RESULT_PARAMETER);
        Parameter resultParameter =
                response.getParameterByName(resultParameterName);
        JavaType returnType = resultParameter.getType().getJavaType();
        method.setReturnType(returnType);

    }
    operation.setJavaMethod(method);
    intf.addMethod(method);
}