I'm developing C# application to communicate with Magento. When I try to login to get Session ID to do stuff. I use C# code below.
My login code
using (MagentoService mservice = new MagentoService())
{
loginResponse = mservice.login("admin", "admin123");
}
It always throws me this error
System.ServiceModel.FaultException: 'SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://admin.mywebsite.com/index.php/api/v2_soap/index/?wsdl=1' : Premature end of data in tag html line 7
because my API request gets redirected to the website's homepage every time.
Follow this link for more info of this error: Cannot login Magento service using C# [Magento 1.9.3.3] Error: Premature end of data in tag html line 7)
Is there any way to stop my API request from getting redirected? Also is it possible to do from client without interfering Magento settings?
I asked the server owner to disable redirect from the API request endpoint URL (https://admin.mywebsite.com/index.php/api/v2_soap/index/
) and everything works fine