
I am practicing SOAP API call using Enterprise WSDL in a Windows application on .NET 3.5. The code is very simple:
JumpStart.WSDL.SoapClient loginClient = new SoapClient();
try
{
loginClient.login(null, username, password);
}
catch (System.Exception e)
{
......
}
It keeps getting the following error and I am not sure what to check.
I also have app.config file pasted below.
Thanks,
David
================================
There was no endpoint listening at https://test.salesforce.com/services/Soap/c/32.0 that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
Server stack trace:
at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
=======================================
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="SoapBinding">
<security mode="Transport" />
</binding>
<binding name="SoapBinding1" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://test.salesforce.com/services/Soap/c/32.0"
binding="basicHttpBinding" bindingConfiguration="SoapBinding"
contract="JumpStart.WSDL.Soap" name="Soap" />
</client>
</system.serviceModel>
</configuration>
5 answers
Replace the <test > in your URL with the salesforce instance name like
https://<test>.salesforce.com/services/Soap/c/32.0
https://cs14.salesforce.com/services/Soap/c/32.0
check your instance name and replace.