【问题标题】:CIM in an MVC3 app - how to instantiate ServiceSoap?MVC3 应用程序中的 CIM - 如何实例化 ServiceSoap?
【发布时间】:2011-10-29 13:43:07
【问题描述】:

我正在将 CIM 集成到 MVC3 应用程序中。我使用开发 url 添加了一个服务引用并编码如下:

public long x()
{
    var u = this.User.Identity as IClaimsIdentity;
    var id = u.Claims.First(x => x.ClaimType == ClaimTypes.NameIdentifier);

    AuthorizeNet.CustomerProfileType cust = new AuthorizeNet.CustomerProfileType();
    cust.merchantCustomerId = id.Value;

    AuthorizeNet.MerchantAuthenticationType merch = new AuthorizeNet.MerchantAuthenticationType();
    merch.name = "8aFRk4663XMd";
    merch.transactionKey = "4MS675e62fQEdUXN";
    AuthorizeNet.ServiceSoap svc = new AuthorizeNet.ServiceSoap();
    AuthorizeNet.CreateCustomerProfileResponseType response = svc.CreateCustomerProfile(
        merch, cust, AuthorizeNet.ValidationModeEnum.none
    );
    return response.customerProfileId;
}

但是,当然,它不起作用,因为不能实例化这样的接口(.ServiceSoap 是一个接口)。示例代码引用了 .Service - 但 AFAICT 不存在。

那么这应该如何工作?

TIA - e!

附言我确实找到了 an old posting 正是我的问题,但是唉,没有解决方案

【问题讨论】:

    标签: asp.net-mvc-3 e-commerce payment-gateway authorize.net


    【解决方案1】:

    嗯...至少现在答案似乎是:不要生成 Service Reference 而是生成 Web Reference(您可以通过单击服务参考对话框的高级按钮)。

    太恶心了。

    【讨论】:

    • 我犯了同样的错误。谢谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-25
    • 1970-01-01
    • 2012-08-12
    相关资源
    最近更新 更多