2
votes

I have a development version of Acumatica running locally, and a QA version of Acumatica in the cloud.

I wrote c# program integrating with Acumatica through SOAP. I created WSDL file for Acumatica instance running locally at http://localhost/AcumaticaERP. Now I need to make the program to connect with Acumatica production instance in the cloud. soapClient.Login method does not have Acumatica URL as a parameter.

How do I allow users to dynamically chose an instance of Acumatica to use from within my program?

1
An Acumatica user logs in via the website hosting the instance or via the mobile app by defining the URL of the instance to login. In web services, you specify the Base URL for the instance. What do you mean by "from within my program"?Brian Stevens
Are you trying to connect to an Acumatica instance from another instance or from your own custom program? I have taken the web services course at Acumatica Summit, but I am not very experienced in them yet. My usual course of action is to refer back to the training guides, and the I300 course covers connecting to Acumatica via web services using both SOAP and REST. openuni.acumatica.com/courses/integration/… If this does not help you find what you need, please clarify what "my program" is.Brian Stevens
I wrote c# program integrating with Acumatica through SOAP. Course I300 was indeed helpful. I created WSDL file for Acumatica instance running locally at localhost/AcumaticaERP. Now I need to make the program to address Acumatica production instance in the cloud. soapClient.Login method does not have Acumatica URL as a parameter.Alexander

1 Answers

1
votes

I would first suggest to look into the REST API since generally that's the recommended integration API to use.

Regarding dynamically changing the endpoint (i.e. Acumatica instance), note that the DefaultSoapClient has a number of overloaded constructors. There is one where you can specify the endpointConfigurationName (see below). This would mean that your URL should be in your web.config/appsettings of the client application as explained in more detail here: https://help-2020r1.acumatica.com/(W(1))/Help?ScreenId=ShowWiki&pageid=37613e5f-7a72-4dec-b5d9-2525951e99cf

public partial class DefaultSoapClient : System.ServiceModel.ClientBase<ConsoleApp2.ServiceReference1.DefaultSoap>, ConsoleApp2.ServiceReference1.DefaultSoap {

        public DefaultSoapClient() {
        }

        public DefaultSoapClient(string endpointConfigurationName) : 
                base(endpointConfigurationName) {
        }

        public DefaultSoapClient(string endpointConfigurationName, string remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }

        public DefaultSoapClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }

        public DefaultSoapClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(binding, remoteAddress) {
        }

In case using configuration files will not work for you, you can refer to this example whereby it is done programmatically: https://asiablog.acumatica.com/2019/01/dynamic-api-endpoint-url.html