Package org.apache.cxf.tools.common.extensions.soap

Examples of org.apache.cxf.tools.common.extensions.soap.SoapBody


            }
        }
        String use = null;
        for (ExtensibilityElement ext : inbindings) {
            if (SOAPBindingUtil.isSOAPBody(ext)) {
                SoapBody soapBody = SOAPBindingUtil.getSoapBody(ext);
                use = soapBody.getUse();
            }           
           
            if (SOAPBindingUtil.isSOAPHeader(ext)) {
                SoapHeader soapHeader = SOAPBindingUtil.getSoapHeader(ext);
                boolean found = false;
View Full Code Here


            BindingInput bi = bo.getBindingInput();
            it = bi.getExtensibilityElements().iterator();
            found = false;
            while (it.hasNext()) {
                Object obj = it.next();
                SoapBody soapBody = SOAPBindingUtil.getSoapBody(obj);
                if (soapBody != null && soapBody.getUse().equalsIgnoreCase("literal")) {
                    found = true;
                    break;
                }
            }
            if (!found) {
View Full Code Here

            it = bi.getExtensibilityElements().iterator();
            while (it.hasNext()) {
                Object obj = it.next();
                assertTrue(SOAPBindingUtil.isSOAPBody(obj));
                assertTrue(obj instanceof SOAP12Body);
                SoapBody soapBody = SOAPBindingUtil.getSoapBody(obj);
                assertNotNull(soapBody);
                assertTrue("literal".equalsIgnoreCase(soapBody.getUse()));
            }
        } catch (ToolException e) {
            fail("Exception Encountered when parsing wsdl, error: " + e.getMessage());
        }
    }   
View Full Code Here

            it = bi.getExtensibilityElements().iterator();
            while (it.hasNext()) {
                Object obj = it.next();
                assertTrue(SOAPBindingUtil.isSOAPBody(obj));
                assertTrue(obj instanceof SOAP12Body);
                SoapBody soapBody = SOAPBindingUtil.getSoapBody(obj);
                assertNotNull(soapBody);
                assertTrue("literal".equalsIgnoreCase(soapBody.getUse()));
            }
            bo = binding.getBindingOperation("pingMe", null, null);
            assertNotNull(bo);
            it = bo.getExtensibilityElements().iterator();
            assertTrue(it != null && it.hasNext());
View Full Code Here

            it = bi.getExtensibilityElements().iterator();
            while (it.hasNext()) {
                Object obj = it.next();
                assertTrue(SOAPBindingUtil.isSOAPBody(obj));
                assertTrue(obj instanceof SOAPBody);
                SoapBody soapBody = SOAPBindingUtil.getSoapBody(obj);
                assertNotNull(soapBody);
                assertTrue("literal".equalsIgnoreCase(soapBody.getUse()));
            }
        } catch (ToolException e) {
            fail("Exception Encountered when parsing wsdl, error: " + e.getMessage());
        }       
    }
View Full Code Here

                        for (MessagePartInfo part : b.getInput().getMessageParts()) {
                            bodyParts.add(part.getName().getLocalPart());
                        }
                    }
                    SoapBody body = SOAPBindingUtil.createSoapBody(extensionRegistry,
                                                                   BindingInput.class,
                                                                   isSoap12);
                    body.setUse("literal");

                    if (!StringUtils.isEmpty(bodyParts)) {
                        body.setParts(bodyParts);
                    }

                    b.getInput().addExtensor(body);
                }

                if (b.getOutput() != null) {
                    List<String> bodyParts = new ArrayList<String>();
                    SoapHeaderInfo headerInfo = b.getOutput().getExtensor(SoapHeaderInfo.class);
                    if (headerInfo != null) {
                        SoapHeader soapHeader = SOAPBindingUtil.createSoapHeader(extensionRegistry,
                                                                                 BindingOutput.class,
                                                                                 isSoap12);
                        soapHeader.setMessage(b.getOutput().getMessageInfo().getName());
                        soapHeader.setPart(headerInfo.getPart().getName().getLocalPart());
                        soapHeader.setUse("literal");
                        b.getOutput().addExtensor(soapHeader);

                        for (MessagePartInfo part : b.getOutput().getMessageParts()) {
                            bodyParts.add(part.getName().getLocalPart());
                        }
                    }
                    SoapBody body = SOAPBindingUtil.createSoapBody(extensionRegistry,
                                                                   BindingOutput.class,
                                                                   isSoap12);
                    body.setUse("literal");

                    if (!StringUtils.isEmpty(bodyParts)) {
                        body.setParts(bodyParts);
                    }
                   
                    b.getOutput().addExtensor(body);
                }
            }
View Full Code Here

        return true;

    }

    private boolean checkR2716(final BindingOperation bop) {
        SoapBody inSoapBody = SOAPBindingUtil.getBindingInputSOAPBody(bop);
        SoapBody outSoapBody = SOAPBindingUtil.getBindingOutputSOAPBody(bop);
        if (inSoapBody != null && !StringUtils.isEmpty(inSoapBody.getNamespaceURI())
            || outSoapBody != null && !StringUtils.isEmpty(outSoapBody.getNamespaceURI())) {
            addErrorMessage("Violate WSI-BP-1.0 R2716 operation '"
                            + bop.getName() + "' soapBody MUST NOT have namespace attribute");
            return false;
        }
View Full Code Here

        }
        return true;
    }

    private boolean checkR2717AndR2726(final BindingOperation bop) {
        SoapBody inSoapBody = SOAPBindingUtil.getBindingInputSOAPBody(bop);
        SoapBody outSoapBody = SOAPBindingUtil.getBindingOutputSOAPBody(bop);
        if (inSoapBody != null && StringUtils.isEmpty(inSoapBody.getNamespaceURI())
            || outSoapBody != null && StringUtils.isEmpty(outSoapBody.getNamespaceURI())) {
            addErrorMessage("Violate WSI-BP-1.0 R2717 operation '"
                            + bop.getName() + "' soapBody MUST have namespace attribute");
            return false;
        }
View Full Code Here

    private boolean checkR2201Input(final Operation operation,
                                    final BindingOperation bop) {
        List<Part> partsList = wsdlHelper.getInMessageParts(operation);
        int inmessagePartsCount = partsList.size();
        SoapBody soapBody = SOAPBindingUtil.getBindingInputSOAPBody(bop);
        if (soapBody != null) {
            List parts = soapBody.getParts();
            int boundPartSize = parts == null ? inmessagePartsCount : parts.size();
            SoapHeader soapHeader = SOAPBindingUtil.getBindingInputSOAPHeader(bop);
            boundPartSize = soapHeader != null
                && soapHeader.getMessage().equals(
                    operation.getInput().getMessage()
View Full Code Here

    }

    private boolean checkR2201Output(final Operation operation,
                                     final BindingOperation bop) {
        int outmessagePartsCount = wsdlHelper.getOutMessageParts(operation).size();
        SoapBody soapBody = SOAPBindingUtil.getBindingOutputSOAPBody(bop);
        if (soapBody != null) {
            List parts = soapBody.getParts();
            int boundPartSize = parts == null ? outmessagePartsCount : parts.size();
            SoapHeader soapHeader = SOAPBindingUtil.getBindingOutputSOAPHeader(bop);
            boundPartSize = soapHeader != null
                && soapHeader.getMessage().equals(
                    operation.getOutput().getMessage()
View Full Code Here

TOP

Related Classes of org.apache.cxf.tools.common.extensions.soap.SoapBody

Copyright © 2018 www.massapicom. 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.