SpringCMServiceSoap12 / GroupGetByContact
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
#include <CkXmlW.h>
#include <CkHttpW.h>
#include <CkHttpResponseW.h>
void ChilkatSample(void)
{
CkXmlW xml;
xml.put_Tag(L"soap:Envelope");
xml.AddAttribute(L"xmlns:soap",L"http://www.w3.org/2003/05/soap-envelope");
xml.AddAttribute(L"xmlns:spr",L"http://www.springcm.com/atlas/webservices/v201308/scm/");
xml.UpdateChildContent(L"soap:Header",L"");
xml.UpdateChildContent(L"soap:Body|spr:GroupGetByContact|spr:token",L"string");
xml.UpdateChildContent(L"soap:Body|spr:GroupGetByContact|spr:contact|spr:Id",L"string");
xml.UpdateChildContent(L"soap:Body|spr:GroupGetByContact|spr:contact|spr:Name",L"string");
xml.UpdateChildContent(L"soap:Body|spr:GroupGetByContact|spr:contact|spr:ObjectType",L"Document");
xml.UpdateChildContent(L"soap:Body|spr:GroupGetByContact|spr:contact|spr:Email",L"string");
xml.UpdateChildContent(L"soap:Body|spr:GroupGetByContact|spr:contact|spr:FirstName",L"string");
xml.UpdateChildContent(L"soap:Body|spr:GroupGetByContact|spr:contact|spr:LastName",L"string");
xml.UpdateChildContent(L"soap:Body|spr:GroupGetByContact|spr:contact|spr:PhoneNumber",L"string");
xml.UpdateChildContent(L"soap:Body|spr:GroupGetByContact|spr:contact|spr:FaxNumber",L"string");
xml.UpdateChildContent(L"soap:Body|spr:GroupGetByContact|spr:contact|spr:Company",L"string");
xml.UpdateChildContent(L"soap:Body|spr:GroupGetByContact|spr:contact|spr:Department",L"string");
xml.UpdateChildContent(L"soap:Body|spr:GroupGetByContact|spr:contact|spr:Title",L"string");
xml.UpdateChildContent(L"soap:Body|spr:GroupGetByContact|spr:contact|spr:Address1",L"string");
xml.UpdateChildContent(L"soap:Body|spr:GroupGetByContact|spr:contact|spr:Address2",L"string");
xml.UpdateChildContent(L"soap:Body|spr:GroupGetByContact|spr:contact|spr:Address3",L"string");
xml.UpdateChildContent(L"soap:Body|spr:GroupGetByContact|spr:contact|spr:City",L"string");
xml.UpdateChildContent(L"soap:Body|spr:GroupGetByContact|spr:contact|spr:ProvinceState",L"string");
xml.UpdateChildContent(L"soap:Body|spr:GroupGetByContact|spr:contact|spr:PostalCode",L"string");
xml.UpdateChildContent(L"soap:Body|spr:GroupGetByContact|spr:contact|spr:Country",L"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.put_EmitXmlDecl(false);
const wchar_t *soapRequestBody = xml.getXml();
const wchar_t *endpoint = L"https://soapna11.springcm.com/atlas/webservices/v201308/springcmservice.asmx";
const wchar_t *soapAction = L"http://www.springcm.com/atlas/webservices/v201308/scm/GroupGetByContact";
// For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
const wchar_t *contentType = L"text/xml";
CkHttpW http;
http.ClearHeaders();
http.SetRequestHeader(L"Content-Type",contentType);
http.SetRequestHeader(L"SOAPAction",soapAction);
CkHttpResponseW *resp = http.PostXml(endpoint,soapRequestBody,L"utf-8");
if (http.get_LastMethodSuccess() == false) {
wprintf(L"%s\n",http.lastErrorText());
wprintf(L"Failed to send SOAP request.\n");
return;
}
// Get the XML response body.
CkXmlW responseXml;
resp->GetBodyXml(responseXml);
int statusCode = resp->get_StatusCode();
wprintf(L"response status code: %d\n",statusCode);
delete resp;
// If the status code does not indicate succcess, then show the response XML,
// which probably contains error information.
if (statusCode != 200) {
wprintf(L"%s\n",responseXml.getXml());
return;
}
wprintf(L"%s\n",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).
const wchar_t *Id = responseXml.getChildContent(L"*:Body|*:GroupGetByContactResponse|*:GroupGetByContactResult|*:SCMGroup|*:Id");
const wchar_t *Name = responseXml.getChildContent(L"*:Body|*:GroupGetByContactResponse|*:GroupGetByContactResult|*:SCMGroup|*:Name");
const wchar_t *ObjectType = responseXml.getChildContent(L"*:Body|*:GroupGetByContactResponse|*:GroupGetByContactResult|*:SCMGroup|*:ObjectType");
const wchar_t *IsPrivate = responseXml.getChildContent(L"*:Body|*:GroupGetByContactResponse|*:GroupGetByContactResult|*:SCMGroup|*:IsPrivate");
Id = responseXml.getChildContent(L"*:Body|*:GroupGetByContactResponse|*:GroupGetByContactResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Id");
Name = responseXml.getChildContent(L"*:Body|*:GroupGetByContactResponse|*:GroupGetByContactResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Name");
ObjectType = responseXml.getChildContent(L"*:Body|*:GroupGetByContactResponse|*:GroupGetByContactResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:ObjectType");
const wchar_t *v_Email = responseXml.getChildContent(L"*:Body|*:GroupGetByContactResponse|*:GroupGetByContactResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Email");
const wchar_t *FirstName = responseXml.getChildContent(L"*:Body|*:GroupGetByContactResponse|*:GroupGetByContactResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:FirstName");
const wchar_t *LastName = responseXml.getChildContent(L"*:Body|*:GroupGetByContactResponse|*:GroupGetByContactResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:LastName");
const wchar_t *PhoneNumber = responseXml.getChildContent(L"*:Body|*:GroupGetByContactResponse|*:GroupGetByContactResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:PhoneNumber");
const wchar_t *FaxNumber = responseXml.getChildContent(L"*:Body|*:GroupGetByContactResponse|*:GroupGetByContactResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:FaxNumber");
const wchar_t *Company = responseXml.getChildContent(L"*:Body|*:GroupGetByContactResponse|*:GroupGetByContactResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Company");
const wchar_t *Department = responseXml.getChildContent(L"*:Body|*:GroupGetByContactResponse|*:GroupGetByContactResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Department");
const wchar_t *Title = responseXml.getChildContent(L"*:Body|*:GroupGetByContactResponse|*:GroupGetByContactResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Title");
const wchar_t *Address1 = responseXml.getChildContent(L"*:Body|*:GroupGetByContactResponse|*:GroupGetByContactResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Address1");
const wchar_t *Address2 = responseXml.getChildContent(L"*:Body|*:GroupGetByContactResponse|*:GroupGetByContactResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Address2");
const wchar_t *Address3 = responseXml.getChildContent(L"*:Body|*:GroupGetByContactResponse|*:GroupGetByContactResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Address3");
const wchar_t *City = responseXml.getChildContent(L"*:Body|*:GroupGetByContactResponse|*:GroupGetByContactResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:City");
const wchar_t *ProvinceState = responseXml.getChildContent(L"*:Body|*:GroupGetByContactResponse|*:GroupGetByContactResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:ProvinceState");
const wchar_t *PostalCode = responseXml.getChildContent(L"*:Body|*:GroupGetByContactResponse|*:GroupGetByContactResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:PostalCode");
const wchar_t *Country = responseXml.getChildContent(L"*:Body|*:GroupGetByContactResponse|*:GroupGetByContactResult|*:SCMGroup|*:Members|*:SCMContactInfo|*:Country");
const wchar_t *GroupType = responseXml.getChildContent(L"*:Body|*:GroupGetByContactResponse|*:GroupGetByContactResult|*:SCMGroup|*:GroupType");
}
Request XML
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:spr="http://www.springcm.com/atlas/webservices/v201308/scm/">
<soap:Header/>
<soap:Body>
<spr:GroupGetByContact>
<spr:token>string</spr:token>
<spr:contact>
<spr:Id>string</spr:Id>
<spr:Name>string</spr:Name>
<spr:ObjectType>Document</spr:ObjectType>
<spr:Email>string</spr:Email>
<spr:FirstName>string</spr:FirstName>
<spr:LastName>string</spr:LastName>
<spr:PhoneNumber>string</spr:PhoneNumber>
<spr:FaxNumber>string</spr:FaxNumber>
<spr:Company>string</spr:Company>
<spr:Department>string</spr:Department>
<spr:Title>string</spr:Title>
<spr:Address1>string</spr:Address1>
<spr:Address2>string</spr:Address2>
<spr:Address3>string</spr:Address3>
<spr:City>string</spr:City>
<spr:ProvinceState>string</spr:ProvinceState>
<spr:PostalCode>string</spr:PostalCode>
<spr:Country>string</spr:Country>
</spr:contact>
</spr:GroupGetByContact>
</soap:Body>
</soap:Envelope>
Response XML
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:spr="http://www.springcm.com/atlas/webservices/v201308/scm/">
<soap:Header/>
<soap:Body>
<spr:GroupGetByContactResponse>
<spr:GroupGetByContactResult>
<spr:SCMGroup>
<spr:Id>string</spr:Id>
<spr:Name>string</spr:Name>
<spr:ObjectType>Document</spr:ObjectType>
<spr:IsPrivate>true</spr:IsPrivate>
<spr:Members>
<spr:SCMContactInfo>
<spr:Id>string</spr:Id>
<spr:Name>string</spr:Name>
<spr:ObjectType>Document</spr:ObjectType>
<spr:Email>string</spr:Email>
<spr:FirstName>string</spr:FirstName>
<spr:LastName>string</spr:LastName>
<spr:PhoneNumber>string</spr:PhoneNumber>
<spr:FaxNumber>string</spr:FaxNumber>
<spr:Company>string</spr:Company>
<spr:Department>string</spr:Department>
<spr:Title>string</spr:Title>
<spr:Address1>string</spr:Address1>
<spr:Address2>string</spr:Address2>
<spr:Address3>string</spr:Address3>
<spr:City>string</spr:City>
<spr:ProvinceState>string</spr:ProvinceState>
<spr:PostalCode>string</spr:PostalCode>
<spr:Country>string</spr:Country>
</spr:SCMContactInfo>
</spr:Members>
<spr:GroupType>Distribution</spr:GroupType>
</spr:SCMGroup>
</spr:GroupGetByContactResult>
</spr:GroupGetByContactResponse>
</soap:Body>
</soap:Envelope>