Chilkat.Xml xml = newChilkat.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 = newChilkat.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 = newChilkat.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");