using System.Collections.Generic;
using System.Data.SqlClient;
namespace ST_cf00dad7b5884f678750e66a480775bf
public partial class ScriptMain
public void Main(string test)
XmlDocument doc = new XmlDocument();
doc.LoadXml(@"<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>
<SourceSystem location='RICO_SageX3'></SourceSystem>
<MethodName>GetMsgRefListFromGivenRefID</MethodName>
<Parameter name='msgEventName'>Task</Parameter>
<Parameter name='msgEventRef'>1</Parameter>
string SoapOutput = CallMyWebService(doc);
Console.WriteLine(SoapOutput);
#region Help: Using Integration Services variables and parameters in a script
#region Help: Firing Integration Services events from a script
#region Help: Using Integration Services connection managers in a script
#region ScriptResults declaration
public XmlDocument LoadXml(string Envelope)
StringReader StrReader = new StringReader(Envelope);
XmlDocument soapEnvelopeDocument = new XmlDocument();
soapEnvelopeDocument.Load(StrReader);
return soapEnvelopeDocument;
public string CallMyWebService(XmlDocument orderDoc)
string soapResult = null;
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11;
var _url = "https://b2b-uat.gw.computacenter.com/?senderParty=MA_UK_RICOSX3_SYS&interface=SI_GetMessage_V2_SY_OB&interfaceNamespace=http://computacenter.com/global/Integration&zAdpt=soap&zI=nc2&zICC=true";
var _action = "http://sap.com/xi/WebService/soap1.1";
HttpWebRequest webRequest = CreateWebRequest(_url, _action);
InsertSoapEnvelopeIntoWebRequest(orderDoc, webRequest);
IAsyncResult asyncResult = webRequest.BeginGetResponse(null, null);
asyncResult.AsyncWaitHandle.WaitOne();
using (WebResponse webResponse = webRequest.EndGetResponse(asyncResult))
using (StreamReader rd = new StreamReader(webResponse.GetResponseStream()))
soapResult = rd.ReadToEnd();
public string InsertData(string test)
public void InsertSoapEnvelopeIntoWebRequest(XmlDocument soapEnvelopeXml, HttpWebRequest webRequest)
using (Stream stream = webRequest.GetRequestStream())
soapEnvelopeXml.Save(stream);
public HttpWebRequest CreateWebRequest(string url, string action)
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
webRequest.Headers.Add("SOAPAction", action);
webRequest.ContentType = "text/xml;charset=\"utf-8\"";
webRequest.Accept = "text/xml";
webRequest.Method = "POST";
string authInfo = "MA_UK_RICOSX3_SYS-T:Umn0LTM5TyC5PCuHdUI0";
authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo));
webRequest.Headers.Add("Authorization", "Basic " + authInfo);
webRequest.Credentials = new NetworkCredential("MA_UK_RICOSX3_SYS-T", "Umn0LTM5TyC5PCuHdUI0");
public int ID { get; set; }
public DateTime Date { get; set; }