Dim xml As NewChilkat.Xml
xml.Tag = "soapenv:Envelope"
xml.AddAttribute("xmlns:soapenv","http://schemas.xmlsoap.org/soap/envelope/")
xml.AddAttribute("xmlns:req","http://gov.fema.ipaws.services/caprequest")
xml.AddAttribute("xmlns:WL5G3N1","http://gov.fema.ipaws.services/IPAWS_CAPService/")
xml.AddAttribute("xmlns:capreq","http://gov.fema.ipaws.services/caprequest")
xml.UpdateChildContent("soapenv:Header|WL5G3N1:request_Header|WL5G3N1:logonUser","xml")
xml.UpdateChildContent("soapenv:Header|WL5G3N1:request_Header|WL5G3N1:logonCogId","xml")
xml.UpdateChildContent("soapenv:Body|WL5G3N1:getMessageTypeDef|req:requestAPI","string")
xml.UpdateChildContent("soapenv:Body|WL5G3N1:getMessageTypeDef|req:requestOperation","string")
xml.UpdateChildContent("soapenv:Body|WL5G3N1:getMessageTypeDef|req:parameters|req:parameterName","string")
xml.UpdateChildContent("soapenv:Body|WL5G3N1:getMessageTypeDef|req:parameters|req:comparisonOp","string")
xml.UpdateChildContent("soapenv:Body|WL5G3N1:getMessageTypeDef|req:parameters|req:parameterValue","string")
xml.UpdateChildContent("soapenv:Body|WL5G3N1:getMessageTypeDef|req:parameters|req:logicalOp","string")
' In a SOAP HTTP request, including the XML declaration (<?xml version="1.0" encoding="UTF-8"?>) in the XML body is generally not required.
xml.EmitXmlDecl = FalseDim soapRequestBody As String = xml.GetXml()
Dim endpoint As String = "http://tdl.integration.aws.fema.gov/IPAWS_CAPService/IPAWS"Dim soapAction As String = "http://gov.fema.ipaws.services/IPAWS_CAPService/getMessage"' For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"Dim contentType As String = "text/xml"Dim http As NewChilkat.Http
http.ClearHeaders()
http.SetRequestHeader("Content-Type",contentType)
http.SetRequestHeader("SOAPAction",soapAction)
Dim resp AsChilkat.HttpResponse = http.PostXml(endpoint,soapRequestBody,"utf-8")
If (http.LastMethodSuccess = False) Then
Debug.WriteLine(http.LastErrorText)
Debug.WriteLine("Failed to send SOAP request.")
Exit SubEnd If' Get the XML response body.Dim responseXml As NewChilkat.Xml
resp.GetBodyXml(responseXml)
Dim statusCode As Integer = resp.StatusCode
Debug.WriteLine("response status code: " & statusCode)
' If the status code does not indicate succcess, then show the response XML,
' which probably contains error information.If (statusCode <> 200) Then
Debug.WriteLine(responseXml.GetXml())
Exit SubEnd If
Debug.WriteLine(responseXml.GetXml())
' Parse the successful SOAP response XML.' This is a sample of the response XML, but the namespace prefixes will be different.
' We can parse the result using "*" for the namespace prefixes (see below).Dim identifier As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:identifier")
Dim sender As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:sender")
Dim sent As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:sent")
Dim status As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:status")
Dim msgType As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:msgType")
Dim source As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:source")
Dim scope As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:scope")
Dim restriction As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:restriction")
Dim addresses As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:addresses")
Dim code As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:code")
Dim note As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:note")
Dim references As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:references")
Dim incidents As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:incidents")
Dim language As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:language")
Dim category As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:category")
Dim v_event As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:event")
Dim responseType As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:responseType")
Dim urgency As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:urgency")
Dim severity As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:severity")
Dim certainty As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:certainty")
Dim audience As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:audience")
Dim valueName As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:eventCode|*:valueName")
Dim value As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:eventCode|*:value")
Dim effective As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:effective")
Dim onset As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:onset")
Dim expires As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:expires")
Dim senderName As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:senderName")
Dim headline As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:headline")
Dim description As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:description")
Dim instruction As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:instruction")
Dim web As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:web")
Dim contact As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:contact")
valueName = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:parameter|*:valueName")
value = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:parameter|*:value")
Dim resourceDesc As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:resource|*:resourceDesc")
Dim mimeType As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:resource|*:mimeType")
Dim size As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:resource|*:size")
Dim uri As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:resource|*:uri")
Dim derefUri As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:resource|*:derefUri")
Dim digest As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:resource|*:digest")
Dim areaDesc As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:area|*:areaDesc")
Dim polygon As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:area|*:polygon")
Dim circle As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:area|*:circle")
valueName = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:area|*:geocode|*:valueName")
value = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:area|*:geocode|*:value")
Dim altitude As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:area|*:altitude")
Dim ceiling As String = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:area|*:ceiling")