Setting WebService query parameter via code - InfoPath Dev
in

InfoPath Dev

Setting WebService query parameter via code

Last post 06-21-2005 07:25 PM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-16-2005 04:57 PM

    Setting WebService query parameter via code

    I want to be able to set the query parameter of the webservice.so I have done this:


    Dim fieldValue
    fieldValue = thisXDocument.DOM.selectSingleNode("/my:myFields/my:field3")
    'Get a reference to the Web Service data connection
    Dim theDataObject
    theDataObject = thisXDocument.DataObjects.Item("GetPatientCDA").DOM
    'Set the SelectionNamespaces property so you can navigate the web service XML()
    theDataObject.setProperty("SelectionNamespaces", "xmlns:dfs=""http:/schemas.microsoft.com/office/infopath/2003/dataFormSolution"" " + "xmlns:tns=""http:/tempuri.org/""")

    'Get a reference to the parameter in the web service
    Dim queryValue1
    queryValue1 = theDataObject.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/tns:GetPatientCDA/tns:given")

    'Set the parameter value to dropdown box selection
    queryValue1.text = fieldValue.text
    Dim queryValue2
    queryValue2 = theDataObject.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/tns:GetPatientCDA/tns:family")

    'Set the parameter value to dropdown box selection
    queryValue1.text = fieldValue.text
    theDataObject.Query()

    But, It fails at SelectionNamespaces ?! here is the error :
    System.MethodAccessException
    Attempt to access the method failed.
    at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess)


    Is there a way to confirm this namespace ? does the manifest have it ?

    Any help appreciated.
    Thanks.
  • 06-21-2005 07:25 PM In reply to

    Re: Setting WebService query parameter via code

    Hi Richard,
    Any more info on the error code? Looks like the property may not support modifying in code.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.