SOAP WSDL Generate Code

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
Dim xml As New ChilkatXml
xml.Tag = "soapenv:Envelope"
success = xml.AddAttribute("xmlns:soapenv","http://schemas.xmlsoap.org/soap/envelope/")
success = xml.AddAttribute("xmlns:req","http://gov.fema.ipaws.services/caprequest")
success = xml.AddAttribute("xmlns:WL5G3N1","http://gov.fema.ipaws.services/IPAWS_CAPService/")
success = 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 = 0
Dim soapRequestBody As String
soapRequestBody = xml.GetXml()

Dim endpoint As String
endpoint = "http://tdl.integration.aws.fema.gov/IPAWS_CAPService/IPAWS"
Dim soapAction As String
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"
Dim contentType As String
contentType = "text/xml"

Dim http As New ChilkatHttp

http.ClearHeaders 
http.SetRequestHeader "Content-Type",contentType
http.SetRequestHeader "SOAPAction",soapAction

Dim resp As ChilkatHttpResponse
Set resp = http.PostXml(endpoint,soapRequestBody,"utf-8")
If (http.LastMethodSuccess = 0) Then
    Debug.Print http.LastErrorText
    Debug.Print "Failed to send SOAP request."
    Exit Sub
End If

' Get the XML response body.
Dim responseXml As New ChilkatXml
success = resp.GetBodyXml(responseXml)

Dim statusCode As Long
statusCode = resp.StatusCode
Debug.Print "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.Print responseXml.GetXml()
    Exit Sub
End If

Debug.Print 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
identifier = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:identifier")
Dim sender As String
sender = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:sender")
Dim sent As String
sent = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:sent")
Dim status As String
status = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:status")
Dim msgType As String
msgType = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:msgType")
Dim source As String
source = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:source")
Dim scope As String
scope = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:scope")
Dim restriction As String
restriction = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:restriction")
Dim addresses As String
addresses = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:addresses")
Dim code As String
code = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:code")
Dim note As String
note = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:note")
Dim references As String
references = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:references")
Dim incidents As String
incidents = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:incidents")
Dim language As String
language = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:language")
Dim category As String
category = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:category")
Dim v_event As String
v_event = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:event")
Dim responseType As String
responseType = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:responseType")
Dim urgency As String
urgency = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:urgency")
Dim severity As String
severity = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:severity")
Dim certainty As String
certainty = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:certainty")
Dim audience As String
audience = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:audience")
Dim valueName As String
valueName = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:eventCode|*:valueName")
Dim value As String
value = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:eventCode|*:value")
Dim effective As String
effective = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:effective")
Dim onset As String
onset = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:onset")
Dim expires As String
expires = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:expires")
Dim senderName As String
senderName = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:senderName")
Dim headline As String
headline = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:headline")
Dim description As String
description = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:description")
Dim instruction As String
instruction = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:instruction")
Dim web As String
web = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:web")
Dim contact As String
contact = 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
resourceDesc = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:resource|*:resourceDesc")
Dim mimeType As String
mimeType = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:resource|*:mimeType")
Dim size As String
size = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:resource|*:size")
Dim uri As String
uri = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:resource|*:uri")
Dim derefUri As String
derefUri = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:resource|*:derefUri")
Dim digest As String
digest = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:resource|*:digest")
Dim areaDesc As String
areaDesc = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:area|*:areaDesc")
Dim polygon As String
polygon = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:area|*:polygon")
Dim circle As String
circle = 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
altitude = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:area|*:altitude")
Dim ceiling As String
ceiling = responseXml.GetChildContent("*:Body|*:messageResponseTypeDef|*:alert|*:info|*:area|*:ceiling")
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>