Java Code Examples for com.sun.xml.internal.ws.model.ParameterImpl#isWrapperStyle()

The following examples show how to use com.sun.xml.internal.ws.model.ParameterImpl#isWrapperStyle() . 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: WSDLGenerator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Determines if the <CODE>method</CODE> is wrapper style
 * @param method The {@link JavaMethod} to check if it is wrapper style
 * @return true if the method is wrapper style, otherwise, false.
 */
protected boolean isWrapperStyle(JavaMethodImpl method) {
    if (method.getRequestParameters().size() > 0) {
        ParameterImpl param = method.getRequestParameters().iterator().next();
        return param.isWrapperStyle();
    }
    return false;
}
 
Example 2
Source File: WSDLGenerator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Determines if the <CODE>method</CODE> is wrapper style
 * @param method The {@link JavaMethod} to check if it is wrapper style
 * @return true if the method is wrapper style, otherwise, false.
 */
protected boolean isWrapperStyle(JavaMethodImpl method) {
    if (method.getRequestParameters().size() > 0) {
        ParameterImpl param = method.getRequestParameters().iterator().next();
        return param.isWrapperStyle();
    }
    return false;
}
 
Example 3
Source File: WSDLGenerator.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Determines if the <CODE>method</CODE> is wrapper style
 * @param method The {@link JavaMethod} to check if it is wrapper style
 * @return true if the method is wrapper style, otherwise, false.
 */
protected boolean isWrapperStyle(JavaMethodImpl method) {
    if (method.getRequestParameters().size() > 0) {
        ParameterImpl param = method.getRequestParameters().iterator().next();
        return param.isWrapperStyle();
    }
    return false;
}
 
Example 4
Source File: WSDLGenerator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Determines if the <CODE>method</CODE> is wrapper style
 * @param method The {@link JavaMethod} to check if it is wrapper style
 * @return true if the method is wrapper style, otherwise, false.
 */
protected boolean isWrapperStyle(JavaMethodImpl method) {
    if (method.getRequestParameters().size() > 0) {
        ParameterImpl param = method.getRequestParameters().iterator().next();
        return param.isWrapperStyle();
    }
    return false;
}
 
Example 5
Source File: WSDLGenerator.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Determines if the <CODE>method</CODE> is wrapper style
 * @param method The {@link JavaMethod} to check if it is wrapper style
 * @return true if the method is wrapper style, otherwise, false.
 */
protected boolean isWrapperStyle(JavaMethodImpl method) {
    if (method.getRequestParameters().size() > 0) {
        ParameterImpl param = method.getRequestParameters().iterator().next();
        return param.isWrapperStyle();
    }
    return false;
}
 
Example 6
Source File: SEIMethodHandler.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
ResponseBuilder buildResponseBuilder(JavaMethodImpl method, ValueSetterFactory setterFactory) {
    // prepare objects for processing response
    List<ParameterImpl> rp = method.getResponseParameters();
    List<ResponseBuilder> builders = new ArrayList<ResponseBuilder>();

    for( ParameterImpl param : rp ) {
        ValueSetter setter;
        switch(param.getOutBinding().kind) {
        case BODY:
            if(param.isWrapperStyle()) {
                if(param.getParent().getBinding().isRpcLit())
                    builders.add(new ResponseBuilder.RpcLit((WrapperParameter)param, setterFactory));
                else
                    builders.add(new ResponseBuilder.DocLit((WrapperParameter)param, setterFactory));
            } else {
                setter = setterFactory.get(param);
                builders.add(new ResponseBuilder.Body(param.getXMLBridge(),setter));
            }
            break;
        case HEADER:
            setter = setterFactory.get(param);
            builders.add(new ResponseBuilder.Header(owner.soapVersion, param, setter));
            break;
        case ATTACHMENT:
            setter = setterFactory.get(param);
            builders.add(ResponseBuilder.AttachmentBuilder.createAttachmentBuilder(param, setter));
            break;
        case UNBOUND:
            setter = setterFactory.get(param);
            builders.add(new ResponseBuilder.NullSetter(setter,
                ResponseBuilder.getVMUninitializedValue(param.getTypeInfo().type)));
            break;
        default:
            throw new AssertionError();
        }
    }
    ResponseBuilder rb;
    switch(builders.size()) {
    case 0:
        rb = ResponseBuilder.NONE;
        break;
    case 1:
        rb = builders.get(0);
        break;
    default:
        rb = new ResponseBuilder.Composite(builders);
    }
    return rb;
}
 
Example 7
Source File: StubHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public StubHandler(JavaMethodImpl method, MessageContextFactory mcf) {
    //keep all the CheckedException model for the detail qname
    this.checkedExceptions = new HashMap<QName, CheckedExceptionImpl>();
    for(CheckedExceptionImpl ce : method.getCheckedExceptions()){
        checkedExceptions.put(ce.getBond().getTypeInfo().tagName, ce);
    }
    //If a non-"" soapAction is specified, wsa:action the SOAPAction
    String soapActionFromBinding = method.getBinding().getSOAPAction();
    if(method.getInputAction() != null && soapActionFromBinding != null && !soapActionFromBinding.equals("") ) {
        this.soapAction = method.getInputAction();
    } else {
        this.soapAction = soapActionFromBinding;
    }
    this.javaMethod = method;
    packetFactory = mcf;

    soapVersion = javaMethod.getBinding().getSOAPVersion();

    {// prepare objects for creating messages
        List<ParameterImpl> rp = method.getRequestParameters();

        BodyBuilder bodyBuilder = null;
        List<MessageFiller> fillers = new ArrayList<MessageFiller>();

        for (ParameterImpl param : rp) {
            ValueGetter getter = getValueGetterFactory().get(param);

            switch(param.getInBinding().kind) {
            case BODY:
                if(param.isWrapperStyle()) {
                    if(param.getParent().getBinding().isRpcLit())
                        bodyBuilder = new BodyBuilder.RpcLit((WrapperParameter)param, soapVersion, getValueGetterFactory());
                    else
                        bodyBuilder = new BodyBuilder.DocLit((WrapperParameter)param, soapVersion, getValueGetterFactory());
                } else {
                    bodyBuilder = new BodyBuilder.Bare(param, soapVersion, getter);
                }
                break;
            case HEADER:
                fillers.add(new MessageFiller.Header(
                    param.getIndex(),
                    param.getXMLBridge(),
                    getter ));
                break;
            case ATTACHMENT:
                fillers.add(MessageFiller.AttachmentFiller.createAttachmentFiller(param, getter));
                break;
            case UNBOUND:
                break;
            default:
                throw new AssertionError(); // impossible
            }
        }

        if(bodyBuilder==null) {
            // no parameter binds to body. we create an empty message
            switch(soapVersion) {
            case SOAP_11:
                bodyBuilder = BodyBuilder.EMPTY_SOAP11;
                break;
            case SOAP_12:
                bodyBuilder = BodyBuilder.EMPTY_SOAP12;
                break;
            default:
                throw new AssertionError();
            }
        }

        this.bodyBuilder = bodyBuilder;
        this.inFillers = fillers.toArray(new MessageFiller[fillers.size()]);
    }

    this.isOneWay = method.getMEP().isOneWay();
    responseBuilder = buildResponseBuilder(method, ValueSetterFactory.SYNC);
}
 
Example 8
Source File: StubHandler.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public StubHandler(JavaMethodImpl method, MessageContextFactory mcf) {
    //keep all the CheckedException model for the detail qname
    this.checkedExceptions = new HashMap<QName, CheckedExceptionImpl>();
    for(CheckedExceptionImpl ce : method.getCheckedExceptions()){
        checkedExceptions.put(ce.getBond().getTypeInfo().tagName, ce);
    }
    //If a non-"" soapAction is specified, wsa:action the SOAPAction
    String soapActionFromBinding = method.getBinding().getSOAPAction();
    if(method.getInputAction() != null && soapActionFromBinding != null && !soapActionFromBinding.equals("") ) {
        this.soapAction = method.getInputAction();
    } else {
        this.soapAction = soapActionFromBinding;
    }
    this.javaMethod = method;
    packetFactory = mcf;

    soapVersion = javaMethod.getBinding().getSOAPVersion();

    {// prepare objects for creating messages
        List<ParameterImpl> rp = method.getRequestParameters();

        BodyBuilder bodyBuilder = null;
        List<MessageFiller> fillers = new ArrayList<MessageFiller>();

        for (ParameterImpl param : rp) {
            ValueGetter getter = getValueGetterFactory().get(param);

            switch(param.getInBinding().kind) {
            case BODY:
                if(param.isWrapperStyle()) {
                    if(param.getParent().getBinding().isRpcLit())
                        bodyBuilder = new BodyBuilder.RpcLit((WrapperParameter)param, soapVersion, getValueGetterFactory());
                    else
                        bodyBuilder = new BodyBuilder.DocLit((WrapperParameter)param, soapVersion, getValueGetterFactory());
                } else {
                    bodyBuilder = new BodyBuilder.Bare(param, soapVersion, getter);
                }
                break;
            case HEADER:
                fillers.add(new MessageFiller.Header(
                    param.getIndex(),
                    param.getXMLBridge(),
                    getter ));
                break;
            case ATTACHMENT:
                fillers.add(MessageFiller.AttachmentFiller.createAttachmentFiller(param, getter));
                break;
            case UNBOUND:
                break;
            default:
                throw new AssertionError(); // impossible
            }
        }

        if(bodyBuilder==null) {
            // no parameter binds to body. we create an empty message
            switch(soapVersion) {
            case SOAP_11:
                bodyBuilder = BodyBuilder.EMPTY_SOAP11;
                break;
            case SOAP_12:
                bodyBuilder = BodyBuilder.EMPTY_SOAP12;
                break;
            default:
                throw new AssertionError();
            }
        }

        this.bodyBuilder = bodyBuilder;
        this.inFillers = fillers.toArray(new MessageFiller[fillers.size()]);
    }

    this.isOneWay = method.getMEP().isOneWay();
    responseBuilder = buildResponseBuilder(method, ValueSetterFactory.SYNC);
}
 
Example 9
Source File: SEIMethodHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
SEIMethodHandler(SEIStub owner, JavaMethodImpl method) {
    super(owner, null);

    //keep all the CheckedException model for the detail qname
    this.checkedExceptions = new HashMap<QName, CheckedExceptionImpl>();
    for(CheckedExceptionImpl ce : method.getCheckedExceptions()){
        checkedExceptions.put(ce.getBond().getTypeInfo().tagName, ce);
    }
    //If a non-"" soapAction is specified, wsa:action the SOAPAction
    if(method.getInputAction() != null && !method.getBinding().getSOAPAction().equals("") ) {
        this.soapAction = method.getInputAction();
    } else {
        this.soapAction = method.getBinding().getSOAPAction();
    }
    this.javaMethod = method;

    {// prepare objects for creating messages
        List<ParameterImpl> rp = method.getRequestParameters();

        BodyBuilder tmpBodyBuilder = null;
        List<MessageFiller> fillers = new ArrayList<MessageFiller>();

        for (ParameterImpl param : rp) {
            ValueGetter getter = getValueGetterFactory().get(param);

            switch(param.getInBinding().kind) {
            case BODY:
                if(param.isWrapperStyle()) {
                    if(param.getParent().getBinding().isRpcLit())
                        tmpBodyBuilder = new BodyBuilder.RpcLit((WrapperParameter)param, owner.soapVersion, getValueGetterFactory());
                    else
                        tmpBodyBuilder = new BodyBuilder.DocLit((WrapperParameter)param, owner.soapVersion, getValueGetterFactory());
                } else {
                    tmpBodyBuilder = new BodyBuilder.Bare(param, owner.soapVersion, getter);
                }
                break;
            case HEADER:
                fillers.add(new MessageFiller.Header(
                    param.getIndex(),
                    param.getXMLBridge(),
                    getter ));
                break;
            case ATTACHMENT:
                fillers.add(MessageFiller.AttachmentFiller.createAttachmentFiller(param, getter));
                break;
            case UNBOUND:
                break;
            default:
                throw new AssertionError(); // impossible
            }
        }

        if(tmpBodyBuilder==null) {
            // no parameter binds to body. we create an empty message
            switch(owner.soapVersion) {
            case SOAP_11:
                tmpBodyBuilder = BodyBuilder.EMPTY_SOAP11;
                break;
            case SOAP_12:
                tmpBodyBuilder = BodyBuilder.EMPTY_SOAP12;
                break;
            default:
                throw new AssertionError();
            }
        }

        this.bodyBuilder = tmpBodyBuilder;
        this.inFillers = fillers.toArray(new MessageFiller[fillers.size()]);
    }

    this.isOneWay = method.getMEP().isOneWay();
}
 
Example 10
Source File: StubHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
ResponseBuilder buildResponseBuilder(JavaMethodImpl method, ValueSetterFactory setterFactory) {
    // prepare objects for processing response
    List<ParameterImpl> rp = method.getResponseParameters();
    List<ResponseBuilder> builders = new ArrayList<ResponseBuilder>();

    for( ParameterImpl param : rp ) {
        ValueSetter setter;
        switch(param.getOutBinding().kind) {
        case BODY:
            if(param.isWrapperStyle()) {
                if(param.getParent().getBinding().isRpcLit())
                    builders.add(new ResponseBuilder.RpcLit((WrapperParameter)param, setterFactory));
                else
                    builders.add(new ResponseBuilder.DocLit((WrapperParameter)param, setterFactory));
            } else {
                setter = setterFactory.get(param);
                builders.add(new ResponseBuilder.Body(param.getXMLBridge(),setter));
            }
            break;
        case HEADER:
            setter = setterFactory.get(param);
            builders.add(new ResponseBuilder.Header(soapVersion, param, setter));
            break;
        case ATTACHMENT:
            setter = setterFactory.get(param);
            builders.add(ResponseBuilder.AttachmentBuilder.createAttachmentBuilder(param, setter));
            break;
        case UNBOUND:
            setter = setterFactory.get(param);
            builders.add(new ResponseBuilder.NullSetter(setter,
                ResponseBuilder.getVMUninitializedValue(param.getTypeInfo().type)));
            break;
        default:
            throw new AssertionError();
        }
    }
    ResponseBuilder rb;
    switch(builders.size()) {
    case 0:
        rb = ResponseBuilder.NONE;
        break;
    case 1:
        rb = builders.get(0);
        break;
    default:
        rb = new ResponseBuilder.Composite(builders);
    }
    return rb;
}
 
Example 11
Source File: SEIMethodHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
SEIMethodHandler(SEIStub owner, JavaMethodImpl method) {
    super(owner, null);

    //keep all the CheckedException model for the detail qname
    this.checkedExceptions = new HashMap<QName, CheckedExceptionImpl>();
    for(CheckedExceptionImpl ce : method.getCheckedExceptions()){
        checkedExceptions.put(ce.getBond().getTypeInfo().tagName, ce);
    }
    //If a non-"" soapAction is specified, wsa:action the SOAPAction
    if(method.getInputAction() != null && !method.getBinding().getSOAPAction().equals("") ) {
        this.soapAction = method.getInputAction();
    } else {
        this.soapAction = method.getBinding().getSOAPAction();
    }
    this.javaMethod = method;

    {// prepare objects for creating messages
        List<ParameterImpl> rp = method.getRequestParameters();

        BodyBuilder tmpBodyBuilder = null;
        List<MessageFiller> fillers = new ArrayList<MessageFiller>();

        for (ParameterImpl param : rp) {
            ValueGetter getter = getValueGetterFactory().get(param);

            switch(param.getInBinding().kind) {
            case BODY:
                if(param.isWrapperStyle()) {
                    if(param.getParent().getBinding().isRpcLit())
                        tmpBodyBuilder = new BodyBuilder.RpcLit((WrapperParameter)param, owner.soapVersion, getValueGetterFactory());
                    else
                        tmpBodyBuilder = new BodyBuilder.DocLit((WrapperParameter)param, owner.soapVersion, getValueGetterFactory());
                } else {
                    tmpBodyBuilder = new BodyBuilder.Bare(param, owner.soapVersion, getter);
                }
                break;
            case HEADER:
                fillers.add(new MessageFiller.Header(
                    param.getIndex(),
                    param.getXMLBridge(),
                    getter ));
                break;
            case ATTACHMENT:
                fillers.add(MessageFiller.AttachmentFiller.createAttachmentFiller(param, getter));
                break;
            case UNBOUND:
                break;
            default:
                throw new AssertionError(); // impossible
            }
        }

        if(tmpBodyBuilder==null) {
            // no parameter binds to body. we create an empty message
            switch(owner.soapVersion) {
            case SOAP_11:
                tmpBodyBuilder = BodyBuilder.EMPTY_SOAP11;
                break;
            case SOAP_12:
                tmpBodyBuilder = BodyBuilder.EMPTY_SOAP12;
                break;
            default:
                throw new AssertionError();
            }
        }

        this.bodyBuilder = tmpBodyBuilder;
        this.inFillers = fillers.toArray(new MessageFiller[fillers.size()]);
    }

    this.isOneWay = method.getMEP().isOneWay();
}
 
Example 12
Source File: SEIMethodHandler.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
SEIMethodHandler(SEIStub owner, JavaMethodImpl method) {
    super(owner, null);

    //keep all the CheckedException model for the detail qname
    this.checkedExceptions = new HashMap<QName, CheckedExceptionImpl>();
    for(CheckedExceptionImpl ce : method.getCheckedExceptions()){
        checkedExceptions.put(ce.getBond().getTypeInfo().tagName, ce);
    }
    //If a non-"" soapAction is specified, wsa:action the SOAPAction
    if(method.getInputAction() != null && !method.getBinding().getSOAPAction().equals("") ) {
        this.soapAction = method.getInputAction();
    } else {
        this.soapAction = method.getBinding().getSOAPAction();
    }
    this.javaMethod = method;

    {// prepare objects for creating messages
        List<ParameterImpl> rp = method.getRequestParameters();

        BodyBuilder tmpBodyBuilder = null;
        List<MessageFiller> fillers = new ArrayList<MessageFiller>();

        for (ParameterImpl param : rp) {
            ValueGetter getter = getValueGetterFactory().get(param);

            switch(param.getInBinding().kind) {
            case BODY:
                if(param.isWrapperStyle()) {
                    if(param.getParent().getBinding().isRpcLit())
                        tmpBodyBuilder = new BodyBuilder.RpcLit((WrapperParameter)param, owner.soapVersion, getValueGetterFactory());
                    else
                        tmpBodyBuilder = new BodyBuilder.DocLit((WrapperParameter)param, owner.soapVersion, getValueGetterFactory());
                } else {
                    tmpBodyBuilder = new BodyBuilder.Bare(param, owner.soapVersion, getter);
                }
                break;
            case HEADER:
                fillers.add(new MessageFiller.Header(
                    param.getIndex(),
                    param.getXMLBridge(),
                    getter ));
                break;
            case ATTACHMENT:
                fillers.add(MessageFiller.AttachmentFiller.createAttachmentFiller(param, getter));
                break;
            case UNBOUND:
                break;
            default:
                throw new AssertionError(); // impossible
            }
        }

        if(tmpBodyBuilder==null) {
            // no parameter binds to body. we create an empty message
            switch(owner.soapVersion) {
            case SOAP_11:
                tmpBodyBuilder = BodyBuilder.EMPTY_SOAP11;
                break;
            case SOAP_12:
                tmpBodyBuilder = BodyBuilder.EMPTY_SOAP12;
                break;
            default:
                throw new AssertionError();
            }
        }

        this.bodyBuilder = tmpBodyBuilder;
        this.inFillers = fillers.toArray(new MessageFiller[fillers.size()]);
    }

    this.isOneWay = method.getMEP().isOneWay();
}
 
Example 13
Source File: SEIMethodHandler.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
ResponseBuilder buildResponseBuilder(JavaMethodImpl method, ValueSetterFactory setterFactory) {
    // prepare objects for processing response
    List<ParameterImpl> rp = method.getResponseParameters();
    List<ResponseBuilder> builders = new ArrayList<ResponseBuilder>();

    for( ParameterImpl param : rp ) {
        ValueSetter setter;
        switch(param.getOutBinding().kind) {
        case BODY:
            if(param.isWrapperStyle()) {
                if(param.getParent().getBinding().isRpcLit())
                    builders.add(new ResponseBuilder.RpcLit((WrapperParameter)param, setterFactory));
                else
                    builders.add(new ResponseBuilder.DocLit((WrapperParameter)param, setterFactory));
            } else {
                setter = setterFactory.get(param);
                builders.add(new ResponseBuilder.Body(param.getXMLBridge(),setter));
            }
            break;
        case HEADER:
            setter = setterFactory.get(param);
            builders.add(new ResponseBuilder.Header(owner.soapVersion, param, setter));
            break;
        case ATTACHMENT:
            setter = setterFactory.get(param);
            builders.add(ResponseBuilder.AttachmentBuilder.createAttachmentBuilder(param, setter));
            break;
        case UNBOUND:
            setter = setterFactory.get(param);
            builders.add(new ResponseBuilder.NullSetter(setter,
                ResponseBuilder.getVMUninitializedValue(param.getTypeInfo().type)));
            break;
        default:
            throw new AssertionError();
        }
    }
    ResponseBuilder rb;
    switch(builders.size()) {
    case 0:
        rb = ResponseBuilder.NONE;
        break;
    case 1:
        rb = builders.get(0);
        break;
    default:
        rb = new ResponseBuilder.Composite(builders);
    }
    return rb;
}
 
Example 14
Source File: TieHandler.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
/**
* prepare objects for creating response {@link Message}
*/
private EndpointResponseMessageBuilder createResponseMessageBuilder(List<MessageFiller> fillers) {

    EndpointResponseMessageBuilder tmpBodyBuilder = null;
    List<ParameterImpl> rp = javaMethodModel.getResponseParameters();

    for (ParameterImpl param : rp) {
        ValueGetter getter = ValueGetter.get(param);

        switch(param.getOutBinding().kind) {
        case BODY:
            if(param.isWrapperStyle()) {
                if(param.getParent().getBinding().isRpcLit()) {
                    tmpBodyBuilder = new EndpointResponseMessageBuilder.RpcLit((WrapperParameter)param,
                        soapVersion);
                } else {
                    tmpBodyBuilder = new EndpointResponseMessageBuilder.DocLit((WrapperParameter)param,
                        soapVersion);
                }
            } else {
                tmpBodyBuilder = new EndpointResponseMessageBuilder.Bare(param, soapVersion);
            }
            break;
        case HEADER:
            fillers.add(new MessageFiller.Header(param.getIndex(), param.getXMLBridge(), getter ));
            break;
        case ATTACHMENT:
            fillers.add(MessageFiller.AttachmentFiller.createAttachmentFiller(param, getter));
            break;
        case UNBOUND:
            break;
        default:
            throw new AssertionError(); // impossible
        }
    }

    if (tmpBodyBuilder == null) {
        // no parameter binds to body. we create an empty message
        switch(soapVersion) {
        case SOAP_11:
            tmpBodyBuilder = EndpointResponseMessageBuilder.EMPTY_SOAP11;
            break;
        case SOAP_12:
            tmpBodyBuilder = EndpointResponseMessageBuilder.EMPTY_SOAP12;
            break;
        default:
            throw new AssertionError();
        }
    }
    return tmpBodyBuilder;
}
 
Example 15
Source File: SEIMethodHandler.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
SEIMethodHandler(SEIStub owner, JavaMethodImpl method) {
    super(owner, null);

    //keep all the CheckedException model for the detail qname
    this.checkedExceptions = new HashMap<QName, CheckedExceptionImpl>();
    for(CheckedExceptionImpl ce : method.getCheckedExceptions()){
        checkedExceptions.put(ce.getBond().getTypeInfo().tagName, ce);
    }
    //If a non-"" soapAction is specified, wsa:action the SOAPAction
    if(method.getInputAction() != null && !method.getBinding().getSOAPAction().equals("") ) {
        this.soapAction = method.getInputAction();
    } else {
        this.soapAction = method.getBinding().getSOAPAction();
    }
    this.javaMethod = method;

    {// prepare objects for creating messages
        List<ParameterImpl> rp = method.getRequestParameters();

        BodyBuilder tmpBodyBuilder = null;
        List<MessageFiller> fillers = new ArrayList<MessageFiller>();

        for (ParameterImpl param : rp) {
            ValueGetter getter = getValueGetterFactory().get(param);

            switch(param.getInBinding().kind) {
            case BODY:
                if(param.isWrapperStyle()) {
                    if(param.getParent().getBinding().isRpcLit())
                        tmpBodyBuilder = new BodyBuilder.RpcLit((WrapperParameter)param, owner.soapVersion, getValueGetterFactory());
                    else
                        tmpBodyBuilder = new BodyBuilder.DocLit((WrapperParameter)param, owner.soapVersion, getValueGetterFactory());
                } else {
                    tmpBodyBuilder = new BodyBuilder.Bare(param, owner.soapVersion, getter);
                }
                break;
            case HEADER:
                fillers.add(new MessageFiller.Header(
                    param.getIndex(),
                    param.getXMLBridge(),
                    getter ));
                break;
            case ATTACHMENT:
                fillers.add(MessageFiller.AttachmentFiller.createAttachmentFiller(param, getter));
                break;
            case UNBOUND:
                break;
            default:
                throw new AssertionError(); // impossible
            }
        }

        if(tmpBodyBuilder==null) {
            // no parameter binds to body. we create an empty message
            switch(owner.soapVersion) {
            case SOAP_11:
                tmpBodyBuilder = BodyBuilder.EMPTY_SOAP11;
                break;
            case SOAP_12:
                tmpBodyBuilder = BodyBuilder.EMPTY_SOAP12;
                break;
            default:
                throw new AssertionError();
            }
        }

        this.bodyBuilder = tmpBodyBuilder;
        this.inFillers = fillers.toArray(new MessageFiller[fillers.size()]);
    }

    this.isOneWay = method.getMEP().isOneWay();
}
 
Example 16
Source File: SEIMethodHandler.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
SEIMethodHandler(SEIStub owner, JavaMethodImpl method) {
    super(owner, null);

    //keep all the CheckedException model for the detail qname
    this.checkedExceptions = new HashMap<QName, CheckedExceptionImpl>();
    for(CheckedExceptionImpl ce : method.getCheckedExceptions()){
        checkedExceptions.put(ce.getBond().getTypeInfo().tagName, ce);
    }
    //If a non-"" soapAction is specified, wsa:action the SOAPAction
    if(method.getInputAction() != null && !method.getBinding().getSOAPAction().equals("") ) {
        this.soapAction = method.getInputAction();
    } else {
        this.soapAction = method.getBinding().getSOAPAction();
    }
    this.javaMethod = method;

    {// prepare objects for creating messages
        List<ParameterImpl> rp = method.getRequestParameters();

        BodyBuilder tmpBodyBuilder = null;
        List<MessageFiller> fillers = new ArrayList<MessageFiller>();

        for (ParameterImpl param : rp) {
            ValueGetter getter = getValueGetterFactory().get(param);

            switch(param.getInBinding().kind) {
            case BODY:
                if(param.isWrapperStyle()) {
                    if(param.getParent().getBinding().isRpcLit())
                        tmpBodyBuilder = new BodyBuilder.RpcLit((WrapperParameter)param, owner.soapVersion, getValueGetterFactory());
                    else
                        tmpBodyBuilder = new BodyBuilder.DocLit((WrapperParameter)param, owner.soapVersion, getValueGetterFactory());
                } else {
                    tmpBodyBuilder = new BodyBuilder.Bare(param, owner.soapVersion, getter);
                }
                break;
            case HEADER:
                fillers.add(new MessageFiller.Header(
                    param.getIndex(),
                    param.getXMLBridge(),
                    getter ));
                break;
            case ATTACHMENT:
                fillers.add(MessageFiller.AttachmentFiller.createAttachmentFiller(param, getter));
                break;
            case UNBOUND:
                break;
            default:
                throw new AssertionError(); // impossible
            }
        }

        if(tmpBodyBuilder==null) {
            // no parameter binds to body. we create an empty message
            switch(owner.soapVersion) {
            case SOAP_11:
                tmpBodyBuilder = BodyBuilder.EMPTY_SOAP11;
                break;
            case SOAP_12:
                tmpBodyBuilder = BodyBuilder.EMPTY_SOAP12;
                break;
            default:
                throw new AssertionError();
            }
        }

        this.bodyBuilder = tmpBodyBuilder;
        this.inFillers = fillers.toArray(new MessageFiller[fillers.size()]);
    }

    this.isOneWay = method.getMEP().isOneWay();
}
 
Example 17
Source File: StubHandler.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
ResponseBuilder buildResponseBuilder(JavaMethodImpl method, ValueSetterFactory setterFactory) {
    // prepare objects for processing response
    List<ParameterImpl> rp = method.getResponseParameters();
    List<ResponseBuilder> builders = new ArrayList<ResponseBuilder>();

    for( ParameterImpl param : rp ) {
        ValueSetter setter;
        switch(param.getOutBinding().kind) {
        case BODY:
            if(param.isWrapperStyle()) {
                if(param.getParent().getBinding().isRpcLit())
                    builders.add(new ResponseBuilder.RpcLit((WrapperParameter)param, setterFactory));
                else
                    builders.add(new ResponseBuilder.DocLit((WrapperParameter)param, setterFactory));
            } else {
                setter = setterFactory.get(param);
                builders.add(new ResponseBuilder.Body(param.getXMLBridge(),setter));
            }
            break;
        case HEADER:
            setter = setterFactory.get(param);
            builders.add(new ResponseBuilder.Header(soapVersion, param, setter));
            break;
        case ATTACHMENT:
            setter = setterFactory.get(param);
            builders.add(ResponseBuilder.AttachmentBuilder.createAttachmentBuilder(param, setter));
            break;
        case UNBOUND:
            setter = setterFactory.get(param);
            builders.add(new ResponseBuilder.NullSetter(setter,
                ResponseBuilder.getVMUninitializedValue(param.getTypeInfo().type)));
            break;
        default:
            throw new AssertionError();
        }
    }
    ResponseBuilder rb;
    switch(builders.size()) {
    case 0:
        rb = ResponseBuilder.NONE;
        break;
    case 1:
        rb = builders.get(0);
        break;
    default:
        rb = new ResponseBuilder.Composite(builders);
    }
    return rb;
}
 
Example 18
Source File: SEIMethodHandler.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
ResponseBuilder buildResponseBuilder(JavaMethodImpl method, ValueSetterFactory setterFactory) {
    // prepare objects for processing response
    List<ParameterImpl> rp = method.getResponseParameters();
    List<ResponseBuilder> builders = new ArrayList<ResponseBuilder>();

    for( ParameterImpl param : rp ) {
        ValueSetter setter;
        switch(param.getOutBinding().kind) {
        case BODY:
            if(param.isWrapperStyle()) {
                if(param.getParent().getBinding().isRpcLit())
                    builders.add(new ResponseBuilder.RpcLit((WrapperParameter)param, setterFactory));
                else
                    builders.add(new ResponseBuilder.DocLit((WrapperParameter)param, setterFactory));
            } else {
                setter = setterFactory.get(param);
                builders.add(new ResponseBuilder.Body(param.getXMLBridge(),setter));
            }
            break;
        case HEADER:
            setter = setterFactory.get(param);
            builders.add(new ResponseBuilder.Header(owner.soapVersion, param, setter));
            break;
        case ATTACHMENT:
            setter = setterFactory.get(param);
            builders.add(ResponseBuilder.AttachmentBuilder.createAttachmentBuilder(param, setter));
            break;
        case UNBOUND:
            setter = setterFactory.get(param);
            builders.add(new ResponseBuilder.NullSetter(setter,
                ResponseBuilder.getVMUninitializedValue(param.getTypeInfo().type)));
            break;
        default:
            throw new AssertionError();
        }
    }
    ResponseBuilder rb;
    switch(builders.size()) {
    case 0:
        rb = ResponseBuilder.NONE;
        break;
    case 1:
        rb = builders.get(0);
        break;
    default:
        rb = new ResponseBuilder.Composite(builders);
    }
    return rb;
}
 
Example 19
Source File: SEIMethodHandler.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
SEIMethodHandler(SEIStub owner, JavaMethodImpl method) {
    super(owner, null);

    //keep all the CheckedException model for the detail qname
    this.checkedExceptions = new HashMap<QName, CheckedExceptionImpl>();
    for(CheckedExceptionImpl ce : method.getCheckedExceptions()){
        checkedExceptions.put(ce.getBond().getTypeInfo().tagName, ce);
    }
    //If a non-"" soapAction is specified, wsa:action the SOAPAction
    if(method.getInputAction() != null && !method.getBinding().getSOAPAction().equals("") ) {
        this.soapAction = method.getInputAction();
    } else {
        this.soapAction = method.getBinding().getSOAPAction();
    }
    this.javaMethod = method;

    {// prepare objects for creating messages
        List<ParameterImpl> rp = method.getRequestParameters();

        BodyBuilder tmpBodyBuilder = null;
        List<MessageFiller> fillers = new ArrayList<MessageFiller>();

        for (ParameterImpl param : rp) {
            ValueGetter getter = getValueGetterFactory().get(param);

            switch(param.getInBinding().kind) {
            case BODY:
                if(param.isWrapperStyle()) {
                    if(param.getParent().getBinding().isRpcLit())
                        tmpBodyBuilder = new BodyBuilder.RpcLit((WrapperParameter)param, owner.soapVersion, getValueGetterFactory());
                    else
                        tmpBodyBuilder = new BodyBuilder.DocLit((WrapperParameter)param, owner.soapVersion, getValueGetterFactory());
                } else {
                    tmpBodyBuilder = new BodyBuilder.Bare(param, owner.soapVersion, getter);
                }
                break;
            case HEADER:
                fillers.add(new MessageFiller.Header(
                    param.getIndex(),
                    param.getXMLBridge(),
                    getter ));
                break;
            case ATTACHMENT:
                fillers.add(MessageFiller.AttachmentFiller.createAttachmentFiller(param, getter));
                break;
            case UNBOUND:
                break;
            default:
                throw new AssertionError(); // impossible
            }
        }

        if(tmpBodyBuilder==null) {
            // no parameter binds to body. we create an empty message
            switch(owner.soapVersion) {
            case SOAP_11:
                tmpBodyBuilder = BodyBuilder.EMPTY_SOAP11;
                break;
            case SOAP_12:
                tmpBodyBuilder = BodyBuilder.EMPTY_SOAP12;
                break;
            default:
                throw new AssertionError();
            }
        }

        this.bodyBuilder = tmpBodyBuilder;
        this.inFillers = fillers.toArray(new MessageFiller[fillers.size()]);
    }

    this.isOneWay = method.getMEP().isOneWay();
}
 
Example 20
Source File: StubHandler.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public StubHandler(JavaMethodImpl method, MessageContextFactory mcf) {
    //keep all the CheckedException model for the detail qname
    this.checkedExceptions = new HashMap<QName, CheckedExceptionImpl>();
    for(CheckedExceptionImpl ce : method.getCheckedExceptions()){
        checkedExceptions.put(ce.getBond().getTypeInfo().tagName, ce);
    }
    //If a non-"" soapAction is specified, wsa:action the SOAPAction
    String soapActionFromBinding = method.getBinding().getSOAPAction();
    if(method.getInputAction() != null && soapActionFromBinding != null && !soapActionFromBinding.equals("") ) {
        this.soapAction = method.getInputAction();
    } else {
        this.soapAction = soapActionFromBinding;
    }
    this.javaMethod = method;
    packetFactory = mcf;

    soapVersion = javaMethod.getBinding().getSOAPVersion();

    {// prepare objects for creating messages
        List<ParameterImpl> rp = method.getRequestParameters();

        BodyBuilder bodyBuilder = null;
        List<MessageFiller> fillers = new ArrayList<MessageFiller>();

        for (ParameterImpl param : rp) {
            ValueGetter getter = getValueGetterFactory().get(param);

            switch(param.getInBinding().kind) {
            case BODY:
                if(param.isWrapperStyle()) {
                    if(param.getParent().getBinding().isRpcLit())
                        bodyBuilder = new BodyBuilder.RpcLit((WrapperParameter)param, soapVersion, getValueGetterFactory());
                    else
                        bodyBuilder = new BodyBuilder.DocLit((WrapperParameter)param, soapVersion, getValueGetterFactory());
                } else {
                    bodyBuilder = new BodyBuilder.Bare(param, soapVersion, getter);
                }
                break;
            case HEADER:
                fillers.add(new MessageFiller.Header(
                    param.getIndex(),
                    param.getXMLBridge(),
                    getter ));
                break;
            case ATTACHMENT:
                fillers.add(MessageFiller.AttachmentFiller.createAttachmentFiller(param, getter));
                break;
            case UNBOUND:
                break;
            default:
                throw new AssertionError(); // impossible
            }
        }

        if(bodyBuilder==null) {
            // no parameter binds to body. we create an empty message
            switch(soapVersion) {
            case SOAP_11:
                bodyBuilder = BodyBuilder.EMPTY_SOAP11;
                break;
            case SOAP_12:
                bodyBuilder = BodyBuilder.EMPTY_SOAP12;
                break;
            default:
                throw new AssertionError();
            }
        }

        this.bodyBuilder = bodyBuilder;
        this.inFillers = fillers.toArray(new MessageFiller[fillers.size()]);
    }

    this.isOneWay = method.getMEP().isOneWay();
    responseBuilder = buildResponseBuilder(method, ValueSetterFactory.SYNC);
}