Skip to main content
Published: November 05 2010, 3:21:00 PMUpdated: November 28 2020, 9:02:25 PM

 

 How to call ResolutionCaseManagementService - getUserCases API from .NET framework using SOAP request

  1. Add a web reference to the Finding API definition file ResolutionCaseManagementService.wsdl from

http://developer.ebay.com/webservices/resolution-case-management/latest/ResolutionCaseManagementService.wsdl

 

  1. Create a class that derives from ResolutionCaseManagementService class. For example, “CustomRCMService.cs”. Override the GetWebRequest method and set the HTTP request headers such as GLOBAL-ID, MESSAGE-PROTOCOL, SECURITY-TOKEN, OPERATION-NAME, SERVICE-NAME and SERVICE-VERSION.  

 

  1. Create an object for the required request type. For example,
       GetUserCasesRequest request = new GetUserCasesRequest();     

 

  1. Provide value for the required properties.
       
  2. Create an object to the required response type. For example,
       GetUserCasesResponse response = new GetUserCasesResponse(); 
    response = service.getUserCases(request);
  3. Explore the response object for response data.    

 

The following is the code sample for getEBPCaseDetailAPI call using C#.NET

 

Code in the Program.cs file

using System;

using System.Collections.Generic;

using System.Configuration;

using System.Text;

using RCMService.com.ebay.developer;

using System.Net;

 

namespace RCMService

{

    class Program

    {

        static void Main(string[] args)

        {

            try

            {

                // Creating an object to the ResolutionCaseManagementService class
                CustomRCMService service = new CustomRCMService();
                service.Url = @"https://svcs.sandbox.ebay.com/services/resolution/v1/ResolutionCaseManagementService";

 

                // Creating request object

                GetUserCasesRequest request = new GetUserCasesRequest();

                request.paginationInput = new PaginationInput();

                request.paginationInput.entriesPerPageSpecified = true;

                request.paginationInput.entriesPerPage = 25;

                request.paginationInput.pageNumberSpecified = true;

                request.paginationInput.pageNumber = 1;

                request.sortOrderSpecified = true;

                request.sortOrder = CaseSortOrderType.CREATION_DATE_ASCENDING;

 

                GetUserCasesResponse response = new GetUserCasesResponse();

                response = service.getUserCases(request);

                if (response.ack == AckValue.Success)

                {

                    Console.WriteLine("** Success **");

                    foreach (CaseSummaryType cases in response.cases)

                    {

                        Console.WriteLine("Case ID: " + cases.caseId);

                        Console.WriteLine("Case ItemID" + cases.item.itemId);

                        Console.WriteLine("Case ItemTitle" + cases.item.itemTitle);

                        Console.WriteLine("----------------");

                    }

                }

                else

                {

                    ErrorData[] errors = response.errorMessage;

                    foreach (ErrorData error in errors)

                    {

                        Console.WriteLine("Severity: " + error.severity);

                        Console.WriteLine("ErrorID: " + error.errorId);

                        Console.WriteLine("Message: " + error.message);

                        Console.WriteLine("-------------------------------------");

                    }

                }

            }

            catch (Exception ex)

            {

                throw ex;

            }

            Console.ReadLine();

        }

    }

}

 

 

Code in the CustomRCMService.cs file

using System;

using System.Collections.Generic;

using System.Text;

using RCMService.com.ebay.qa.c_soa1_v3a;

using System.Net;

 

namespace RCMService

{

    public class CustomRCMService : ResolutionCaseManagementService

    {

        protected override WebRequest GetWebRequest(Uri uri)

        {  

            try

            {  

                HttpWebRequest request = (HttpWebRequest)base.GetWebRequest(uri);

                request.Headers.Add("X-EBAY-SOA-SERVICE-NAME", "ResolutionCaseManagementService");

                request.Headers.Add("X-EBAY-SOA-OPERATION-NAME", "getUserCases");

                request.Headers.Add("X-EBAY-SOA-SECURITY-TOKEN", "YOUR_TOKEN_HERE");

                request.Headers.Add("X-EBAY-SOA-MESSAGE-PROTOCOL", "SOAP11");

                request.Headers.Add("X-EBAY-SOA-GLOBAL-ID", "EBAY-US");

                request.Headers.Add("X-EBAY-SOA-SERVICE-VERSION", "1.0.0");                       

                return request;

            }

            catch (Exception ex)

            {

                throw ex;

            }

        }  

    }

}

 

 

How well did this answer your question?
Answers others found helpful