web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Dynamically switching AIF environments in Visual Studio? AX 2012

(0) ShareShare
ReportReport
Posted on by 295

Hello,

I'm trying to figure out a way to change AX environments using AIF in an import tool I'm developing in Visual Studio.

In AX 2012, I got to System Administration -> Setup -> Services and Application Integration Framework -> Inbound Ports to set up a nettcp adapter to generate a WSDL URI address I can use in Visual Studio by adding a service reference.

That works well except for the fact that I don't know how to switch environments on the fly. For example, if I import a product using that port that is directed to an AX test environment, I have to go into the code and switch out the reference an exact same service in an AX production environment.

Is there anyway to switch the WSDL URI address  of the service when a dropdown list containing a list of possible environments is changed?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    640579632b5c4e6780a624c4771b6f93 Profile Picture
    4,730 on at

    2 ways for achieving this task  :

    1-In the app config file you will see endpoint and servicePrincipalName tag change the values there or

    2 -ServiceClient object has 4 overloaded method which accepts endpoint and principal name

  • CJ 373 Profile Picture
    295 on at

    I looked in the app.config file and used the added the 'string ConfigurationName' to the serviceclient object. I can change which string to use dynamically. Thank you!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans