public async Task <ECResponseBody> ResponseServiceAsync() { ECResponseBody body = new ECResponseBody(); EB.EcClient ebclient = new EB.EcClient(); WMS.EcClient wmsclient = new WMS.EcClient(); string responseJson = ""; switch (Plateform) { case "EB": EB.callServiceResponse ebresponse = await ebclient.callServiceAsync(ParamsJson, Username, Password, Service); responseJson = ebresponse.Body.response; break; case "WMS": WMS.callServiceResponse wmsresponse = await wmsclient.callServiceAsync(ParamsJson, Username, Password, Service); responseJson = wmsresponse.Body.response; break; } body = GetECResponse(responseJson); if (body.Code != "200" && body.Message != "Success") { throw new ECExceptoin(body.Service + " error:" + body.Message, body.Error); } else { return(body); } }
private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() { return(EcClient.GetEndpointAddress(EndpointConfiguration.EcSOAP)); }
private static System.ServiceModel.Channels.Binding GetDefaultBinding() { return(EcClient.GetBindingForEndpoint(EndpointConfiguration.EcSOAP)); }
public EcClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : base(EcClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) { this.Endpoint.Name = endpointConfiguration.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
public EcClient(EndpointConfiguration endpointConfiguration) : base(EcClient.GetBindingForEndpoint(endpointConfiguration), EcClient.GetEndpointAddress(endpointConfiguration)) { this.Endpoint.Name = endpointConfiguration.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
public EcClient() : base(EcClient.GetDefaultBinding(), EcClient.GetDefaultEndpointAddress()) { this.Endpoint.Name = EndpointConfiguration.EcSOAP.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }