• How would I join the last cross apply TOutType(XOutType) with the @name attribute from TOut(XOut)?

    See below. I am simply trying to lookup the output parameter node in the wsdl operation.

    with xmlnamespaces(

    'http://www.w3.org/2001/XMLSchema' as [xs],

    'http://schemas.xmlsoap.org/wsdl/' as [wsdl],

    'http://fwdco.com/api' as [tns]

    )

    select

    XOut.value('(@name)', 'varchar(100)')

    from

    @wsdl.nodes('/wsdl:definitions/wsdl:portType/wsdl:operation[@name= sql:variable("@ApiCall")]') XTbl(XCol)

    cross apply XCol.nodes('wsdl:input') as TIn(XIn)

    cross apply XCol.nodes('wsdl:output') as TOut(XOut)

    cross apply @wsdl.nodes('/wsdl:definitions/wsdl:types/xs:schema/xs:complexType[@name= ?? Ref XOut@Name?? )]') TOutType(XOutType)