Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Dynamic Change in URL of webservice configuration.

Dynamic Change in URL of webservice configuration.

Scheduled Pinned Locked Moved ASP.NET
workspacecsharpasp-netwcftesting
13 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Smart_Boy

    there is entry in app.config on that Project (i.e. tier) but m adding reference on that project (i.e. tier) in my website which is again in same solution file. So when I add reference only dll files comes in BIN folder of website. And in DLL the path on web reference is for testing environment. How to change web reference in dll with out compiling it again for live.

    Regards, Smart Boy Mumbai, (INDIA)

    P Offline
    P Offline
    Parwej Ahamad
    wrote on last edited by
    #4

    Your web service is deployed on different environment like Deve, Test, Production, is this correct?

    Parwej Ahamad ahamad.parwej@gmail.com

    S 1 Reply Last reply
    0
    • P Parwej Ahamad

      Your web service is deployed on different environment like Deve, Test, Production, is this correct?

      Parwej Ahamad ahamad.parwej@gmail.com

      S Offline
      S Offline
      Smart_Boy
      wrote on last edited by
      #5

      yes

      Regards, Smart Boy Mumbai, (INDIA)

      P 1 Reply Last reply
      0
      • S Smart_Boy

        yes

        Regards, Smart Boy Mumbai, (INDIA)

        P Offline
        P Offline
        Parwej Ahamad
        wrote on last edited by
        #6

        Good, no need to reference the service for different environment, just change the URL of app.config file according to environment and your DLL will remain the same. Like: If you are going to deploy dev environment then your ULR will be in app.conf

        http://devdomain/Service1.asmx

        QA

        http://qadomain/Service1.asmxt

        etc.

        Parwej Ahamad ahamad.parwej@gmail.com

        S 1 Reply Last reply
        0
        • P Parwej Ahamad

          Good, no need to reference the service for different environment, just change the URL of app.config file according to environment and your DLL will remain the same. Like: If you are going to deploy dev environment then your ULR will be in app.conf

          http://devdomain/Service1.asmx

          QA

          http://qadomain/Service1.asmxt

          etc.

          Parwej Ahamad ahamad.parwej@gmail.com

          S Offline
          S Offline
          Smart_Boy
          wrote on last edited by
          #7

          Thanks for reply Parwej, I will give you example of scenario. I have one solution file say SampleSolution in that I have one Business Layer say BLayer as project in solution and one website say SampleWebsite in same solution. Now my web service is in Blayer Project. When I add web reference (i.e. web service) of testing environment in this project it creates reference in app.config file. Now when I add reference of this project in my website (i.e. SampleWebsite), DLL of this project (i.e. BLayer.ddl & BLayer.pdb) is add in my BIN folder. While deploying on testing server I will compile the website and publish it and copy these files (i.e. BLayer.ddl & BLayer.pdb) along with other files in website to my testing server. After clearing testing and moving to live server I have change the path of my web reference to live server and compile it (i.e. BLayer) again to deploy on live server again. This is what I don't want to do. Is there any way to do it without compiling BLayer again

          Regards, Smart Boy Mumbai, (INDIA)

          S P 2 Replies Last reply
          0
          • S Smart_Boy

            Thanks for reply Parwej, I will give you example of scenario. I have one solution file say SampleSolution in that I have one Business Layer say BLayer as project in solution and one website say SampleWebsite in same solution. Now my web service is in Blayer Project. When I add web reference (i.e. web service) of testing environment in this project it creates reference in app.config file. Now when I add reference of this project in my website (i.e. SampleWebsite), DLL of this project (i.e. BLayer.ddl & BLayer.pdb) is add in my BIN folder. While deploying on testing server I will compile the website and publish it and copy these files (i.e. BLayer.ddl & BLayer.pdb) along with other files in website to my testing server. After clearing testing and moving to live server I have change the path of my web reference to live server and compile it (i.e. BLayer) again to deploy on live server again. This is what I don't want to do. Is there any way to do it without compiling BLayer again

            Regards, Smart Boy Mumbai, (INDIA)

            S Offline
            S Offline
            surender m
            wrote on last edited by
            #8

            As long as if you do not modify(adding new function or updating existing function) web service , you can simply add reference in your live project once and can change the url on live server, no need to reference again and again. hope u get this.

            No Defeat Is Final Until You Stop Trying!.......

            S 2 Replies Last reply
            0
            • S surender m

              As long as if you do not modify(adding new function or updating existing function) web service , you can simply add reference in your live project once and can change the url on live server, no need to reference again and again. hope u get this.

              No Defeat Is Final Until You Stop Trying!.......

              S Offline
              S Offline
              Smart_Boy
              wrote on last edited by
              #9

              Hi, can you please elaborate it?

              Regards, Smart Boy Mumbai, (INDIA)

              1 Reply Last reply
              0
              • S Smart_Boy

                Thanks for reply Parwej, I will give you example of scenario. I have one solution file say SampleSolution in that I have one Business Layer say BLayer as project in solution and one website say SampleWebsite in same solution. Now my web service is in Blayer Project. When I add web reference (i.e. web service) of testing environment in this project it creates reference in app.config file. Now when I add reference of this project in my website (i.e. SampleWebsite), DLL of this project (i.e. BLayer.ddl & BLayer.pdb) is add in my BIN folder. While deploying on testing server I will compile the website and publish it and copy these files (i.e. BLayer.ddl & BLayer.pdb) along with other files in website to my testing server. After clearing testing and moving to live server I have change the path of my web reference to live server and compile it (i.e. BLayer) again to deploy on live server again. This is what I don't want to do. Is there any way to do it without compiling BLayer again

                Regards, Smart Boy Mumbai, (INDIA)

                P Offline
                P Offline
                Parwej Ahamad
                wrote on last edited by
                #10

                I got your point, move Web Service URL configuration from app.config to Web.Config and try to change URL according to your environment. Hope so this will work Thanks,

                Parwej Ahamad ahamad.parwej@gmail.com

                1 Reply Last reply
                0
                • S Smart_Boy

                  HI, My excuse of the subject line if wrong. I need you peoples expert advice on one of my project. Scenario: I have ASP.NET 2.0 project which is n-Tier project. In one or many tier (project in same solution as my website) I am using web services and these project are added as references. So the dll comes in my BIN folder of website. I have two different web application and web services related to each one of them i.e. one for my testing and another for my live. So when I want deploy my website on testing, I compile my code and deploy on testing web app and if testing is success then I copy my compiled code from testing to live web app. Problem: Now the problem when I change any thing in my project (i.e tier), I need to change web references for that project from development environment, compile it and deploy on testing. If testing is ok then I have to again change the web references for the web service, compile it again and deploy on live. Needed Solution: So my question is; is there any other way to just change in config file and without compile again for live I can move from testing to live. Note: Though I am using ASP.NET 2.0 version my code gets compiled in backward compatibility i.e. 1.1. Looking for to hear from experts soon..

                  Regards, Smart Boy Mumbai, (INDIA)

                  R Offline
                  R Offline
                  RPA_AshishPandey
                  wrote on last edited by
                  #11

                  To load web service in two different environment is need to change only service URL in web config in case of web site and in appsetting in case of window application. if you want to load dll of the fly (scenario based)go for reflection. code to load: System.Reflection.Assembly o = System.Reflection.Assembly.Load("mscorlib.dll"); System.Console.WriteLine(o.GetName());

                  S 1 Reply Last reply
                  0
                  • R RPA_AshishPandey

                    To load web service in two different environment is need to change only service URL in web config in case of web site and in appsetting in case of window application. if you want to load dll of the fly (scenario based)go for reflection. code to load: System.Reflection.Assembly o = System.Reflection.Assembly.Load("mscorlib.dll"); System.Console.WriteLine(o.GetName());

                    S Offline
                    S Offline
                    Smart_Boy
                    wrote on last edited by
                    #12

                    As I said I have web application.

                    Regards, Smart Boy Mumbai, (INDIA)

                    1 Reply Last reply
                    0
                    • S surender m

                      As long as if you do not modify(adding new function or updating existing function) web service , you can simply add reference in your live project once and can change the url on live server, no need to reference again and again. hope u get this.

                      No Defeat Is Final Until You Stop Trying!.......

                      S Offline
                      S Offline
                      Smart_Boy
                      wrote on last edited by
                      #13

                      But I have to compile file again for the project.

                      Regards, Smart Boy Mumbai, (INDIA)

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups