System.Net.Http.HttpClient を使用していくつかの値を POST しています。
応答文字列で、このエラーが発生します:
\"_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();