public async Task <ICtsResponse> GetCtsResponseAsync() { PfWebConsultaNovedadEnvioMailClient client = new PfWebConsultaNovedadEnvioMailClient(); EndpointAddress endpoint = new EndpointAddress("http://172.28.195.215:9080/COBISCorp.eCOBIS.PfWebConsultaNovedadEnvioMail.Service/PfWebConsultaNovedadEnvioMailWSService"); client = new PfWebConsultaNovedadEnvioMailClient(PfWebConsultaNovedadEnvioMailClient.EndpointConfiguration.PfWebConsultaNovedadEnvioMailWSPort, endpoint); PfWebConsultaNovedadEnvioMailResponse response; using (var scope = new FlowingOperationContextScope(client.InnerChannel)) { // Add a SOAP Header to an outgoing request MessageHeaders messageHeadersElement = OperationContext.Current.OutgoingMessageHeaders; messageHeadersElement.Add(new Security() { UsernameToken = new UsernameToken() { Username = "******", Password = "" } }); RequestConnection requestConnection = new RequestConnection { user = "******", applicationID = "1" }; Fil fil = new Fil { inPfWebConsultaNovedadEnvioMailFil = new PfWebConsultaNovedadEnvioMailFil { isSiguiente = 0 } }; PfWebConsultaNovedadEnvioMailRequest request = new PfWebConsultaNovedadEnvioMailRequest() { requestConnection = requestConnection, fil = fil }; //response = client.PfWebConsultaNovedadEnvioMailAsync(request, fil).GetAwaiter().GetResult(); //response = await client.PfWebConsultaNovedadEnvioMailAsync(request, fil).ContinueOnScope(scope); response = await client.PfWebConsultaNovedadEnvioMailAsync(request).ContinueOnScope(scope); //response = client.PfWebConsultaNovedadEnvioMailAsync(request).GetAwaiter().GetResult(); } parser = new MailNewsParser(response.executeResponse); ICtsResponse ctsResponse = new MailNewsResponse(); return(ctsResponse); }
public PfWebConsultaNovedadEnvioMailClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : base(PfWebConsultaNovedadEnvioMailClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) { this.Endpoint.Name = endpointConfiguration.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
public PfWebConsultaNovedadEnvioMailClient(EndpointConfiguration endpointConfiguration) : base(PfWebConsultaNovedadEnvioMailClient.GetBindingForEndpoint(endpointConfiguration), PfWebConsultaNovedadEnvioMailClient.GetEndpointAddress(endpointConfiguration)) { this.Endpoint.Name = endpointConfiguration.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
public PfWebConsultaNovedadEnvioMailClient() : base(PfWebConsultaNovedadEnvioMailClient.GetDefaultBinding(), PfWebConsultaNovedadEnvioMailClient.GetDefaultEndpointAddress()) { this.Endpoint.Name = EndpointConfiguration.PfWebConsultaNovedadEnvioMailWSPort.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() { return(PfWebConsultaNovedadEnvioMailClient.GetEndpointAddress(EndpointConfiguration.PfWebConsultaNovedadEnvioMailWSPort)); }
private static System.ServiceModel.Channels.Binding GetDefaultBinding() { return(PfWebConsultaNovedadEnvioMailClient.GetBindingForEndpoint(EndpointConfiguration.PfWebConsultaNovedadEnvioMailWSPort)); }