2

I need to dynamically set the endpoint for my Magento implementation using C# but can't override C#'s default check of the endpoint path and credentials in the web.config.

Does anyone know how to do this?

My service currently looks like this:

 using (Mage_Api_Model_Server_V2_HandlerPortTypeClient proxy = new Mage_Api_Model_Server_V2_HandlerPortTypeClient("NameOfEndpoint", ConnectionCurrent.WsdlPath))
 {
      string sessionKey = proxy.startSession();
      string loginSession = proxy.login(ConnectionCurrent.UserName, ConnectionCurrent.Password);

 ...

At Login, it then says that I have two endpoints configured.

I've looked everywhere but can't find a solution.

Thanks!!

Peter
  • 3,916
  • 1
  • 22
  • 43

1 Answers1

0

This is using WCF but it is similarly done with the older web services implementation:

EndpointAddress endPoint = new EndpointAddress("http://some.endpoint.addr");
Binding binding = new WSHttpBinding(SecurityMode.None);
var service = new Mage_Api_Model_Server_V2_HandlerPortTypeClient(binding, endpoint);
Janus Tøndering
  • 914
  • 6
  • 13