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
Chilkat.Xml xml = new Chilkat.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;
string soapRequestBody = xml.GetXml();

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

Chilkat.Http http = new Chilkat.Http();

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

Chilkat.HttpResponse resp = http.PostXml(endpoint,soapRequestBody,"utf-8");
if (http.LastMethodSuccess == false) {
    Debug.WriteLine(http.LastErrorText);
    Debug.WriteLine("Failed to send SOAP request.");
    return;
}

// Get the XML response body.
Chilkat.Xml responseXml = new Chilkat.Xml();
resp.GetBodyXml(responseXml);

int statusCode = resp.StatusCode;
Debug.WriteLine("response status code: " + Convert.ToString(statusCode));

// If the status code does not indicate succcess, then show the response XML,
// which probably contains error information.
if (statusCode != 200) {
    Debug.WriteLine(responseXml.GetXml());
    return;
}

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).

string parameterName = responseXml.GetChildContent("*:Body|*:postCAPResponseTypeDef|*:parameterListItem|*:parameterName");
string parameterValue = responseXml.GetChildContent("*:Body|*:postCAPResponseTypeDef|*:parameterListItem|*:parameterValue");
string subParameterName = responseXml.GetChildContent("*:Body|*:postCAPResponseTypeDef|*:parameterListItem|*:subParaListItem|*:subParameterName");
string subParameterValue = responseXml.GetChildContent("*:Body|*:postCAPResponseTypeDef|*:parameterListItem|*:subParaListItem|*:subParameterValue");
string ResponseOperation = responseXml.GetChildContent("*:Body|*:postCAPResponseTypeDef|*:ResponseOperation");
string ResponseType = responseXml.GetChildContent("*:Body|*:postCAPResponseTypeDef|*:ResponseType");
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>