SOAP request and response problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MarcoBorn
    New Member
    • Aug 2015
    • 1

    #1

    SOAP request and response problem

    Hello Forum,
    I use VB.NET in SharpDevelop to create my first SOAP client. I set a web reference to the WSDL and got a class generated which offers me request, response, clientheader and service elements. (The clientheader is used to store username, password and mailadress for authentificatio n.)
    Then in my class I made the following:

    Code:
    Sub Button1Click(sender As Object, e As EventArgs)
      Dim Myrequest As New MyNamespace.addRequest 
      Dim Myrespons As New MyNamespace.addResponse
      Dim Myheader As New MyNamespace.clientHeader
      Dim Myservic As New MyNamespace.service
    		
      Myheader.clientName = "Username"
      Myheader.clientEmail ="user@test.de"
      Myheader.clientPassword = "password"
      Myrequest.city="city"
      Myrequest.clientHeader = myheader
      Myrequest.country="country"
      Myrequest.district="district"
      Myrequest.houseNumber="number"
      Myrequest.postalCode ="postalcode"
      Myrequest.street="street"
      Myrequest.subscriberId="12345"
      Myresponse = Myservice.addSubscriber(Myrequest)
      MsgBox(Myresponse.resultMessage)
    End Sub
    When calling the line Myresponse=Myse rvice.addSubscr iber(Myrequest) my client crashes. How I can send the request to the server and retrieve the response for further use? What I'm doing wrong?

    Any help is appreciated.

    Thanks a lot in advance,
    Marco
    Last edited by Rabbit; Aug 11 '15, 05:14 PM. Reason: Fixed code tags
Working...