Exemple #1
0
        public PartAddResponse AddPart(PartAdd partAdd)
        {
            var contentId = Guid.NewGuid().ToString();

            var envelope = new Envelope <StarRequestBody <PartAddContent> >
            {
                Header = new Header(),
                Body   = new StarRequestBody <PartAddContent>
                {
                    ProcessMessage = new ProcessMessage <PartAddContent>
                    {
                        Payload = new Payload <PartAddContent>
                        {
                            Content = new PartAddContent
                            {
                                Id      = contentId,
                                PartAdd = partAdd
                            }
                        }
                    }
                }
            };

            AddSecurityHeaderToEnvelope(envelope);
            AddPayloadManifestToHeader(envelope, contentId, "PartAdd");

            var manualSoapClient = new ManualSoapClient(OnManualSoapSend, OnManualSoapReceive);
            var response         = manualSoapClient
                                   .ExecuteRequest <StarResponseBody <PartAddResponseContent>, StarRequestBody <PartAddContent> >
                                       (string.Format("{0}/{1}", this.BaseUrl, "WebService.asmx"),
                                       STAR_STANDARD_PROCESS_MESSAGE_ACTION, envelope);

            return(response.Body.ProcessMessageResponse.Payload.Content.PartAddResponse);
        }
Exemple #2
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);
        }