0

I have added a reference of a soap webservice in my visual studio 2012. Working for the first time with is a little bit hard because it gave an error and I don't know how to resolve it. Any hints? Below is my code:

 Dim obj() As MobileApp.ClaimsDetails
 Dim respClaimsDetails As MobileApp.BAMobileAppSoap
 Dim a As New MobileApp.MVGetClaimsDetailsAllRequest
 a.strVisaID = 123
 Dim b As New MobileApp.MVGetClaimsDetailsAllResponse
 b = respClaimsDetails.MVGetClaimsDetailsAll(a)
 obj = b.MVGetClaimsDetailsAllResult

MobileApp is the name of my webservice. The exception thrown is a null reference in respClaimsDetails.MVGetClaimsDetailsAll(a). I know that MobileApp.BAMobileAppSoap is an interface that needs a Concrete Implementation to complete my work, but I have at least 50 interfaces, I cannot concrete them all... I am sure there is another way to call webservice and resolve this issue ... any help, any links or documentation concerning added webservices in visual studio 2012 are appreciated. Regards.

Mlle 116
  • 1,149
  • 4
  • 20
  • 53
  • Replace **Dim respClaimsDetails As MobileApp.BAMobileAppSoap** by **Dim respClaimsDetails As NEW MobileApp.BAMobileAppSoap** – romulus001 Aug 26 '16 at 08:02
  • This is an interface new does not work – Mlle 116 Aug 26 '16 at 08:04
  • I discovered a class that I can work with as : Dim respClaimsDetails As New MobileApp.BAMobileAppSoapClient, but when I run my code it returns this error: invalidoperationexception was unhandled by user code. Any idea about what is happening? – Mlle 116 Aug 26 '16 at 08:09

1 Answers1

0

OK finally I could solve it : Instad of using an interface there a class for client that takes a parameter "BAMobileAppSoap" which is the enpoint name in web.config, and then I could call my methods easily:

Dim respClaimsDetails As New MobileApp.BAMobileAppSoapClient("BAMobileAppSoap")
Dim res = respClaimsDetails.MVGetClaimsDetailsAll(claimNum)
Mlle 116
  • 1,149
  • 4
  • 20
  • 53