Check the UDDI service status yourself

Ever run into problems that you ‘think’ may be related to not being able to access the UDDI service? I wrote a script that should help you (and me) determine if the UDDI service is up or down.

Here is the source. Again, use at your own risk, make sure that if you are copying and pasting that you check the longer strings to make sure they haven’t newlined on you…and of course, add some error checking. It continues to amaze me how poor my formatting, commenting, and coding skills are. I only write this stuff for me usually, so I don’t care if it’s not formatted correctly, or if there are ‘better’ ways to do it. My goal is to write as little code as possible to get what I need. 😉

‘ RMS UDDI Checker – Jason Tyler
‘ Date: uhhh…night time

strURL = “

retval =  GetUDDIInfo(strURL,vbnullstring)
Wscript.Echo GetUDDIInfo(strURL,retval)

Function GetUDDIInfo(strURL,strKey)
 Set XMLHTTP = CreateObject(“MSXML2.XMLHTTP”)

 If strKey = vbnullstring Then
  strSType = “ServiceInfo”
  strEnrollment = “uuid:d3bf98c5-dea7-4503-80f1-99758c4486f4”
  strBody = “<find_service generic=’2.0′ xmlns=’urn:uddi-org:api_v2′ businessKey=”><tModelBag><tModelKey>” & strEnrollment & “</tModelKey></tModelBag></find_service>”
  strSType = “ServiceDetail”
  strEnrollment = strKey
  strBody = “<get_serviceDetail generic=’2.0′ xmlns=’urn:uddi-org:api_v2′><serviceKey>” & strEnrollment & “</serviceKey></get_serviceDetail>”
 End If
 strEnvelope = “<soap:Envelope xmlns:soap=’’><soap:Body>” & strBody & “</soap:Body></soap:Envelope>”
 strRequest = “<?xml version=’1.0′ encoding=’utf-8′?>” & strEnvelope

  .Open “POST”, strURL, False
  .setRequestHeader “content-type”, “text/xml; charset=utf-8”
  .setRequestHeader “SOAPAction”, “”””””
  .send strRequest
  ‘Wscript.Echo .responseXML.xml   ‘Uncomment this line to see the actual XML
  If .Status = 200 Then
   Set oDOM = .responseXML.documentElement
   Select Case strSType
   Case “ServiceInfo”
    Wscript.Echo “UDDI Service is up. Querying for enrollment URL…”
    Set sKeys = oDOM.getElementsbyTagName(“serviceInfos”)
   Case “ServiceDetail”
    Wscript.Echo “Enrollment URL is:”
    Set sKeys = oDOM.getElementsbyTagName(“accessPoint”)
   End Select
    For each obj in sKeys
     Select Case strSType
     Case “ServiceInfo”
     strReturn = obj.firstChild.nextSibling.nextSibling.attributes(0).value
     Case “ServiceDetail”
     strReturn = obj.FirstChild.NodeValue
     End Select
   Wscript.Echo “Cannot Connect to UDDI service. Error Code is: ” & .Status
  End If
  Set XMLHTTP = Nothing
  GetUDDIInfo = strReturn

End With
End Function


Comments (0)