SmartConnect 2018
Run Map Info Path
Runs the specified map (InfoPath data souce) using the data provided and returns the results.
Service uri:
To call the get map list method make a call to SmartConnect.svc/runmapinfopath/{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 AllowRunMapInfoPath
Service security:
The settings used to determine WCF REST security and log settings is Run Map Info Path
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.
The xml used in this method is in the format of an Xml DataTable.
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/runmapinfopath/TEST")
request.Credentials = New System.Net.NetworkCredential("username", "password", "domain")
request.Method = "POST";
Using writer As New StringWriter()
dataTable.DataSet.WriteXml(writer, XmlWriteMode.WriteSchema)
End Using
Dim xml As String = writer.ToString()
request.ContentLength = xml.Length
request.ContentType = "text/xml"
Using reqStream As Stream = request.GetRequestStream()
reqStream.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 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/runmapinfopath/GP_ACC");
request.Credentials = new System.Net.NetworkCredential("username","password","domain");
request.Method = "POST";
using(StringWriter writer = new StringWriter())
{
dataTable.DataSet.WriteXml(writer,XmlWriteMode.WriteSchema);
}
string xml = writer.ToString();
request.ContentLength = xml.Length;
request.ContentType = "text/xml";
using(Stream reqStream = request.GetRequestStream())
{
reqStream.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();
}
XmlDocument doc = new XmlDocument();
doc.LoadXml(result);
return doc;
Sample DataTable xml
<NewDataSet>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Table">
<xs:complexType>
<xs:sequence>
<xs:element name="CustomerName" type="xs:string" minOccurs="0" />
<xs:element name="CustomerID" type="xs:string" minOccurs="0" />
<xs:element name="PhoneNumber" type="xs:string" minOccurs="0" />
<xs:element name="Contact" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<Table>
<CustomerName>Name</CustomerName>
<CustomerID>ID</CustomerID>
<PhoneNumber>Phone</PhoneNumber>
<Contact>Contact</Contact>
</Table>
</NewDataSet>