Exemplo n.º 1
0
        private void testRetrieveCustomerSales()
        {
            customer    customer = new customer();
            identityDTO ident    = new identityDTO();

            ident.documentType          = document.CPF;
            ident.documentTypeSpecified = true;
            ident.documentValue         = "82753247005";
            customer.identity           = ident;

            retrieveCustomerSalesRequest request = new retrieveCustomerSalesRequest();

            request.customer = customer;

            CustomerSalesServicesClient   client   = new CustomerSalesServicesClient();
            retrieveCustomerSalesResponse response = null;

            customer   c   = new customer();
            addressDTO add = new addressDTO();

            add.addressDetail = "RUA 1";
            add.type          = addressType.RESIDENTIAL;
            phoneDTO phone = new phoneDTO();

            phone.phoneNumber = "1143216363";
            phone.type        = phoneType.RESIDENTIAL;
            contactDTO cc = new contactDTO();

            cc.address = add;
            cc.phone   = phone;
            contactDTO[] contatos = new contactDTO[] { cc };
            c.contacts = contatos;

            sale     saleee = new sale();
            salesman ssss   = new salesman();

            //ssss.operatorName
            //saleee.

            try {
                response = client.retrieveCustomerSales(request);

                Console.WriteLine("Response = " + response);
            } catch (Exception ex) {
                Console.WriteLine("Exception to call service : " + ex);
            }
        }
Exemplo n.º 2
0
        static void Main1(string[] args)
        {
            CustomerSalesService client = new CustomerSalesService();


            UsernameToken textToken = new UsernameToken("AppCardifWsDirectSales",
                                                        "Cardfif@WsDirectSales",
                                                        PasswordOption.SendNone);

            //UsernameToken textToken = new UsernameToken(null);
            //textToken.

            try {
                //client.RequestSoapContext.Security.Tokens.Add(textToken);
                //client.RequestSoapContext.Security.
                //client.RequestSoapContext.Security.Timestamp.TtlInSeconds = 60;

                @operator oper = new @operator();
                oper.operatorName = "José da Silva";
                loginDTO loginOper = new loginDTO();
                loginOper.username = "******";
                loginOper.password = "******";
                oper.login         = loginOper;

                identityDTO iden = new identityDTO();
                iden.documentType  = document.CPF;
                iden.documentValue = "27890664001";
                customer cust = new customer();
                cust.identity = iden;

                retrieveCustomerSalesRequest request = new retrieveCustomerSalesRequest();
                request.@operator = oper;
                request.customer  = cust;

                retrieveCustomerSalesResponse response = (retrieveCustomerSalesResponse)client.retrieveCustomerSales(request);

                Console.WriteLine("Response = " + response);
            } catch (Exception ex) {
                Console.WriteLine("Exception to call service : " + ex);
            }
        }
 public retrieveCustomerSalesResponse retrieveCustomerSales(retrieveCustomerSalesRequest retrieveCustomerSalesRequest)
 {
     return(client.retrieveCustomerSales(retrieveCustomerSalesRequest));
 }