Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / July 2004

Tip: Looking for answers? Try searching our database.

Dynamically change the WebService URL with infopath

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
moute - 27 Jul 2004 14:08 GMT
Hi,

I'm using Infopath SP1 preview. To populate a drop-down list, I have
created a WebService that return a DataSet. But I would like to be
able to change the URL of the reference to this WebService during the
execution of the form, using C# code.

I saw that under infopath the URL of the WebService is stored in the
Manifest file of the infopath project, but I didn't managed to access
it.

I have a second question that can be an solution to my first question.
Is it possible to populate an infopath drop-down list using C# code ?
If yes, it will be possible to access the webservice with codes and to
populate the drop-down list with its response.

Best regards

Adrien
moute - 29 Jul 2004 08:19 GMT
I found the answer to my pb :

You can acces this value in Read Only with the following line :
((WebServiceAdapter2)thisXDocument.DataAdapters["DataAdapter
Name"]).WSDLURL

But if you want to change this value, you must modify the Operation
property of the DataAdapter :
//Get the Data Source WebServiceAdapter object
            WebServiceAdapter2 myWSadapter =
(WebServiceAdapter2)thisXDocument.DataAdapters["DataAdapter Name"];
            //Load the xsf:input element into an XML DOM
            IXMLDOMDocument2 tempDOM =
(IXMLDOMDocument2)thisXDocument.CreateDOM();
            tempDOM.validateOnParse = false;
            tempDOM.preserveWhiteSpace = false;
           tempDOM.loadXML(myWSadapter.Operation);
            //set the WebService URL
            tempDOM.documentElement.attributes.getNamedItem("serviceUrl").text=WebServiceURL;
            //Save this setting
            myWSadapter.Operation = tempDOM.xml;

Moute

> Hi,
>
[quoted text clipped - 15 lines]
>
> Adrien

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.