public ActionResult Index() { //XmlEncrypt(); /*Creamos instancia del cliente webservice para poder inicializar sus Operaciones o metodos. verifica el web.config validando el Endpoint, en el Tag system.serviceModel*/ QuotationCarGenericPortTypeClient client = new QuotationCarGenericPortTypeClient(); var interceptorDePeticion = new CustomInspectorBehavior(); //client.ClientCredentials.ClientCertificate.SetCertificate(StoreLocation.CurrentUser, StoreName.My, X509FindType.FindByThumbprint, "cf0b691745fd90204f387214e49ffc3e7b48f3c0"); //client.ClientCredentials.ServiceCertificate.SetDefaultCertificate(StoreLocation.CurrentUser, StoreName.My, X509FindType.FindByThumbprint, "3febb2423e8baf23ae4ee30672551e766f0a536b"); client.Endpoint.EndpointBehaviors.Add(interceptorDePeticion); //instancia del request quotationCarGenericRequest request = RequestLiberty(); //Son las variables de salida que necesita el método #quotationCarGeneric. ElementoCodificado elementoCodificado = new ElementoCodificado(); Prima datosEconomicos = new Prima(); PSU[] PSU = new PSU[0]; var response = client.quotationCarGeneric(ref request.amparo, request.automovil, request.conductor, ref request.datosGestion, request.infoRequest, request.preguntaPoliza, request.preguntaRiesgo, request.preguntaTablaRiesgo, request.preguntaTablaPoliza, request.tomadorPersonaJuridica, request.tomadorPersonaNatural, request.usuario, out elementoCodificado, out datosEconomicos, out PSU); //XmlSerializer xmlSerializer = new XmlSerializer(typeof(QuotationCarGenericRq)); //using (StringWriter textwriter = new StringWriter()) //{ // xmlSerializer.Serialize(textwriter, new QuotationCarGenericRq()); // var lmao= textwriter.ToString(); //} return View(); }
public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime) { var inspector = new CustomInspectorBehavior(); clientRuntime.MessageInspectors.Add(inspector); }