Click here to Skip to main content
15,920,111 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am calling the Request in the string data and passing the endpoint URL but i am getting the error-The remote server returned an error: (500) Internal Server Error.

What I have tried:

   using (var client = new WebClient())
            {
                // read the raw SOAP request message from a file
                string data = @"<soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:urn=""urn:enterprise.soap.sforce.com""><soapenv:Header><urn:LoginScopeHeader><urn:organizationId>organizationid</urn:organizationId>
       <!--Optional:-->
         <urn:portalId></urn:portalId>
      </urn:LoginScopeHeader>
   </soapenv:Header>
   <soapenv:Body>
      <urn:login>
         <urn:username>username</urn:username>
         <urn:password>password</urn:password>
      </urn:login>
   </soapenv:Body>
</soapenv:Envelope>";

                //client.Headers.Add("Content-Type", "application/soap+xml;  charset=utf-8");
                // The SOAPAction header indicates which method you would like to invoke
                // and could be seen in the WSDL: <soap:operation soapAction="..." /> element
                // client.Headers.Add("SOAPAction", "http://ws.vantiv.com/Shared/CardPayment/v2/AuthorizeKeyedCardPayment");
                try
                {
                    var response = client.UploadString("https://test.salesforce.com/services/Soap/c/40.0/0DF4B00000000as", data);
                     Util.ErrorWriting(DateTime.Now + " :::: " + MethodBase.GetCurrentMethod() + " :::: " + response);

                }
                catch (Exception ex)
                {
                    // return ex.Message;
                    Util.ErrorWriting(DateTime.Now + " :::: " + MethodBase.GetCurrentMethod() + " :::: " + ex.Message);
                }
            }
Posted
Updated 17-Jul-17 3:15am
Comments
Richard MacCutchan 17-Jul-17 6:47am    
You need to ask the owners of the server to check their logs.
DbTalwar 17-Jul-17 7:42am    
that error is because of this https://test.salesforce.com/services/Soap/c/40.0/0DF4B00000000as internally used in the local server?
Richard MacCutchan 17-Jul-17 8:21am    
Sorry, but there is no way anyone here can guess what your server is trying to do.

1 solution

Seeing how this appears to be a salesforce question base on this url test.salesforce.com/services/Soap/c/40.0/0DF4B00000000as you probably need to contact salesforce support/developer support to see if the issue is with your SOAP request or if it is a configuration issue within salesforce.

We cannot tell you what the issue is as we don't manage that server, nor do we know anything about your project. So the issue could be on your end with an incorrectly formatted SOAP envelope or it could be a configuration/who knows what problem on the test.salesforce.com server side.
 
Share this answer
 
Comments
Padma Sree 1-Jun-23 5:47am    
The remote server returned 500

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900