Consulting

Results 1 to 6 of 6

Thread: Not getting response in soap service call from excel vba

  1. #1

    Not getting response in soap service call from excel vba

    Hi,I am trying to insert some values to db2 from excel vba macro using soap webservices.this is working fine in websphere server without any issues.but when we migrated that same code to weblogic ,it is not working.getting a blank response.i am using ms office 2013.Please find below for vba code and wsdl details.Please help me to find out why its behaving like that.


    Function SendSOAPRequest(strSoapData, action)
    On Error Resume Next
            Dim response
    'Const SoapServer = "dg010538:8127"
            'Const SoapServer = "localhost:7001"
            Const SoapServer = "sliudv64:8197"        
            Const SoapNamespace = "auditservice.aucc.app"
            Const SoapPath = "/aucc/services/AuditService"
    Dim soapAction
            Dim xmlhttp
            Dim xmlSoap
            Dim errorString
            Dim dataSheet
    soapAction = action
            errorString = ""
            If Sheets.Item("Config").Range("B11") <> "" Then
                dataSheet = 1
            Else
                dataSheet = Sheets.Item("Config").Range("B11")
            End If
    Set xmlhttp = CreateObject("Msxml2.ServerXMLHTTP.3.0")
    xmlhttp.setOption(2) = 13056
            ' Build custom HTTP header:        
            xmlhttp.Open "POST", SoapServer & SoapPath, False         
            xmlhttp.Open "POST", "https://" & SoapServer & SoapPath, False
            xmlhttp.setRequestHeader "Man", "POST " & SoapPath & " HTTP/1.1"
            xmlhttp.setRequestHeader "Host", SoapServer
            xmlhttp.setRequestHeader "SOAPAction", SoapNamespace & soapAction
            xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
    'xmlhttp.setOption(2) = xmlhttp.getOption(2) - SXH_SERVER_CERT_IGNORE_UNKNOWN_CA - 4096
            'certName = .getOption(3)
            'xmlhttp.setRequestHeader "If-Modified-Since", Now
            ' Send it using the header generated above: <br />
            xmlhttp.Send (strSoapData)
    MsgBox xmlhttp.Status
    If xmlhttp.responseXML.Text = "<result>cancelledAudit</result>" Then
                MsgBox ("This audit has been closed. Please contact your administrator")
                End
            End If
    If xmlhttp.responseXML.Text = "<result>success</result>" Then
                MsgBox ("Submit To DB Successfull1!")
                Exit Function
            End If
    End Function
    Last edited by Aussiebear; 08-21-2016 at 01:55 AM. Reason: tidy up submitted code with correct tags

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    Welcome to the forum! Please paste code between code tags. Click the # on a reply toolbar to insert tags.

    See if these help.
    http://www.vbaexpress.com/forum/showthread.php?p=252560
    http://www.vbaexpress.com/forum/showthread.php?t=34354

  3. #3
    Thank you Kenneth for ur reply.same code is working fine in local weblogic and able to submit to db2 from local.can you please help me on how we can enable TLS 1.2 in vb.

    thanks in advance

  4. #4
    Any one please help on how can i set certificates in vba.please ..this is very urgent..


    Quote Originally Posted by yassar060 View Post
    Thank you Kenneth for ur reply.same code is working fine in local weblogic and able to submit to db2 from local.can you please help me on how we can enable TLS 1.2 in vb.

    thanks in advance

  5. #5
    @yassar060.
    You totally disregard Mr Kenneth Hobbs' polite request.

  6. #6
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    Certificates is another question. I am not sure how that relates to soap. Do you mean a signed certificate?

    TLS should have been set manually by admin or IT. I guess there may be a vb.net way.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •