ws-wsif-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rhett DeWall (JIRA)" <wsif-...@ws.apache.org>
Subject [jira] Commented: (WSIF-74) Multiple soap:header and soap:headerfault elements not accepted by WSIFOperation_ApacheAxis.
Date Mon, 22 Aug 2005 17:14:09 GMT
    [ http://issues.apache.org/jira/browse/WSIF-74?page=comments#action_12319618 ] 

Rhett DeWall commented on WSIF-74:
----------------------------------

My apologies.  The attached file is not correct, and should be disregarded.

The fix to WSIFOperation_ApacheAxis.java is for the method parseSOAPHeaderElement, which is
provided below, and while the change are still to call getExtElems versus getExtElem, further
changes were required to meet getExtElems interface requirements.

    /**
     * Parses any SOAP header elements in the binding input or output.
     * The WSDL soap:header element has the form:
     *    <soap:header message="qname" part="nmtoken" use="literal|encoded"
     *                 encodingStyle="uri-list"? namespace="uri"?>*
     *       <soap:headerfault message="qname" part="nmtoken" use="literal|encoded"
     *                         encodingStyle="uri-list"? namespace="uri"?/>*
     *    <soap:header>
     */
    private void parseSOAPHeaderElement(Object element) throws WSIFException {
        if (!_doParseSOAPHeaderElement)
        {
            return;
        }
        List extensabilityElements;
        if (element instanceof BindingInput) {
            extensabilityElements =
                ((BindingInput) element).getExtensibilityElements();
        } else if (element instanceof BindingOutput) {
            extensabilityElements =
                ((BindingOutput) element).getExtensibilityElements();
        } else {
            throw new WSIFException(
                "internal error, unexpected object: " + element);
        }
        
        List soapHeaderParts = new ArrayList();
        List soapHeaderFaultParts = new ArrayList();
        
        List soapHeaders =
            wsifPort.getExtElems(
            element,
            javax.wsdl.extensions.soap.SOAPHeader.class,
            extensabilityElements);
        if ((soapHeaders == null) || (soapHeaders.size() == 0))
        {
            return;
        }
        for (int i = 0; i < soapHeaders.size(); i++)
        {
            SOAPHeader soapHeader = (SOAPHeader)soapHeaders.get(i);
            
            QName messageName = soapHeader.getMessage();
            if (messageName == null) {
                throw new WSIFException(
                    "no message attribute on soap:header: " + soapHeader);
            }
            String messagePart = soapHeader.getPart();
            if (messagePart == null) {
                throw new WSIFException(
                    "no part attribute on soap:header: " + soapHeader);
            }
            Part soapHeaderPart = getPart(messageName, messagePart);
            if (soapHeaderPart == null) {
                throw new WSIFException(
                    "non existent part specified on soap:header: "
                        + soapHeader);
            }
            soapHeaderParts.add(soapHeaderPart);
            
            List soapHeaderFaults =
                wsifPort.getExtElems(
                soapHeader,
                javax.wsdl.extensions.soap.SOAPHeaderFault.class,
                extensabilityElements);
            if ((soapHeaderFaults == null) || (soapHeaderFaults.size() == 0))
            {
                continue;
            }
            for (int j = 0; j < soapHeaderFaults.size(); j++)
            {
                SOAPHeaderFault soapHeaderFault = 
                    (SOAPHeaderFault)soapHeaderFaults.get(j);
            
                messageName = soapHeader.getMessage();
                if (messageName == null) {
                    throw new WSIFException(
                        "no message attribute on soap:header: " + soapHeader);
                }
                messagePart = soapHeader.getPart();
                if (messagePart == null) {
                    throw new WSIFException(
                        "no part attribute on soap:header: " + soapHeader);
                }
                Part soapHeaderFaultPart = getPart(messageName, messagePart);
                if (soapHeaderFaultPart == null) {
                    throw new WSIFException(
                        "non existent part specified on soap:header: "
                            + soapHeader);
                }
                soapHeaderFaultParts.add(soapHeaderFaultPart);
            }
        }
        
        if (element instanceof BindingInput) {
            this.inputSOAPHeader = soapHeaderParts;
            this.inputSOAPHeaderFault = soapHeaderFaultParts;
        } else {
            this.outputSOAPHeader = soapHeaderParts;
            this.outputSOAPHeaderFault = soapHeaderFaultParts;
        }
        //TODO now go and do something with them...
    }


> Multiple soap:header and soap:headerfault elements not accepted by WSIFOperation_ApacheAxis.
> --------------------------------------------------------------------------------------------
>
>          Key: WSIF-74
>          URL: http://issues.apache.org/jira/browse/WSIF-74
>      Project: Axis-WSIF
>         Type: Bug
>   Components: Basic Architecture
>     Versions: 2.0
>     Reporter: Rhett DeWall
>  Attachments: WSIFOperation_ApacheAxis.java
>
> WSDL 1.1 states that multiple soap:header and soap:headerfault elements are valid; however,
WSIFOperation_ApacheAxis.java only allows one per operation.  WSDL 1.1 excerpt listed below:
> ------------------------
> <definitions .... >
>     <binding .... >
>         <operation .... >
>            <input>
>              <soap:header message="qname" part="nmtoken" use="literal|encoded"
>                           encodingStyle="uri-list"? namespace="uri"?>*
>                <soap:headerfault message="qname" part="nmtoken" use="literal|encoded"
>                                  encodingStyle="uri-list"? namespace="uri"?/>*
>              <soap:header>                                
>            </input>
>            <output>
>                <soap:header message="qname" part="nmtoken" use="literal|encoded"
>                             encodingStyle="uri-list"? namespace="uri"?>*
>                  <soap:headerfault message="qname" part="nmtoken" use="literal|encoded"
>                                    encodingStyle="uri-list"? namespace="uri"?/>*
>                <soap:header>                                
>            </output>
>         </operation>
>     </binding>
> </definitions>
> ------------------------
> A fix is attached whereby lines 473 and 496 have been changed to call getExtElems() versus
getExtElem.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message