InfoPath and .NET - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

InfoPath and .NET

Last post 05-15-2005 09:53 PM by liorlankri. 12 replies.
Page 1 of 1 (13 items)
Sort Posts: Previous Next
  • 04-07-2005 10:26 AM

    InfoPath and .NET

    I have an Infopath project in VS.NET, My solution contains the Form project and web reference to the web service. I defined in the web service-> properties -> URL Behavior=Dynamic. That's action create to me this line in the App.confige file:



    <add key="MyWebService" value="http://MyServer/FolderName/service1.asmx" />

    When I added the web reference I get file called reference.cs whitch contain this code:

    public Service1() {



    string urlSetting = System.Configuration.ConfigurationSettings.AppSettings["MyWebService"];

    if ((urlSetting != null)) {

    this.Url = string.Concat(urlSetting, "");

    }

    else {

    this.Url = "http://MyServer/FolderName/service1.asmx ";

    }

    }

    This code supposed to search the key "MyWebService" in the App.config and to get it's value. But it's not work. When I debug it I see that the "if" condition not happen and it's go to the "else" section. I want that the Web service URL will be taken from the key in the App.config!!!!!

    By the way this is the way I create the web service in my code

    WSname.Service1 s=new WSname.Service1();

    How to do it??

  • 04-10-2005 03:27 PM In reply to

    In InfoPath the way to set any data is to put it in a seconary DOM and read that data. This data can be changed easily by exporting it out changing the data and importing it back in.

    About having a config file to have this data -> the App.Config file for a regular C# code is renamed as app.exe.config, For an Infopath solution the C# code is made into a dll. You can try by renaming the file to app.dll.config and checking if that works. This is just an idea to try out, I personally have not tried this and cannot say for sure that it will work.

    Shanthi
    InfoPathDev India
    Shanthi Reddy
  • 04-12-2005 02:36 AM In reply to

    It's not help
  • 04-12-2005 07:23 AM In reply to

    You can have the URL in a secondary dom. OnLoad of the solution get the data from the secondary DOM and then set the URL for "s" using this. This is a much better way than to have the URL in app.config for an InfoPath solution.

    Shanthi
    InfoPathDev India
    Shanthi Reddy
  • 04-12-2005 11:58 PM In reply to

    How to create the secondery DOM ?
  • 04-18-2005 12:48 PM In reply to

    Add a Dataconnection to an xml file which contains this data.

    Shanthi
    InfoPathDev India
    Shanthi Reddy
  • 05-08-2005 03:19 AM In reply to

    Can you send to me the code of this xml file, please?
  • 05-08-2005 03:43 AM In reply to

    This can be your xml file
    <ConfigurationXML>
    <URL>http://MyServer/FolderName/service1.asmx</URL>
    </ConfigurationXML>

    Agni
    InfoPathDev India
  • 05-11-2005 01:39 AM In reply to

    I created the Dataconnection to this xml file. What to do next? how to use thid Dataconnection in my form?
  • 05-11-2005 10:30 AM In reply to

    It's easy, just select it in the Data Source drop down and start binding UI controls to it. Or, you can access it via your code.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 05-14-2005 09:38 PM In reply to

    I dont understand how. How to conect the drop down to it??? I need specific method int the web service and the XML file is contain only URL to this web service!!!
    How to do it via code??
  • 05-15-2005 10:12 AM In reply to

    Liorlankri, are you expecting us to answer every simple question you ask? You can figure these out on your own. We are not here to show you how to do everything.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 05-15-2005 09:53 PM In reply to

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