Package javax.wsdl.extensions.soap

Examples of javax.wsdl.extensions.soap.SOAPBody


                    operation.getName());
                String opStyle = soapOperation.getStyle();

                // try to get soap:body for input message
                BindingInput binpt = bop.getBindingInput();
                SOAPBody soapInputBody =
                    (SOAPBody) getExtElem(binpt,
                        SOAPBody.class,
                        binpt.getExtensibilityElements());
                if (soapInputBody != null) {
                    String namespaceURI = soapInputBody.getNamespaceURI();

                    Trc.event(
                        this,
                        "setting namespace ",
                        namespaceURI,
                        " for op ",
                        operation.getName());

                    operation.setInputNamespace(namespaceURI);
                    String use = soapInputBody.getUse();
                    operation.setInputUse(use);

                    List encodingStyles = soapInputBody.getEncodingStyles();
                    if (encodingStyles != null) {
                        if (encodingStyles.size() == 0) {
                        }
                        operation.setInputEncodingStyle(
                            (String) encodingStyles.get(0));
                        // quietly ignore if encodingStyles.size() > 1 ...
                    }
                    List parts = soapInputBody.getParts();
                    if (parts != null)
                        operation.setPartNames(parts);
                }

                SOAPHeader soapHeader =
                    (SOAPHeader) getExtElem(binpt,
                        SOAPHeader.class,
                        binpt.getExtensibilityElements());
                if (soapHeader != null) {
                    throw new WSIFException(
                        "not supported input soap:header " + soapHeader);
                }

                List inJmsProps =
                    getExtElems(
                        binpt,
                        JMSProperty.class,
                        binpt.getExtensibilityElements());
                if (inJmsProps != null && inJmsProps.size() > 0) {
                    if (st instanceof SOAPJMSConnection)
                        operation.setInputJmsProperties(inJmsProps);
                    else
                        throw new WSIFException("jms:properties found in non-jms binding");
                }

                List inJmsPropVals =
                    getExtElems(
                        binpt,
                        JMSPropertyValue.class,
                        binpt.getExtensibilityElements());
                if (inJmsPropVals != null && inJmsPropVals.size() > 0) {
                    if (st instanceof SOAPJMSConnection)
                        operation.addInputJmsPropertyValues(inJmsPropVals);
                    else
                        throw new WSIFException("jms:propertyValue found in non-jms binding");
                }

                // try to get soap:body for output message
                BindingOutput boutpt = bop.getBindingOutput();
                if (boutpt != null) {
                    SOAPBody soapOutputBody =
                        (SOAPBody) getExtElem(boutpt,
                            SOAPBody.class,
                            boutpt.getExtensibilityElements());
                    if (soapOutputBody != null) {
                        // NOTE: element ignored
                        //String namespaceURI = soapOutputBody.getNamespaceURI();
                        String use = soapOutputBody.getUse();
                        operation.setOutputUse(use);

                        // NOTE: element ignored
                        //List encodingStyles = soapInputBody.getEncodingStyles();
                        List parts = soapOutputBody.getParts();
                        if (parts != null && parts.size() > 0) {
                            operation.setReturnName((String) parts.get(0));
                        }
                    }
                    soapHeader =
View Full Code Here


   */
  private void parseBindingInput() throws WSIFException {
    BindingInput bindinginput = bindingOperation.getBindingInput();
    List inExtElems = bindinginput.getExtensibilityElements();
   
    SOAPBody inSoapBody =
      (SOAPBody) wsifPort.getExtElem(
        bindinginput,
        javax.wsdl.extensions.soap.SOAPBody.class,
        inExtElems);
    if (inSoapBody != null) {
View Full Code Here

   */
  private void parseBindingOutput() throws WSIFException {
    BindingOutput bindingoutput = bindingOperation.getBindingOutput();
    if (bindingoutput != null) {
      List outExtElems = bindingoutput.getExtensibilityElements();
      SOAPBody outSoapBody =
        (SOAPBody) wsifPort.getExtElem(
          bindingoutput,
          javax.wsdl.extensions.soap.SOAPBody.class,
          outExtElems);
      if (outSoapBody != null) {
View Full Code Here

    boolean isInput)
    throws WSIFException {
    Trc.entry(this, mimeMultipart);

    ArrayList mimePartNames = new ArrayList();
    SOAPBody soapBody = null;
   
    Operation op = bindingOperation.getOperation();
    Map mapInParts = op.getInput().getMessage().getParts();
    Map mapOutParts =
      op.getOutput() == null
        ? new HashMap()
        : op.getOutput().getMessage().getParts();

    List mimeParts = mimeMultipart.getMIMEParts();
    Iterator mimePartIt = mimeParts.iterator();
    while (mimePartIt.hasNext()) {
      Object nextMimePart = mimePartIt.next();
      if (nextMimePart instanceof MIMEPart) {
        MIMEPart mimePart = (MIMEPart) nextMimePart;
        if (!MIMEConstants
          .NS_URI_MIME
          .equals(mimePart.getElementType().getNamespaceURI()))
          throw new WSIFException(
            "A MIME part in binding operation "
              + bindingOperation.getName()
              + " did not have the correct namespace URI of "
              + MIMEConstants.NS_URI_MIME
              + ".");

        boolean containsSoapBody = false;
        boolean containsMimeContent = false;
        List mimePartChildren = mimePart.getExtensibilityElements();
        Iterator mimePartChildrenIt = mimePartChildren.iterator();
        while (mimePartChildrenIt.hasNext()) {
          Object nextChild = mimePartChildrenIt.next();
          if (nextChild instanceof MIMEContent) {
            MIMEContent mimeContent = (MIMEContent) nextChild;
            if (!MIMEConstants
              .NS_URI_MIME
              .equals(
                mimePart.getElementType().getNamespaceURI()))
              throw new WSIFException(
                "A MIME part in binding operation "
                  + bindingOperation.getName()
                  + " did not have the correct namespace URI of "
                  + MIMEConstants.NS_URI_MIME
                  + ".");
            containsMimeContent = true;
            if (containsSoapBody)
              throw new WSIFException(
                "A mime:part that contains a mime:content also "
                  + "contains a soap:body. Operation="
                  + getName());

            String partName = mimeContent.getPart();
            if (partName == null || partName.length() == 0)
              throw new WSIFException(
                "No part name for a mime:content. Operation="
                  + getName());

            if ((isInput && mapInParts.get(partName) == null)
              || (!isInput && mapOutParts.get(partName) == null))
              throw new WSIFException(
                "The part specified in a mime:content does "
                  + "not exist in the operation. Operation="
                  + getName()
                  + " Part="
                  + partName);

            mimePartNames.add(partName);

          } else if (nextChild instanceof SOAPBody) {
            if (soapBody!=null) {
              throw new WSIFException(
                "Multiple soap:body tags found in a "
                  + "mime:multipartRelated. Operation="
                  + getName());
            }
            soapBody = (SOAPBody)nextChild;

            containsSoapBody = true;
            if (containsMimeContent)
              throw new WSIFException(
                "A mime:part that contains a mime:content also "
                  + "contains a soap:body. Operation="
                  + getName());

          } else if (nextChild instanceof MIMEMultipartRelated) {
            throw new WSIFException(
              "WSIF does not support nesting mime:multipartRelated "
                + "inside a mime:part. Operation="
                + getName());
          } else if (nextChild instanceof MIMEMimeXml) {
            throw new WSIFException(
              "WSIF does not support mime:mimeXml. Operation="
                + getName());
          }
        }
      }
    }

        // There is at most one soap:body so process it here.   
        if (soapBody != null)
        {
            List soapBodyParts = soapBody.getParts();
            if (soapBodyParts == null && !mimePartNames.isEmpty())
            {
              /* In the WSDL (containing attachments and non-attachment
               * parts), if there is a soap:body that does not have
               * the parts attribute, which parts should the soap body
               * contain? The WSDL spec is not clear so this code
               * fixes the soap body to contain only the non-attachment
               * parts, which is the kinder option. The alternative which
               * is making the soap body contain all the parts (so duplicating
               * the attachments) is cruel since this is probably not
               * what the backend is expecting.
               */
                Map soapParts;
                if (isInput)
                    soapParts = mapInParts;
                else
                    soapParts = mapOutParts;

                if (soapParts != null && !soapParts.isEmpty())
                {
                    ArrayList nonMimeParts =
                        new ArrayList(
                            Arrays.asList(soapParts.keySet().toArray()));
                    nonMimeParts.removeAll(
                        Arrays.asList(soapParts.keySet().toArray()));
                    soapBody.setParts(nonMimeParts);
                }
            }

            List soapParts = parseSoapBody(soapBody, isInput);
            if (isInput)
View Full Code Here

                        + " binding has not style attribute");
            }

            // try to get soap:body for input message
            BindingInput binpt = bop.getBindingInput();
            SOAPBody soapInputBody =
                (SOAPBody) getExtElem(binpt, SOAPBody.class, binpt.getExtensibilityElements());
            if (soapInputBody != null) {
                String namespaceURI = soapInputBody.getNamespaceURI();
               
                if (Trc.ON)
                    Trc.event(
                        this,
                        "setting namespace "
                            + namespaceURI
                            + " for op "
                            + opInst.getName());
                opInst.setInputNamespace(namespaceURI);
                String use = soapInputBody.getUse();
                if (!"encoded".equals(use)) {
                    throw new WSIFException("unsupported use " + use + " in " + soapOperation);
                }
                List encodingStyles = soapInputBody.getEncodingStyles();
                if (encodingStyles != null) {
                    if (encodingStyles.size() == 0) {
                    }
                    opInst.setInputEncodingStyle((String) encodingStyles.get(0));
                    // quietly ignore if encodingStyles.size() > 1 ...
                }
                List parts = soapInputBody.getParts();
                if (parts != null) {
                    opInst.setPartNames(parts);
                }
            }
            SOAPHeader soapHeader =
                (SOAPHeader) getExtElem(binpt,
                    SOAPHeader.class,
                    binpt.getExtensibilityElements());
            if (soapHeader != null) {
                throw new WSIFException("not supported input soap:header " + soapHeader);
            }

            // try to get soap:body for output message
            BindingOutput boutpt = bop.getBindingOutput();
            SOAPBody soapOutputBody =
                (SOAPBody) getExtElem(boutpt,
                    SOAPBody.class,
                    boutpt.getExtensibilityElements());
            if (soapOutputBody != null) {
                // NOTE: element ignored
View Full Code Here

        List<SOAPHeader> soapHeaders = getSOAPHeaders(bi);
        for (SOAPHeader sh : soapHeaders)
            createSoapHeader(soapEnv, sh, op.getInput().getMessage(), message);

        SOAPBody soapBody = getSOAPBody(bi);
        if (soapBody != null) {
            org.apache.axiom.soap.SOAPBody sb = soapEnv.getBody() == null ?
                    _soapFactory.createSOAPBody(soapEnv)
                    : soapEnv.getBody();
            createSoapBody(sb, soapBody, op.getInput().getMessage(), message, op.getName());
View Full Code Here

        }
        List<SOAPHeader> soapHeaders = getSOAPHeaders(bo);
        for (SOAPHeader sh : soapHeaders)
            createSoapHeader(soapEnv, sh, op.getOutput().getMessage(), message);

        SOAPBody soapBody = getSOAPBody(bo);
        if (soapBody != null) {
            org.apache.axiom.soap.SOAPBody sb = soapEnv.getBody() == null ? _soapFactory.createSOAPBody(soapEnv) : soapEnv.getBody();
            createSoapBody(sb, soapBody, op.getOutput().getMessage(), message, op.getName() + "Response");
        }
View Full Code Here

        BindingInput bi = bop.getBindingInput();
        if (bi == null)
            throw new OdeFault(__msgs.msgBindingInputNotFound(_serviceName, _portName, op.getName()));

        SOAPBody soapBody = getSOAPBody(bi);
        if (soapBody != null)
            extractSoapBodyParts(odeMessage, envelope.getBody(), soapBody, op.getInput().getMessage(), op.getName());

        List<SOAPHeader> soapHeaders = getSOAPHeaders(bi);
        for (SOAPHeader sh : soapHeaders)
View Full Code Here

        BindingOutput bo = bop.getBindingOutput();
        if (bo == null)
            throw new OdeFault(__msgs.msgBindingInputNotFound(_serviceName, _portName, op.getName()));

        SOAPBody soapBody = getSOAPBody(bo);
        if (soapBody != null)
            extractSoapBodyParts(odeMessage, envelope.getBody(),
                    soapBody, op.getOutput().getMessage(), op.getName() + "Response");

        List<SOAPHeader> soapHeaders = getSOAPHeaders(bo);
View Full Code Here

        List<SOAPHeader> soapHeaders = getSOAPHeaders(bi);
        for (SOAPHeader sh : soapHeaders)
            createSoapHeader(soapEnv, sh, op.getInput().getMessage(), message);

        SOAPBody soapBody = getSOAPBody(bi);
        if (soapBody != null) {
            org.apache.axiom.soap.SOAPBody sb = soapEnv.getBody() == null ?
                    _soapFactory.createSOAPBody(soapEnv)
                    : soapEnv.getBody();
            createSoapBody(sb, soapBody, op.getInput().getMessage(), message, op.getName());
View Full Code Here

TOP

Related Classes of javax.wsdl.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.