0

我正在使用 System.Net.Http.HttpClient 发布一些值。

在响应字符串中,我收到此错误:

\"_ERROR_MESSAGE_\":\"错误调用事件:org.ofbiz.webapp.event.EventHandlerException:问题处理事件:java.lang.ClassCastException:java.lang.String 无法转换为 org.ofbiz.base.util.MessageString (java.lang.String 不能转换为 org.ofbiz.base.util.MessageString)\"

请帮忙..

这是代码

HttpClient httpClient = new HttpClient(new HttpClientHandler());
var postData = new List<KeyValuePair<string, string>> 
            {
                new KeyValuePair<string,string>("USER_FIRST_NAME",userContext.getFirstname()),
                new KeyValuePair<string,string>("CUSTOMER_EMAIL",userContext.getEmail()),
                new KeyValuePair<string,string>("CUSTOMER_COUNTRY",userContext.getCountry()),
                new KeyValuePair<string,string>("CUSTOMER_STATE1",userContext.getState()),
                new KeyValuePair<string,string>("CUSTOMER_CITY",userContext.getCity()),
                new KeyValuePair<string,string>("CUSTOMER_ADDRESS1",userContext.getStreet()),
                new KeyValuePair<string,string>("CUSTOMER_ADDRESS2",userContext.getArea()),
                new KeyValuePair<string,string>("CUSTOMER_MOBILE_CONTACT",userContext.getPhonenumber()),
                new KeyValuePair<string,string>("CUSTOMER_POSTAL_CODE",userContext.getZipcode()),
                new KeyValuePair<string,string>("PASSWORD",userContext.getPassword()),
                new KeyValuePair<string,string>("CONFIRM_PASSWORD",userContext.getCpassword()),
                new KeyValuePair<string,string>("emailProductStoreId","10112")
            };

            HttpResponseMessage response = await httpClient.PostAsync("http://******/*********/************/", new FormUrlEncodedContent(postData));
            response.EnsureSuccessStatusCode();
            String responseString = await response.Content.ReadAsStringAsync();
4

0 回答 0