Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8457327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:47:01+00:00 2026-06-10T12:47:01+00:00

I have a MVC application which i m integrating with slaesforce. And it is

  • 0

I have a MVC application which i m integrating with slaesforce. And it is working fine, salesforce provied WSDL which is used in/as a web reference in MVC application and successfully access salesforce data. Now i m in a situation where i need to use salesforce sandbox.

So i have two WSDLs generated from Salesforce one for Production and another for Sandbox. But can not add both to the MVC project at the same time as both have same objects.

What i need to do is to changes Webservice Url or something on some condition to use Production WSDL one time and Sandbox WSDL another time.

So it would be something like this

//The Action used in salesforce site to send submit order email
public string SendSubmitOrderEmail(string opportunityId,bool isSandbox)
{
   if(isSandbox)
   {
      SforceService sf = new SforceService();
      sf.Url = "https://test.salesforce.com/services/Soap/";
   }
   else
   {
      SforceService sf = new SforceService();
      sf.Url = "https://login.salesforce.com/services/Soap/";
   }
}     

OR can i change webservice settings in webconfig?

<applicationSettings>
<ItineraryBuilder.Properties.Settings>
  <setting name="ItineraryBuilder_SalesForceService_SforceService"
    serializeAs="String">
    <value>https://login.salesforce.com/services/Soap/c/25.0/0DFd00Wa6</value>
  </setting>
</ItineraryBuilder.Properties.Settings>
</applicationSettings>

Not sure how to do.

Thanks for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:47:03+00:00Added an answer on June 10, 2026 at 12:47 pm

    Thanks all,

    Updating Web reference at runtime works fine

    SforceService sf = new SforceService();
    sf.Url = "test.salesforce.com/services/Soap/c/25.0/0DFd00000000Wa6"
    

    what i was doing wrong, the “sf” was not passed to API class which is used in creating connection.

    i got solution in my another question here

    Update web.config applicationSettings programmatically with C# (MVC)

    Thanks again.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Clustered Windows Hosting site which currently hosts an MVC Web Application
i have a asp.net mvc application which uploads several xml files that are used
I have an ASP.Net MVC application which runs fine on my local development machine.
I have an .Net MVC application which runs fine if I use the build
I have a form within my Asp.Net MVC application which returns a Null reference
I have a Spring MVC web application which provides RESTful web services via a
I have an MVC application which uses Windsor everywhere and it works fine everywhere
I have a MVC web application which shows some information about users in our
I have MVC webApi application which works with Unity . I have to resolve
I have an MVC application which is my marketing website, and two other regular

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.