2

我需要使用 C# 为我的 Magento 实现动态设置端点,但不能覆盖 C# 在 web.config 中对端点路径和凭据的默认检查。

有谁知道如何做到这一点?

我的服务目前看起来像这样:

 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);

 ...

在登录时,它会说我配置了两个端点。

我到处寻找,但找不到解决方案。

谢谢!!

4

1 回答 1

0

这是使用 WCF,但它与旧的 Web 服务实现类似:

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);
于 2011-09-13T15:19:48.650 回答