SOAP WSDL Generate Code

CAPSoapHttp / postCAP

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
    xml := Xml_Ref.html">chilkat.NewXml()
    xml.SetTag("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.SetEmitXmlDecl(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 := Http_Ref.html">chilkat.NewHttp()

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

    resp := HttpResponse_Ref.html">chilkat.NewHttpResponse()
ERROR: Undefined variable(success)

ERROR: Undefined variable(success)
    if ERROR: Undefined variable(success)
success == false {
        fmt.Println(http.LastErrorText())
        fmt.Println("Failed to send SOAP request.")
        xml.DisposeXml()
        http.DisposeHttp()
        resp.DisposeHttpResponse()
        return
    }

    // Get the XML response body.
    responseXml := Xml_Ref.html">chilkat.NewXml()
    resp.GetBodyXml(responseXml)

    statusCode := resp.StatusCode()
    fmt.Println("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 {
        fmt.Println(*responseXml.GetXml())
        xml.DisposeXml()
        http.DisposeHttp()
        resp.DisposeHttpResponse()
        responseXml.DisposeXml()
        return
    }

    fmt.Println(*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")

    xml.DisposeXml()
    http.DisposeHttp()
    resp.DisposeHttpResponse()
    responseXml.DisposeXml()
Request 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>
        <WL5G3N1:request_Header>
            <WL5G3N1:logonUser>xml</WL5G3N1:logonUser>
            <WL5G3N1:logonCogId>xml</WL5G3N1:logonCogId>
        </WL5G3N1:request_Header>
    </soapenv:Header>
    <soapenv:Body>
        <WL5G3N1:postCAPRequestTypeDef>
            <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:postCAPRequestTypeDef>
    </soapenv:Body>
</soapenv:Envelope>
Response XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:resp="http://gov.fema.ipaws.services/capresponse" xmlns:WL5G3N1="http://gov.fema.ipaws.services/IPAWS_CAPService/" xmlns:capresp="http://gov.fema.ipaws.services/capresponse">
    <soapenv:Header/>
    <soapenv:Body>
        <WL5G3N1:postCAPResponseTypeDef>
            <resp:parameterListItem>
                <resp:parameterName>string</resp:parameterName>
                <resp:parameterValue>string</resp:parameterValue>
                <resp:subParaListItem>
                    <resp:subParameterName>string</resp:subParameterName>
                    <resp:subParameterValue>string</resp:subParameterValue>
                </resp:subParaListItem>
            </resp:parameterListItem>
            <resp:ResponseOperation>string</resp:ResponseOperation>
            <resp:ResponseType>string</resp:ResponseType>
        </WL5G3N1:postCAPResponseTypeDef>
    </soapenv:Body>
</soapenv:Envelope>