Microsoft Developer Network > Forums Home > Microsoft ISV Community Center Forums > Visual Basic for Applications (VBA) > VBA Web Services - adding attributes to MSXML2.IXMLDOMNodeList objects?
Ask a questionAsk a question
 

QuestionVBA Web Services - adding attributes to MSXML2.IXMLDOMNodeList objects?

  • Wednesday, October 28, 2009 7:40 PMsammouth Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    Hi folks,

    I'm using the Office 2003 Web Services Toolkit 2.01 to try and submit a web service message to an internal SOAP based web service.

    I auto-generated the VBA code from the WSDL and am now trying to feed it input:

    The service (using HL7 v3 schema for Revise Client PRPA_IN101204CA ), takes input described as the following code:

    Public Function wsm_opr_revise_client(ByVal any_PRPA_IN101204CA As MSXML2.IXMLDOMNodeList) As MSXML2.IXMLDOMNodeList
    

    I am trying to call this service using the following function, reading from a file.  I am getting an error back from the web service that says whatever I'm sending isn't valid according to the schema, but I know that the input contained in sTargetFile is a completely valid message.


    Sub SendFiletoWS(sTargetFile As String)<br/>
    <br/>
    Dim wsReviseClient As New clsws_HITSRegistriesCRXSDOT<br/>
    Dim xmlInput As MSXML2.IXMLDOMNodeList<br/>
    Dim xmlOutput As MSXML2.IXMLDOMNodeList<br/>
    Dim xmlDoc As New MSXML2.DOMDocument30<br/>
    Dim sTemp As String<br/>
           <br/>
        sTemp = GetText(sTargetFile)<br/>
        xmlDoc.LoadXml (sTemp)<br/>
            <br/>
        Set xmlInput = xmlDoc.getElementsByTagName("*")<br/>
        <br/>
        Set xmlOutput = wsReviseClient.wsm_opr_revise_client(xmlInput)<br/>
        <br/>
        End Sub
    

    To explain further, the schema requires that the message be:
    1. enclosed in <ns:PRPA_IN101204CA> tags
    2. that the <ns:PRPA_IN101204CA> tag contains numerous attributes: e.g. <ns:PRPA_IN101204CA ITSVersion="XML_1.0" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"/soap/envelope/"
    The error indicates that these attributes (e.g. ITSVersion, xmlns...) are missing from the submitted message.

    My questions are:

    (1) Is there a way to trap the messages in VBA to debug this
    (2) Is this a known limitation of the toolkit (i.e. cannot submit attributes of top level elements?)

    Thanks all!