source/SProxy/CodeTypeBuilder.cpp
HRESULT CCodeTypeBuilder::ProcessMessage_PAD(
    CWSDLMessage *pMsg,
    CCodeFunction *pCodeFunc,
    DWORD dwFlags,
    DWORD dwCallFlags)
{
    ATLASSERT( pMsg != NULL );
    ATLASSERT( pCodeFunc != NULL );
    ATLASSERT( dwCallFlags & CODEFLAG_PAD );

    bool bType = false;
    POSITION pos = pMsg->GetFirstPart();
    while (pos != NULL)
    {
        if (bType != false)
        {
            EmitFileError(IDS_SDL_PAD_TYPE, pMsg, 0);
            return E_FAIL;
        }

        CWSDLMessagePart *pCheck = pMsg->GetNextPart(pos);
        ATLASSERT( pCheck != NULL );
        if (pCheck->GetTypeName().GetName().GetLength() != 0)
        {
            bType = true;
        }
    }

    HRESULT hr = S_OK;
    if (dwFlags & CODEFLAG_IN)
    {
        // clear the namespace--it should be set from the schema
        pCodeFunc->GetNamespace().Empty();
    }

    if (bType != false)
    {
        // REVIEW (jasjitg): not implemented correctly in atlsoap.h!!!

        // REVIEW (jasjitg): comment/assert below...
        // must have CODEFLAG_CHAIN
        ATLASSERT( dwCallFlags & CODEFLAG_CHAIN );

        // referenced by type= ==> only one message part
        pos = pMsg->GetFirstPart();
        CWSDLMessagePart *pPart = pMsg->GetNextPart(pos);
        ATLASSERT( pPart != NULL );

        hr = ProcessMessagePart_PAD(pPart, pCodeFunc, dwFlags, dwCallFlags);
    }
    else // referenced by element=
    {
        pos = pMsg->GetFirstPart();
        while (pos != NULL)
        {
            CWSDLMessagePart *pPart = pMsg->GetNextPart(pos);
            ATLASSERT( pPart != NULL );

            hr = ProcessMessagePart_PAD(pPart, pCodeFunc, dwFlags, dwCallFlags);

            if (FAILED(hr))
            {
                break;
            }
        }
    }

    if (FAILED(hr))
    {
        EmitErrorHr(E_FAIL);
    }

    return hr;
}
//
// PAD means ParametersAsDocument
// each message part represents a parameter
// NOTE: if any referenced part references its schema component
// using the type= attribute it MUST be the only referenced message
// part, per the second example in section 2.3.1 in the WSDL 1.1 spec.
//
// structure of the referenced message and part is:
//
//   <message name="...">
//     <part name="x" element="s0:x"/>
//     <part name="y" element="s0:B"/>
//   </message>
//
// where schema looks like (showing element= example -- see 2.3.1 for type= example):
//
//   <element name="x" type="xsd:int"/>
//   <element name="B">
//     <complexType>
//       <sequence> <!-- or "all" -->
//         <element name="C" type="xsd:int"/>
//         <element name="D" type="xsd:string"/>
//         <!-- ... etc. -->
//       </sequence>
//     </complexType>
//   </element>
//
// the expected wire format is:
//
// <Envelope>
//   <Body>
//     <A>123</A>
//     <B><C>123</C><D>some string</D></B>
//   </Body>
// </Envelope>
//
// see 2.3, 2.3.1, and 3.5 in the WSDL 1.1 spec for more details.
//
PAD means ParametersAsDocument
each message part represents a parameter
NOTE: if any referenced part references its schema component
using the type= attribute it MUST be the only referenced message
part, per the second example in section 2.3.1 in the WSDL 1.1 spec.

structure of the referenced message and part is.







the expected wire format is.




PAD means ParametersAsDocument each message part represents a parameter NOTE : if any referenced part references its schema component using the type = attribute it MUST be the only referenced message part per the second example in section 2 . 3 . 1 in the WSDL 1 . 1 spec . structure of the referenced message and part is . the expected wire format is .
HRESULT CCodeTypeBuilder::ProcessMessage_PAD(
    CWSDLMessage *pMsg,
    CCodeFunction *pCodeFunc,
    DWORD dwFlags,
    DWORD dwCallFlags)
{
    ATLASSERT( pMsg != NULL );
    ATLASSERT( pCodeFunc != NULL );
    ATLASSERT( dwCallFlags & CODEFLAG_PAD );
    bool bType = false;
    POSITION pos = pMsg->GetFirstPart();
    while (pos != NULL)
    {
        if (bType != false)
        {
            EmitFileError(IDS_SDL_PAD_TYPE, pMsg, 0);
            return E_FAIL;
        }
        CWSDLMessagePart *pCheck = pMsg->GetNextPart(pos);
        ATLASSERT( pCheck != NULL );
        if (pCheck->GetTypeName().GetName().GetLength() != 0)
        {
            bType = true;
        }
    }
    HRESULT hr = S_OK;
    if (dwFlags & CODEFLAG_IN)
    {
        pCodeFunc->GetNamespace().Empty();
    }
    if (bType != false)
    {
        ATLASSERT( dwCallFlags & CODEFLAG_CHAIN );
        pos = pMsg->GetFirstPart();
        CWSDLMessagePart *pPart = pMsg->GetNextPart(pos);
        ATLASSERT( pPart != NULL );
        hr = ProcessMessagePart_PAD(pPart, pCodeFunc, dwFlags, dwCallFlags);
    }
    else 
    {
        pos = pMsg->GetFirstPart();
        while (pos != NULL)
        {
            CWSDLMessagePart *pPart = pMsg->GetNextPart(pos);
            ATLASSERT( pPart != NULL );
            hr = ProcessMessagePart_PAD(pPart, pCodeFunc, dwFlags, dwCallFlags);
            if (FAILED(hr))
            {
                break;
            }
        }
    }
    if (FAILED(hr))
    {
        EmitErrorHr(E_FAIL);
    }
    return hr;
}
HRESULT CCodeTypeBuilder :: ProcessMessage_PAD ( CWSDLMessage * pMsg , CCodeFunction * pCodeFunc , DWORD dwFlags , DWORD dwCallFlags ) { ATLASSERT ( pMsg != NULL ) ; ATLASSERT ( pCodeFunc != NULL ) ; ATLASSERT ( dwCallFlags & CODEFLAG_PAD ) ; bool bType = false ; POSITION pos = pMsg -> GetFirstPart ( ) ; while ( pos != NULL ) { if ( bType != false ) { EmitFileError ( IDS_SDL_PAD_TYPE , pMsg , 0 ) ; return E_FAIL ; } CWSDLMessagePart * pCheck = pMsg -> GetNextPart ( pos ) ; ATLASSERT ( pCheck != NULL ) ; if ( pCheck -> GetTypeName ( ) . GetName ( ) . GetLength ( ) != 0 ) { bType = true ; } } HRESULT hr = S_OK ; if ( dwFlags & CODEFLAG_IN ) { pCodeFunc -> GetNamespace ( ) . Empty ( ) ; } if ( bType != false ) { ATLASSERT ( dwCallFlags & CODEFLAG_CHAIN ) ; pos = pMsg -> GetFirstPart ( ) ; CWSDLMessagePart * pPart = pMsg -> GetNextPart ( pos ) ; ATLASSERT ( pPart != NULL ) ; hr = ProcessMessagePart_PAD ( pPart , pCodeFunc , dwFlags , dwCallFlags ) ; } else { pos = pMsg -> GetFirstPart ( ) ; while ( pos != NULL ) { CWSDLMessagePart * pPart = pMsg -> GetNextPart ( pos ) ; ATLASSERT ( pPart != NULL ) ; hr = ProcessMessagePart_PAD ( pPart , pCodeFunc , dwFlags , dwCallFlags ) ; if ( FAILED ( hr ) ) { break ; } } } if ( FAILED ( hr ) ) { EmitErrorHr ( E_FAIL ) ; } return hr ; }
PAD means ParametersAsDocument
each message part represents a parameter
NOTE: if any referenced part references its schema component
using the type= attribute it MUST be the only referenced message
part, per the second example in section 2.3.1 in the WSDL 1.1 spec.
PAD means ParametersAsDocument each message part represents a parameter NOTE : if any referenced part references its schema component using the type = attribute it MUST be the only referenced message part per the second example in section 2 . 3 . 1 in the WSDL 1 . 1 spec .
// clear the namespace--it should be set from the schema // REVIEW (jasjitg): not implemented correctly in atlsoap.h!!! // REVIEW (jasjitg): comment/assert below... // must have CODEFLAG_CHAIN // referenced by type= ==> only one message part // referenced by element=