Ejemplo n.º 1
0
        /// <summary>
        /// Send XML command to UMarkert Platform
        /// </summary>
        /// <param name="soapXML"></param>
        /// <returns></returns>
        public static string  SendXMLRequest(string soapXML)
        {
            //ClassLogger log = null;
            // string umarkert_Server = "http://10.1.5.64:8280/services/umarketsc";   // test server

            // string umarkert_Server = "http://10.1.5.60:8280/services/umarketsc"; // live

            ClassLogger log             = null;
            string      umarkert_Server = ConfigurationManager.AppSettings["umarket_point"].ToString(); //"http://10.1.5.64:8280/services/umarketsc";      //   test
            ClassSOAP   soapRequest     = null;

            soapRequest = new ClassSOAP(umarkert_Server, CurrentCredentials, log);
            soapRequest.BypassWebProxy = true;
            return(soapRequest.SendRequest(soapXML));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Send XML command to UMarkert Platform
        /// </summary>
        /// <param name="soapXML"></param>
        /// <returns></returns>
        public static string  SendXMLRequest(string soapXML)
        {
            ClassLogger log = null;
            // string umarkert_Server = "http://10.1.5.64:8280/services/umarketsc";    test server

            // string umarkert_Server = "http://10.1.5.60:8280/services/umarketsc";  old live .

            string umarkert_Server = "http://10.1.5.82:8280/services/umarketsc";

            // string umarkert_Server = "http://10.11.14.4:7004/osb/services/RegisterPayment_1_1"; middleware test bed
            ClassSOAP soapRequest = null;

            soapRequest = new ClassSOAP(umarkert_Server, CurrentCredentials, log);
            soapRequest.BypassWebProxy = true;
            return(soapRequest.SendRequest(soapXML));
        }
Ejemplo n.º 3
0
        private void buttonConvert_Click(object sender, EventArgs e)
        {
            string sSourceID = textBoxSourceID.Text;

            if (String.IsNullOrEmpty(sSourceID))
            {
                return;
            }

            string sRequest = _ConvertIDTemplate;

            // Replace placeholders in template
            sRequest = sRequest.Replace("%DESTINATIONFORMAT%", comboBoxTargetFormat.Text);
            sRequest = sRequest.Replace("%SOURCEFORMAT%", comboBoxSourceFormat.Text);
            sRequest = sRequest.Replace("%SOURCEID%", textBoxSourceID.Text);
            sRequest = sRequest.Replace("%MAILBOX%", textBoxMailbox.Text);  // We don't care about the SMTP address, and it is not important

            // Now send request
            ClassSOAP oSOAP     = new ClassSOAP(_EWSURL, _credentials, _logger);
            string    sError    = "";
            string    sResponse = oSOAP.SendRequest(sRequest, out sError);

            // Now extract the converted ID
            // This is a very (very very) bad method of doing this, but it is a quick implementation
            if (sResponse.Contains("<m:ConvertIdResponseMessage ResponseClass=\"Success\"><m:ResponseCode>NoError</m:ResponseCode>"))
            {
                // We have a valid response
                int    iIDStart = sResponse.IndexOf("Id=\"");
                int    iIDEnd   = sResponse.IndexOf(" ", iIDStart);
                string sID      = sResponse.Substring(iIDStart, iIDEnd - iIDStart);
                sID = sID.Substring(4);
                sID = sID.Substring(0, sID.Length - 1);
                textBoxConvertedID.Text = sID;
                textBoxConvertedID.Focus();
                textBoxConvertedID.SelectAll();
            }
            else
            {
                textBoxConvertedID.Text = "Error occurred: " + sResponse.Trim();
            }
        }