SmartConnect 2018
Run Map XML
Runs the specified map using the data provided in the xml string and returns the results.
Service uri:
To call the get map list method make a call to SmartConnect.svc/runmapxml/{mapId}
Service web.config flag:
The flag used to turn this service call on or off in the WCF REST service web.config file is AllowRunMapXml
Service security:
The settings used to determine WCF REST security and log settings is Run Map Xml
Implementation details:
While the credentials of the user configured to run the SmartConnect WCF REST service are used to run the map, the credentials provided with the service call are used to determine access to the map.
This method will process any Xml that is in a valid Xml format.
Return type:
The return type of this method is RunMapResponse
Sample usage:
VB.NET
' runs a map with an id of TEST
Dim request As System.Net.WebRequest = System.Net.WebRequest.Create("webservice.eonesolutions.com/SmartConnect.svc/runmapxml/TEST")
request.Credentials = New System.Net.NetworkCredential("username", "password", "domain")
request.Method = "POST";
Dim document As New System.Xml.XmlDocument()
document.LoadXml("c:\temp\test.xml")
Dim xml As String = document.InnerXml
request.ContentLength = xml.Length
request.ContentType = "text/xml"
Using newStream As System.IO.Stream = request.GetRequestStream()
newStream.Write(Encoding.ASCII.GetBytes(xml), 0, xml.Length)
End Using
Dim response As System.Net.WebResponse = request.GetResponse()
Dim result As String = String.Empty
Using responseStream As New System.IO.StreamReader(response.GetResponseStream())
Dim result As String = responseStream.ReadToEnd()
End Using
Dim doc As New System.Xml.XmlDocument()
doc.LoadXml(result)
Return doc
C#.NET
// runs a map with an id of GP_ACC
System.Net.WebRequest request = System.Net.WebRequest.Create("webservice.eonesolutions.com/SmartConnect.svc/runmapxml/GP_ACC");
request.Credentials = new System.Net.NetworkCredential("username","password","domain");
request.Method = "POST";
System.Xml.XmlDocument document = new System.Xml.XmlDocument();
document.LoadXml("c:\\temp\\test.xml");
string xml = document.InnerXml;
request.ContentLength = xml.Length;
request.ContentType = "text/xml";
using(System.IO.Stream newStream = request.GetRequestStream())
{
newStream.Write(Encoding.ASCII.GetBytes(xml),0,xml.Length);
}
System.Net.WebResponse response = request.GetResponse();
string result = string.Empty;
using(System.IO.StreamReader responseStream = new System.IO.StreamReader(response.GetResponseStream()))
{
string result = responseStream.ReadToEnd();
}
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.LoadXml(result);
return doc;