Examples of SoapBody


Examples of com.arjuna.webservices.SoapBody

        final MessageContext messageContext, final MessageContext messageResponseContext,
        final String action, final Reader reader, final SoapDetails soapDetails)
        throws SoapFault, XMLStreamException
    {
        final XMLStreamReader streamReader = SoapUtils.getXMLStreamReader(reader) ;
        final SoapBody response = soapService.parse(messageContext, messageResponseContext, action, streamReader, soapDetails) ;
        return new SoapBodyMessage(response, soapDetails, soapService, messageContext) ;
    }
View Full Code Here

Examples of com.sun.xml.ws.security.opt.impl.message.SOAPBody

                       
                    } else{
                        // replace SOAPBody with securityElement and add
                        // to targets
                        boolean contentOnly = signatureTarget.getContentOnly();
                        SOAPBody soapBody = (SOAPBody)body;
                        if(!contentOnly){
                            if(soapBody.getId() == null || "".equals(soapBody.getId()))
                                soapBody.setId(fpContext.generateID());
                            SignedMessagePart smp = new SignedMessagePart(soapBody, contentOnly);
                            secMessage.replaceBody(smp);
                            targets.add(smp);
                        } else{
                            String id = null;
                            if(soapBody.getBodyContentId() == null || "".equals(soapBody.getBodyContentId())){
                                id = fpContext.generateID();
                                soapBody.setBodyContentId(id);
                            }
                           
                            SignedMessagePart smp = new SignedMessagePart(soapBody, contentOnly);
                            SOAPBody newBody =  new SOAPBody(smp,fpContext.getSOAPVersion());
                            newBody.setId(soapBody.getId());
                            secMessage.replaceBody(newBody);
                            targets.add(smp);
                        }
                    }
                } else{
View Full Code Here

Examples of javax.wsdl.extensions.soap.SOAPBody

        return style;       
    }
   
    public SOAPBinding.Use getSOAPUse() {
        if (use == null) {
            SOAPBody body = getSOAPBody(true);
           
            if (body != null
                && body.getUse() != null
                && !"".equals(body.getUse())) {
                use = SOAPBinding.Use.valueOf(body.getUse().toUpperCase());
            }
            if (use == null) {
                use = SOAPBinding.Use.LITERAL;
            }
        }
View Full Code Here

Examples of javax.wsdl.extensions.soap.SOAPBody

        }
        return soapAction;
    }
    public String getTargetNamespace() {
        if (targetNs == null) {
            SOAPBody soapBody = getSOAPBody(true);
            if (soapBody != null) {
                targetNs = soapBody.getNamespaceURI();
            }
            if (targetNs == null) {
                targetNs = cache.getTargetNamespace();
            }
        }
View Full Code Here

Examples of javax.wsdl.extensions.soap.SOAPBody

            List elements = bindingInput.getExtensibilityElements();
            QName qn = new QName(def.getTargetNamespace(), op.getName());
            for (Iterator i = elements.iterator(); i.hasNext();) {
                Object element = i.next();
                if (SOAPBody.class.isInstance(element)) {
                    SOAPBody body = (SOAPBody)element;
                    if (body.getNamespaceURI() != null) {
                        qn = new QName(body.getNamespaceURI(), op.getName());
                    }
                }
            }
           
            ServerDataBindingCallback cb = getDataBindingCallback(qn, null,
View Full Code Here

Examples of javax.wsdl.extensions.soap.SOAPBody

        Iterator inbindings = operation.getBindingInput().getExtensibilityElements().iterator();
        String use = null;
        while (inbindings.hasNext()) {
            Object obj = inbindings.next();
            if (obj instanceof SOAPBody) {
                SOAPBody soapBody = (SOAPBody)obj;
                use = soapBody.getUse();
            }
            if (obj instanceof SOAPHeader) {
                SOAPHeader soapHeader = (SOAPHeader)obj;
                boolean found = false;
                for (JavaParameter parameter : jm.getParameters()) {
View Full Code Here

Examples of javax.wsdl.extensions.soap.SOAPBody

    private void generateOutputSoapBody(JavaMethod jmethod, BindingOperation operation, WSDLParameter param) {
        if (param == null) {
            return;
        }

        SOAPBody body = null;

        BindingOutput bindingOutput = definition.createBindingOutput();
        bindingOutput.setName(param.getName());

        operation.setBindingOutput(bindingOutput);

        try {
            body = (SOAPBody)extensionRegistry.createExtension(BindingOutput.class,
                                                               new QName(WSDLConstants.SOAP11_NAMESPACE,
                                                                         "body"));
        } catch (WSDLException e1) {
            throw new ToolException(e1.getMessage(), e1);
        }

        if (jmethod.getSoapUse() == SOAPBinding.Use.LITERAL) {
            body.setUse("literal");
        } else {
            Message msg = new Message("ENCODED_USE_NOT_SUPPORTED", LOG);
            throw new ToolException(msg);
        }

        List<JavaParameter> bodyParams = new ArrayList<JavaParameter>();
        List<JavaParameter> headerParams = new ArrayList<JavaParameter>();

        splitSoapHeaderBodyParams(param, bodyParams, headerParams);
        // if exists soap header,then generate soap body parts

        if (headerParams.size() > 0) {
            List<String> parts = new ArrayList<String>();
            for (JavaParameter parameter : bodyParams) {
                parts.add(parameter.getPartName());
            }
            body.setParts(parts);
            SOAPHeader soapHeader = null;
            for (JavaParameter jp : headerParams) {

                try {
                    soapHeader = (SOAPHeader)extensionRegistry
                        .createExtension(BindingOutput.class, new QName(WSDLConstants.SOAP11_NAMESPACE,
                                                                        "header"));
                    soapHeader.setMessage(new QName(param.getTargetNamespace(), param.getName()));
                    soapHeader.setPart(jp.getPartName());
                    soapHeader.setUse("literal");

                } catch (WSDLException e) {
                    throw new ToolException(e.getMessage(), e);
                }
            }

            if (jmethod.getSoapStyle() == SOAPBinding.Style.RPC) {
                body.setNamespaceURI(param.getTargetNamespace());
            }
            bindingOutput.addExtensibilityElement(soapHeader);

        }
        bindingOutput.addExtensibilityElement(body);
View Full Code Here

Examples of javax.wsdl.extensions.soap.SOAPBody

    private void generateInputSoapBody(JavaMethod jmethod, BindingOperation operation, WSDLParameter param) {
        if (param == null) {
            return;
        }
        SOAPBody body = null;

        BindingInput bindingInput = definition.createBindingInput();
        bindingInput.setName(param.getName());

        operation.setBindingInput(bindingInput);

        try {
            body = (SOAPBody)extensionRegistry.createExtension(BindingInput.class,
                                                               new QName(WSDLConstants.SOAP11_NAMESPACE,
                                                                         "body"));
        } catch (WSDLException e1) {
            throw new ToolException(e1.getMessage(), e1);
        }

        if (jmethod.getSoapUse() == SOAPBinding.Use.LITERAL) {
            body.setUse("literal");
        } else {
            Message msg = new Message("ENCODED_USE_NOT_SUPPORTED", LOG);
            throw new ToolException(msg);
        }

        List<JavaParameter> bodyParams = new ArrayList<JavaParameter>();
        List<JavaParameter> headerParams = new ArrayList<JavaParameter>();

        splitSoapHeaderBodyParams(param, bodyParams, headerParams);

        // if exists soap header,then generate soap body parts

        if (headerParams.size() > 0) {
            List<String> parts = new ArrayList<String>();
            for (JavaParameter parameter : bodyParams) {
                parts.add(parameter.getPartName());
            }
            body.setParts(parts);
            SOAPHeader soapHeader = null;
            for (JavaParameter jp : headerParams) {

                try {
                    soapHeader = (SOAPHeader)extensionRegistry
                        .createExtension(BindingInput.class, new QName(WSDLConstants.SOAP11_NAMESPACE,
                                                                       "header"));

                    soapHeader.setMessage(new QName(param.getTargetNamespace(), param.getName()));
                    soapHeader.setPart(jp.getPartName());
                    soapHeader.setUse("literal");

                } catch (WSDLException e) {
                    throw new ToolException(e.getMessage(), e);
                }
            }

            if (jmethod.getSoapStyle() == SOAPBinding.Style.RPC) {
                body.setNamespaceURI(param.getTargetNamespace());
            }
            bindingInput.addExtensibilityElement(soapHeader);

        }
        bindingInput.addExtensibilityElement(body);
View Full Code Here

Examples of javax.wsdl.extensions.soap.SOAPBody

    private SOAPBody getSoapBody(Class parent) throws ToolException {
        if (extReg == null) {
            extReg = wsdlFactory.newPopulatedExtensionRegistry();
        }
        SOAPBody soapBody = null;
        try {
            soapBody = (SOAPBody)extReg.createExtension(parent, WSDLConstants.NS_SOAP_BODY);
        } catch (WSDLException wse) {
            Message msg = new Message("FAIL_TO_CREATE_SOAPBINDING", LOG);
            throw new ToolException(msg, wse);
        }
        soapBody.setUse((String)env.get(ToolConstants.CFG_USE));
        if (WSDLConstants.RPC.equalsIgnoreCase((String)env.get(ToolConstants.CFG_STYLE))
            && env.optionSet(ToolConstants.CFG_NAMESPACE)) {
            soapBody.setNamespaceURI((String)env.get(ToolConstants.CFG_NAMESPACE));
        }
        return soapBody;
    }
View Full Code Here

Examples of javax.wsdl.extensions.soap.SOAPBody

        soapOperation.setStyle("rpc");
        bindingOperation.addExtensibilityElement(soapOperation);
        bindingOperation.setOperation(operation);
        bindingOperation.setName(operation.getName());
        BindingInput bindingInput = definition.createBindingInput();
        SOAPBody inputBody = (SOAPBody) extensionRegistry.createExtension(BindingInput.class, new QName("http://schemas.xmlsoap.org/wsdl/soap/", "body"));
        inputBody.setUse("encoded");
        bindingInput.addExtensibilityElement(inputBody);
        bindingOperation.setBindingInput(bindingInput);
        BindingOutput bindingOutput = definition.createBindingOutput();
        bindingOutput.addExtensibilityElement(inputBody);
        bindingOperation.setBindingOutput(bindingOutput);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.