CAPSoapHttp / getMessage
ASP AutoIt C C (Unicode) C++ C++ (Unicode) C# DataFlex Delphi Foxpro Go Java Node.js Objective-C Perl PHP Extension PowerBuilder Powershell PureBasic Python CkPython Ruby SQL Server Swift TCL VB.NET VB6 VBScript Xojo
integer li_rc
oleobject loo_Xml
string ls_SoapRequestBody
string ls_Endpoint
string ls_SoapAction
string ls_ContentType
oleobject loo_Http
oleobject loo_Resp
oleobject loo_ResponseXml
integer li_StatusCode
string ls_Identifier
string ls_Sender
string ls_Sent
string ls_Status
string ls_MsgType
string ls_Source
string ls_Scope
string ls_Restriction
string ls_Addresses
string ls_Code
string ls_Note
string ls_References
string ls_Incidents
string ls_Language
string ls_Category
string ls_V_event
string ls_ResponseType
string ls_Urgency
string ls_Severity
string ls_Certainty
string ls_Audience
string ls_ValueName
string ls_Value
string ls_Effective
string ls_Onset
string ls_Expires
string ls_SenderName
string ls_Headline
string ls_Description
string ls_Instruction
string ls_Web
string ls_Contact
string ls_ResourceDesc
string ls_MimeType
string ls_Size
string ls_Uri
string ls_DerefUri
string ls_Digest
string ls_AreaDesc
string ls_Polygon
string ls_Circle
string ls_Altitude
string ls_Ceiling
loo_Xml = create oleobject
li_rc = loo_Xml.ConnectToNewObject("Chilkat_9_5_0.Xml")
if li_rc < 0 then
destroy loo_Xml
MessageBox("Error","Connecting to COM object failed")
return
end if
loo_Xml.Tag = "soapenv:Envelope"
loo_Xml.AddAttribute("xmlns:soapenv","http://schemas.xmlsoap.org/soap/envelope/")
loo_Xml.AddAttribute("xmlns:req","http://gov.fema.ipaws.services/caprequest")
loo_Xml.AddAttribute("xmlns:WL5G3N1","http://gov.fema.ipaws.services/IPAWS_CAPService/")
loo_Xml.AddAttribute("xmlns:capreq","http://gov.fema.ipaws.services/caprequest")
loo_Xml.UpdateChildContent("soapenv:Header|WL5G3N1:request_Header|WL5G3N1:logonUser","xml")
loo_Xml.UpdateChildContent("soapenv:Header|WL5G3N1:request_Header|WL5G3N1:logonCogId","xml")
loo_Xml.UpdateChildContent("soapenv:Body|WL5G3N1:getMessageTypeDef|req:requestAPI","string")
loo_Xml.UpdateChildContent("soapenv:Body|WL5G3N1:getMessageTypeDef|req:requestOperation","string")
loo_Xml.UpdateChildContent("soapenv:Body|WL5G3N1:getMessageTypeDef|req:parameters|req:parameterName","string")
loo_Xml.UpdateChildContent("soapenv:Body|WL5G3N1:getMessageTypeDef|req:parameters|req:comparisonOp","string")
loo_Xml.UpdateChildContent("soapenv:Body|WL5G3N1:getMessageTypeDef|req:parameters|req:parameterValue","string")
loo_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.
loo_Xml.EmitXmlDecl = 0
ls_SoapRequestBody = loo_Xml.GetXml()
ls_Endpoint = "http://tdl.integration.aws.fema.gov/IPAWS_CAPService/IPAWS"
ls_SoapAction = "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"
ls_ContentType = "text/xml"
loo_Http = create oleobject
li_rc = loo_Http.ConnectToNewObject("Chilkat_9_5_0.Http")
loo_Http.ClearHeaders()
loo_Http.SetRequestHeader("Content-Type",ls_ContentType)
loo_Http.SetRequestHeader("SOAPAction",ls_SoapAction)
loo_Resp = loo_Http.PostXml(ls_Endpoint,ls_SoapRequestBody,"utf-8")
if loo_Http.LastMethodSuccess = 0 then
Write-Debug loo_Http.LastErrorText
Write-Debug "Failed to send SOAP request."
destroy loo_Xml
destroy loo_Http
return
end if
// Get the XML response body.
loo_ResponseXml = create oleobject
li_rc = loo_ResponseXml.ConnectToNewObject("Chilkat_9_5_0.Xml")
loo_Resp.GetBodyXml(loo_ResponseXml)
li_StatusCode = loo_Resp.StatusCode
Write-Debug "response status code: " + string(li_StatusCode)
destroy loo_Resp
// If the status code does not indicate succcess, then show the response XML,
// which probably contains error information.
if li_StatusCode <> 200 then
Write-Debug loo_ResponseXml.GetXml()
destroy loo_Xml
destroy loo_Http
destroy loo_ResponseXml
return
end if
Write-Debug loo_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).
ls_Identifier = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:identifier")
ls_Sender = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:sender")
ls_Sent = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:sent")
ls_Status = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:status")
ls_MsgType = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:msgType")
ls_Source = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:source")
ls_Scope = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:scope")
ls_Restriction = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:restriction")
ls_Addresses = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:addresses")
ls_Code = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:code")
ls_Note = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:note")
ls_References = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:references")
ls_Incidents = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:incidents")
ls_Language = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:language")
ls_Category = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:category")
ls_V_event = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:event")
ls_ResponseType = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:responseType")
ls_Urgency = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:urgency")
ls_Severity = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:severity")
ls_Certainty = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:certainty")
ls_Audience = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:audience")
ls_ValueName = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:eventCode|*:valueName")
ls_Value = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:eventCode|*:value")
ls_Effective = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:effective")
ls_Onset = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:onset")
ls_Expires = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:expires")
ls_SenderName = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:senderName")
ls_Headline = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:headline")
ls_Description = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:description")
ls_Instruction = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:instruction")
ls_Web = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:web")
ls_Contact = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:contact")
ls_ValueName = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:parameter|*:valueName")
ls_Value = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:parameter|*:value")
ls_ResourceDesc = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:resource|*:resourceDesc")
ls_MimeType = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:resource|*:mimeType")
ls_Size = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:resource|*:size")
ls_Uri = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:resource|*:uri")
ls_DerefUri = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:resource|*:derefUri")
ls_Digest = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:resource|*:digest")
ls_AreaDesc = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:area|*:areaDesc")
ls_Polygon = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:area|*:polygon")
ls_Circle = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:area|*:circle")
ls_ValueName = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:area|*:geocode|*:valueName")
ls_Value = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:area|*:geocode|*:value")
ls_Altitude = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:area|*:altitude")
ls_Ceiling = loo_ResponseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:area|*:ceiling")
destroy loo_Xml
destroy loo_Http
destroy loo_ResponseXml
Request XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="http://gov.fema.ipaws.services/caprequest" xmlns:WL5G3N1="http://gov.fema.ipaws.services/IPAWS_CAPService/" xmlns:capreq="http://gov.fema.ipaws.services/caprequest">
<soapenv:Header>
<WL5G3N1:request_Header>
<WL5G3N1:logonUser>xml</WL5G3N1:logonUser>
<WL5G3N1:logonCogId>xml</WL5G3N1:logonCogId>
</WL5G3N1:request_Header>
</soapenv:Header>
<soapenv:Body>
<WL5G3N1:getMessageTypeDef>
<req:requestAPI>string</req:requestAPI>
<req:requestOperation>string</req:requestOperation>
<req:parameters>
<req:parameterName>string</req:parameterName>
<req:comparisonOp>string</req:comparisonOp>
<req:parameterValue>string</req:parameterValue>
<req:logicalOp>string</req:logicalOp>
</req:parameters>
</WL5G3N1:getMessageTypeDef>
</soapenv:Body>
</soapenv:Envelope>
Response XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:WL5G3N1="http://gov.fema.ipaws.services/IPAWS_CAPService/" xmlns:cap="urn:oasis:names:tc:emergency:cap:1.2">
<soapenv:Header/>
<soapenv:Body>
<WL5G3N1:messageResponseTypeDef>
<cap:alert>
<cap:identifier>xml</cap:identifier>
<cap:sender>xml</cap:sender>
<cap:sent>dateTime</cap:sent>
<cap:status>Actual</cap:status>
<cap:msgType>Alert</cap:msgType>
<cap:source>xml</cap:source>
<cap:scope>Public</cap:scope>
<cap:restriction>xml</cap:restriction>
<cap:addresses>xml</cap:addresses>
<cap:code>xml</cap:code>
<cap:note>xml</cap:note>
<cap:references>xml</cap:references>
<cap:incidents>xml</cap:incidents>
<cap:info>
<cap:language>xml</cap:language>
<cap:category>Geo</cap:category>
<cap:event>xml</cap:event>
<cap:responseType>Shelter</cap:responseType>
<cap:urgency>Immediate</cap:urgency>
<cap:severity>Extreme</cap:severity>
<cap:certainty>Observed</cap:certainty>
<cap:audience>xml</cap:audience>
<cap:eventCode>
<cap:valueName>xml</cap:valueName>
<cap:value>xml</cap:value>
</cap:eventCode>
<cap:effective>dateTime</cap:effective>
<cap:onset>dateTime</cap:onset>
<cap:expires>dateTime</cap:expires>
<cap:senderName>xml</cap:senderName>
<cap:headline>xml</cap:headline>
<cap:description>xml</cap:description>
<cap:instruction>xml</cap:instruction>
<cap:web>xml</cap:web>
<cap:contact>xml</cap:contact>
<cap:parameter>
<cap:valueName>xml</cap:valueName>
<cap:value>xml</cap:value>
</cap:parameter>
<cap:resource>
<cap:resourceDesc>xml</cap:resourceDesc>
<cap:mimeType>xml</cap:mimeType>
<cap:size>xml</cap:size>
<cap:uri>xml</cap:uri>
<cap:derefUri>xml</cap:derefUri>
<cap:digest>xml</cap:digest>
</cap:resource>
<cap:area>
<cap:areaDesc>xml</cap:areaDesc>
<cap:polygon>xml</cap:polygon>
<cap:circle>xml</cap:circle>
<cap:geocode>
<cap:valueName>xml</cap:valueName>
<cap:value>xml</cap:value>
</cap:geocode>
<cap:altitude>xml</cap:altitude>
<cap:ceiling>xml</cap:ceiling>
</cap:area>
</cap:info>
</cap:alert>
</WL5G3N1:messageResponseTypeDef>
</soapenv:Body>
</soapenv:Envelope>