Пример #1
0
        public static AsycudaGoodsMovement.ManifestUpdateResult GoodsMovementGateIn()
        {
            var client = new AsycudaGoodsMovement.WSGoodsMovementClient("WSGoodsMovementServicePort2");

            client.ClientCredentials.UserName.UserName = @"christopher.walton";
            client.ClientCredentials.UserName.Password = @"123123";

            var gateInResult = client.gateIn(new AsycudaGoodsMovement.GatePassIn() { gatePassDate = DateTime.Now.ToString("dd/MM/yyyy"), gatePassNumber = "1234567" });
            return gateInResult;
        }
Пример #2
0
        public static AsycudaGoodsMovement.ManifestUpdateResult GoodsMovementGateIn(string x = null)
        {
            var securityElement = SecurityBindingElement.CreateUserNameOverTransportBindingElement();
            securityElement.AllowInsecureTransport = true;

            var encodingElement = new TextMessageEncodingBindingElement(MessageVersion.Soap11, Encoding.UTF8);
            var transportElement = new HttpTransportBindingElement();
            transportElement.Realm = "Basic Authentication";
            transportElement.AuthenticationScheme = System.Net.AuthenticationSchemes.Basic;

            var binding = new CustomBinding(securityElement, encodingElement, transportElement);

            var newEndpointAddress = new EndpointAddress("http://jets.jacustoms.gov.jm:80/asywsgds/test/WSGoodsMovement");
            //var binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportWithMessageCredential);
            //binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;
            //binding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;

            var client = new AsycudaGoodsMovement.WSGoodsMovementClient(binding, newEndpointAddress);
            client.ClientCredentials.UserName.UserName = @"christopher.walton";
            client.ClientCredentials.UserName.Password = @"123123";

            var gateInResult = client.gateIn(new AsycudaGoodsMovement.GatePassIn() { gatePassDate = DateTime.Now.ToString("dd/MM/yyyy"), gatePassNumber = "1234567" });
            return gateInResult;
        }