1
我正在将CIM整合到MVC3应用程序中。我已经使用了发展网址添加服务引用和编码如下:MVC3应用程序中的CIM - 如何实例化ServiceSoap?
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!
p.s.我没有找到an old posting恰恰与我的问题,但很可惜,没有办法解决
我犯了同样的错误。谢谢 – Sev