Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
 private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress()
 {
     return(EcClient.GetEndpointAddress(EndpointConfiguration.EcSOAP));
 }
Ejemplo n.º 3
0
 private static System.ServiceModel.Channels.Binding GetDefaultBinding()
 {
     return(EcClient.GetBindingForEndpoint(EndpointConfiguration.EcSOAP));
 }
Ejemplo n.º 4
0
 public EcClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) :
     base(EcClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress)
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }
Ejemplo n.º 5
0
 public EcClient(EndpointConfiguration endpointConfiguration) :
     base(EcClient.GetBindingForEndpoint(endpointConfiguration), EcClient.GetEndpointAddress(endpointConfiguration))
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }
Ejemplo n.º 6
0
 public EcClient() :
     base(EcClient.GetDefaultBinding(), EcClient.GetDefaultEndpointAddress())
 {
     this.Endpoint.Name = EndpointConfiguration.EcSOAP.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }