Dynamically change URL of web service - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Dynamically change URL of web service

Last post 08-17-2007 10:43 AM by Agni Jonnalagadda. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-13-2007 12:26 PM

    • admot
    • Top 500 Contributor
      Male
    • Joined on 08-09-2006
    • USA
    • Posts 51

    Dynamically change URL of web service

    I did a search through the threads and several googles but I could not find anything for this.

    I have a web service setup as a data connection.

    What I would like to do is on certain events, change the URL of the data connection in code i.e., jscript. What is required for this to occur?

    Thanks,

    Don't grow old regretting the things you didn't do.
  • 08-17-2007 10:43 AM In reply to

    Re: Dynamically change URL of web service

    Hi,

    This is how you can change the Web Service URL of a data connection.

    IXMLDOMDocument webserviceOperation;
    WebServiceAdapter2 webserviceAdapter = (WebServiceAdapter2) thisXDocument.DataAdapters[dataAdapterName];

    webserviceOperation = thisXDocument.CreateDOM();
    webserviceOperation.loadXML(webserviceAdapter.Operation);
    SetNodeValue(webserviceOperation.documentElement, "@serviceUrl", url);
    webserviceAdapter.Operation = webserviceOperation.xml;

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.