AnsweredAssumed Answered

How to generate a response API(say XML or  so) for the request API passed in c#?

Question asked by A1.-_ on Apr 23, 2018
Latest reply on Apr 27, 2018 by Mark_HE

I want to generate a response XML  for the request XML passed in c#.  I have added the request xml to the transaction bundle, set the Url ,created the virtual service and run the same.  Is it possible to get the response xml dynamically for the passed request xml in c#.

 

 

Core code is as below

strXml="<

<?xml version="1.0" ?> <wfs:DescribeFeatureType    service="WFS"    version="1.0.0"    xmlns:wfs="http://www.opengis.net/wfs"    xmlns:myns="http://www.example.com/myns"    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xmlns:xsd="http://www.w3.org/2001/XMLSchema"    xsi:schemaLocation="http://www.opengis.net/wfs ../wfs/1.0.0/WFS-basic.xsd">    <wfs:TypeName>myns:COLA</wfs:TypeName> </wfs:DescribeFeatureType>

";

string strXMLResponse = string.Empty;
try
{
T24Connector.T24ConnectorService t24connect = new T24Connector.T24ConnectorService();
try
{
string strURL = ConfigurationManager.AppSettings["T24Connector.T24Connector"].ToString();
t24connect.Url = strURL;
}
catch
{ }
strXMLResponse = t24connect.sendAndReceive(CHANNEL, strXMLRequest.ToString());
}
catch (Exception ex)
{

throw ex;
}
return strXMLResponse;

Outcomes