我正在开发一个C#Winapp,用于连接Magento以使用SOAP API V2创建客户数据,并在我的程序尝试将客户数据发送到Magento服务器时遇到错误like this。
如果我使用http
发送它,但它无法使用https
,我需要使用https
。如何使它工作?
这是我发送数据的代码:
PortTypeClient mservice = new PortTypeClient();
var mlogin = mservice.login("User", "apikey");
int newCustomerCreateID = 0;
filters myfilter = new filters();
// Create Customer
customerCustomerEntityToCreate customerCreate = new customerCustomerEntityToCreate();
//fill attributes
customerCreate.email = SessionStore.getEmail();
customerCreate.telephone = Int32.Parse(SessionStore.getTel());
customerCreate.password = SessionStore.getTel();
customerCreate.firstname = SessionStore.getFName();
customerCreate.lastname = SessionStore.getLName();
customerCreate.middlename = "";
customerCreate.id_card = Int32.Parse(SessionStore.getIdCard());
customerCreate.store_id = 1;
customerCreate.store_idSpecified = true;
customerCreate.website_id = 1;
customerCreate.website_idSpecified = true;
customerCreate.group_id = 1;
customerCreate.group_idSpecified = true;
//customerCreate.suffix = "P";
customerCreate.prefix = SessionStore.getPrefix();
customerCreate.dob = SessionStore.getBdate();
//customerCreate.taxvat = "123456";
customerCreate.gender = Int32.Parse(SessionStore.getGenderNum()); //1-Male;2-Female
customerCreate.genderSpecified = true;
newCustomerCreateID = mservice.customerCustomerCreate(mlogin, customerCreate);
mservice.endSession(mlogin);