private string GetRequestXML(EntitySAPADRReserveSPRequest data) { string WSRequest = System.IO.File.ReadAllText(System.IO.Path.Combine(PATH_XML, "WSADRReserveSPRequest.xml")); string WSItemRequest = System.IO.File.ReadAllText(System.IO.Path.Combine(PATH_XML, "WSADRReserveSPItemRequest.xml")); string WSItemRequestComplete = ""; Type type = typeof(EntitySAPADRReserveSPRequestItem); foreach (var item in data.Items) { string Temp = WSItemRequest; foreach (System.Reflection.PropertyInfo propertyInfo in type.GetProperties()) { Temp = Temp.Replace((propertyInfo.Name.ToUpper() + "_VALUE"), propertyInfo.GetValue(item).ToString()); } WSItemRequestComplete += Temp + Environment.NewLine; } WSRequest = WSRequest.Replace("SATELITE_VALUE", data.Satelite); WSRequest = WSRequest.Replace("MANDANTE_VALUE", data.Mandante); WSRequest = WSRequest.Replace("IDIOMA_VALUE", data.Idioma); WSRequest = WSRequest.Replace("ITEMS_VALUE", WSItemRequestComplete); return(WSRequest); }
public EntitySAPADRReserveSPResponse Send(EntitySAPADRReserveSPRequest data) { string Body = GetRequestXML(data); string msg = "------- BusinessWSADRReserveSP Send Request Inicio -----" + Environment.NewLine; msg += Body; msg += "------- BusinessWSADRReserveSP Send Request Fin -----" + Environment.NewLine; new Security.BusinessLogger().WriteEntry(msg); var result = new ToolConsumingWS().CallWS(URL, ACTION, USER, PASSWORD, Body); msg = "------- BusinessWSADRReserveSP Send Response Inicio -----" + Environment.NewLine; msg += result; msg += "------- BusinessWSADRReserveSP Send Response Fin -----" + Environment.NewLine; new Security.BusinessLogger().WriteEntry(msg); return(GetResult(result)); }
public static void SAPADRReserveSP(EntitySAPADRReserveSPRequest data) { new BusinessWSADRReserveSP().Send(data); }