Skip to main content
Published: July 25 2011, 7:55:00 AMUpdated: November 28 2020, 9:57:26 PM

 

 How to call ResolutionCaseManagementService - getUserCases API from VB.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.vb”. 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.
  2. Create an object for the required request type. For example,
       Dim request As New GetEBPCaseDetailRequest()
  3. Provide value for the required properties.
       
  4. Create an object to the required response type. For example,
       Dim response As GetEBPCaseDetailResponse = service.getEBPCaseDetail(request)
  5. Explore the response object for response data.    

 

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

 

Code in the Program.vb file

Imports RCM_Service_VB_Samples.com.ebay.developer

Module Module1

    Sub Main()
        Try
            ' Creating an object to the ResolutionCaseManagementService class
            Dim service As New CustomRCMService()
            service.Url = "https://svcs.sandbox.ebay.com/services/resolution/v1/ResolutionCaseManagementService"

            ' Creating request object for GetEBPCaseDetailRequest Call
            Dim request As New GetEBPCaseDetailRequest()
            request.caseId = New CaseIdType()
            request.caseId.id = "1234567890"
            request.caseId.type = New CaseType()
            request.caseId.type = CaseType.EBP_INR

            Dim response As GetEBPCaseDetailResponse = service.getEBPCaseDetail(request)
            If response.ack = AckValue.Success Then
                Console.WriteLine("** Success **")
                Console.WriteLine("ItemID: " + response.caseSummary.item.itemId)
                Console.WriteLine("Title: " + response.caseSummary.item.itemTitle)
                Console.WriteLine("CaseID: " + response.caseSummary.caseId.id)
                Console.WriteLine("CaseAmount: " + Convert.ToString(response.caseSummary.caseAmount.Value))
            Else
                Dim errors As ErrorData() = response.errorMessage
                For Each [error] As ErrorData In errors
                    Console.WriteLine("Severity: " + [error].severity)
                    Console.WriteLine("ErrorID: " + [error].errorId)
                    Console.WriteLine("Message: " + [error].message)
                    Console.WriteLine("-------------------------------------")
                Next
            End If
        Catch ex As Exception
            Throw ex
        End Try
        Console.ReadLine()
    End Sub

End Module

 

 

Code in the CustomRCMService.vb file

Imports System.Configuration
Imports System.Net
Imports RCM_Service_VB_Samples.com.ebay.developer

Public Class CustomRCMService
    Inherits ResolutionCaseManagementService
    Protected Overrides Function GetWebRequest(ByVal uri As Uri) As WebRequest
        Try
            Dim request As HttpWebRequest = DirectCast(MyBase.GetWebRequest(uri), HttpWebRequest)
            request.Headers.Add("X-EBAY-SOA-SERVICE-NAME", "ResolutionCaseManagementServiceV1")
            request.Headers.Add("X-EBAY-SOA-OPERATION-NAME", "getEBPCaseDetail")
            request.Headers.Add("X-EBAY-SOA-SECURITY-TOKEN", "YOUR_TOKEN_HERE")
            request.Headers.Add("X-EBAY-SOA-MESSAGE-PROTOCOL", "SOAP12")
            request.Headers.Add("X-EBAY-SOA-GLOBAL-ID", "EBAY-US")
            request.Headers.Add("X-EBAY-SOA-SERVICE-VERSION", "1.0.0")
            Return request
        Catch ex As Exception
            Throw ex
        End Try
    End Function
End Class

 

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