Add-Type -Path"C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"
$xml = New-ObjectChilkat.Xml
$xml.Tag = "soapenv:Envelope"
$xml.AddAttribute("xmlns:soapenv","http://schemas.xmlsoap.org/soap/envelope/")
$xml.AddAttribute("xmlns:WL5G3N1","http://gov.fema.ipaws.services/IPAWS_CAPService/")
$xml.AddAttribute("xmlns:cap","urn:oasis:names:tc:emergency:cap:1.2")
$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:postCAPRequestTypeDef|cap:alert|cap:identifier","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:sender","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:sent","dateTime")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:status","Actual")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:msgType","Alert")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:source","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:scope","Public")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:restriction","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:addresses","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:code","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:note","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:references","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:incidents","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:language","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:category","Geo")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:event","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:responseType","Shelter")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:urgency","Immediate")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:severity","Extreme")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:certainty","Observed")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:audience","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:eventCode|cap:valueName","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:eventCode|cap:value","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:effective","dateTime")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:onset","dateTime")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:expires","dateTime")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:senderName","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:headline","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:description","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:instruction","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:web","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:contact","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:parameter|cap:valueName","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:parameter|cap:value","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:resource|cap:resourceDesc","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:resource|cap:mimeType","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:resource|cap:size","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:resource|cap:uri","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:resource|cap:derefUri","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:resource|cap:digest","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:area|cap:areaDesc","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:area|cap:polygon","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:area|cap:circle","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:area|cap:geocode|cap:valueName","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:area|cap:geocode|cap:value","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:area|cap:altitude","xml")
$xml.UpdateChildContent("soapenv:Body|WL5G3N1:postCAPRequestTypeDef|cap:alert|cap:info|cap:area|cap:ceiling","xml")
# 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 = $false
$soapRequestBody = $xml.GetXml()
$endpoint = "http://tdl.integration.aws.fema.gov/IPAWS_CAPService/IPAWS"
$soapAction = "http://gov.fema.ipaws.services/IPAWS_CAPService/postCAP"# For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
$contentType = "text/xml"
$http = New-ObjectChilkat.Http
$http.ClearHeaders()
$http.SetRequestHeader("Content-Type",$contentType)
$http.SetRequestHeader("SOAPAction",$soapAction)
$resp = New-ObjectChilkat.HttpResponse
ERROR: Undefined variable(success)
ERROR: Undefined variable(success)
if ($success -eq $false) {
$($http.LastErrorText)
$("Failed to send SOAP request.")
exit
}
# Get the XML response body.
$responseXml = New-ObjectChilkat.Xml
$resp.GetBodyXml($responseXml)
$statusCode = $resp.StatusCode
$("response status code: " + $statusCode)
# If the status code does not indicate succcess, then show the response XML,
# which probably contains error information.if ($statusCode -ne 200) {
$($responseXml.GetXml())
exit
}
$($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).
$parameterName = $responseXml.GetChildContent("*:Body|*:postCAPResponseTypeDef|*:parameterListItem|*:parameterName")
$parameterValue = $responseXml.GetChildContent("*:Body|*:postCAPResponseTypeDef|*:parameterListItem|*:parameterValue")
$subParameterName = $responseXml.GetChildContent("*:Body|*:postCAPResponseTypeDef|*:parameterListItem|*:subParaListItem|*:subParameterName")
$subParameterValue = $responseXml.GetChildContent("*:Body|*:postCAPResponseTypeDef|*:parameterListItem|*:subParaListItem|*:subParameterValue")
$ResponseOperation = $responseXml.GetChildContent("*:Body|*:postCAPResponseTypeDef|*:ResponseOperation")
$ResponseType = $responseXml.GetChildContent("*:Body|*:postCAPResponseTypeDef|*:ResponseType")