System.NullReferenceException

0

There is a webservice that I need to create which needs to have some peculiarities, among them, the information of SoapAction (as below). However, when I place and debug I already get the error when testing the contents of the variable "orderID", it returns:

  

System.NullReferenceException: 'Object reference not set to an instance of an object.' == > confirmPaymentRequest was Nothing)

When I take SoapAction it works, but the client can not consume because it returns the following error:

  

System.Web.Services.Protocols.SoapException: The server did not recognize the value of the HTTP header SOAPAction: confirmPayment.

I no longer know what to do, given the very little experience in ws.

Below is the method:

<WebMethod()>
    <SoapDocumentMethod(Action:="confirmPayment")>
    Public Function confirmPayment(ByVal confirmPaymentRequest As ps.confirmPaymentRequest) As ps.confirmPaymentResponse

        Dim retorno As New ps.confirmPaymentResponse()
        Dim orderID As String = confirmPaymentRequest.orderId
        Dim status As String = confirmPaymentRequest.status
        sql = "insert into ws_payment (orderid, status) values ('" & orderID & "','" & status & "')"
        txtExec = bco.exec(clsRetAcesso.acesso(homologacao, "dbWS"), sql)
        If txtExec <> "OK" Then
            retorno.success = False
            My.Computer.FileSystem.WriteAllText(LocalLog, Date.Now & " - 0030 - Erro: " & txtExec & vbNewLine & "SQL: " & sql & vbNewLine, True)
        Else
            retorno.success = True
        End If
        Return retorno
    End Function

'------------------------------------------------
' 
    
asked by anonymous 13.09.2017 / 14:39

0 answers