PDA

View Full Version : Not getting response in soap service call from excel vba



yassar060
08-16-2016, 03:11 AM
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

Kenneth Hobs
08-16-2016, 05:14 AM
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

yassar060
08-16-2016, 09:07 AM
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

yassar060
08-18-2016, 04:17 AM
Any one please help on how can i set certificates in vba.please ..this is very urgent..



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

jolivanes
08-18-2016, 07:28 PM
@yassar060.
You totally disregard Mr Kenneth Hobbs' polite request.

Kenneth Hobs
08-18-2016, 07:52 PM
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.