Exemple #1
0
        public ServicePricingLookupResult ServicePricingLookup(ServicePricingLookupRequestBody request)
        {
            var url      = string.Format("{0}/{1}", this.BaseUrl, "ServiceAPI.asmx");
            var envelope = new Envelope <ServicePricingLookupRequestBody>
            {
                Header = new Header(),
                Body   = request
            };

            AddSecurityHeaderToEnvelope(envelope);

            var manualSoapClient = new ManualSoapClient(OnManualSoapSend, OnManualSoapReceive);
            var response         =
                manualSoapClient.ExecuteRequest <ServicePricingLookupResponseBody, ServicePricingLookupRequestBody>(url,
                                                                                                                    SERVICE_PRICING_LOOKUP_ACTION, envelope);

            return(response.Body.ServicePricingLookupResponse.ServicePricingLookupResult);
        }
Exemple #2
0
        public void Verify_call_works()
        {
            // arrange
            var api     = Credentials.GetAPI();
            var request = new ServicePricingLookupRequestBody
            {
                ServicePricingLookup = new ManualSoap.Requests.ServicePricingLookup
                {
                    Dealer = new Dealer
                    {
                        EnterpriseCode = Credentials.EnterpriseCode,
                        CompanyNumber  = Credentials.DealerNumber
                    },
                    RequestInfo = new ServicePricingLookupRequestInfo
                    {
                        ServicePricingLookupLabors = new List <ServicePricingLookupLabor>
                        {
                            new ServicePricingLookupLabor
                            {
                                LaborOpCode   = "LABOR2",
                                ServiceType   = "BS",
                                PaymentMethod = "C",
                                Manufacturer  = "GM",
                                LaborHours    = 2
                            },
                            new ServicePricingLookupLabor
                            {
                                LaborOpCode   = "LABORXXX",
                                ServiceType   = "MR",
                                PaymentMethod = "C",
                                Manufacturer  = "GM",
                                LaborHours    = 2
                            }
                        }
                    }
                }
            };

            // act
            var response = api.ServicePricingLookup(request);

            // assert
            Assert.NotNull(response);
        }