예제 #1
0
 public CAdxResultXml save(CAdxCallContext callContext, string publicName, string objectXml) {
     object[] results = this.Invoke("save", new object[] {
                 callContext,
                 publicName,
                 objectXml});
     return ((CAdxResultXml)(results[0]));
 }
예제 #2
0
 private CAdxWebServiceXmlCC.CAdxCallContext GetCallContext()
 {
     CAdxCallContext callContext = new CAdxWebServiceXmlCC.CAdxCallContext();
     callContext.codeLang = cmbCodeLang.Text.ToString().Trim();
     callContext.poolAlias = txtPoolAlias.Text.ToString().Trim();
     callContext.requestConfig = GetRequestConfig();
     if (String.IsNullOrEmpty(lblPoolId.Text.Trim()) == true)
     {
         callContext.poolId = lblPoolId.Text.Trim();
     }
     return callContext;
 }
예제 #3
0
        private XmlNode GetLeftListItems(CAdxCallContext callContext)
        {
            XmlNode grpNode = null;

            try
            {
                string wsName = cmbWebService.Text.ToUpper().Trim();
                CAdxWebServiceXmlCC.CAdxResultXml result = _x3Ws.getDescription(callContext, wsName);

                if (result.resultXml != null)
                {
                    XmlDocument xmlD = new XmlDocument();
                    xmlD.LoadXml(result.resultXml);
                    XmlNodeList adxKey = xmlD.GetElementsByTagName("ADXKEY");
                    grpNode = adxKey.Item(0).FirstChild;
                }
                else
                {
                    if (result.messages != null && result.messages.Length > 0)
                    {
                        MessageBox.Show(result.messages[0].message);
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorHandler(ex.Message);
            }

            return grpNode;
        }
예제 #4
0
 /// <remarks/>
 public void insertLinesAsync(CAdxCallContext callContext, string publicName, CAdxParamKeyValue[] objectKeys, string blocKey, string lineKey, string lineXml) {
     this.insertLinesAsync(callContext, publicName, objectKeys, blocKey, lineKey, lineXml, null);
 }
예제 #5
0
 /// <remarks/>
 public void deleteLinesAsync(CAdxCallContext callContext, string publicName, CAdxParamKeyValue[] objectKeys, string blocKey, string[] lineKeys) {
     this.deleteLinesAsync(callContext, publicName, objectKeys, blocKey, lineKeys, null);
 }
예제 #6
0
 /// <remarks/>
 public void actionObjectKeysAsync(CAdxCallContext callContext, string publicName, string actionCode, CAdxParamKeyValue[] objectKeys, object userState) {
     if ((this.actionObjectKeysOperationCompleted == null)) {
         this.actionObjectKeysOperationCompleted = new System.Threading.SendOrPostCallback(this.OnactionObjectKeysOperationCompleted);
     }
     this.InvokeAsync("actionObjectKeys", new object[] {
                 callContext,
                 publicName,
                 actionCode,
                 objectKeys}, this.actionObjectKeysOperationCompleted, userState);
 }
예제 #7
0
 /// <remarks/>
 public void getDataXmlSchemaAsync(CAdxCallContext callContext, string publicName) {
     this.getDataXmlSchemaAsync(callContext, publicName, null);
 }
예제 #8
0
 /// <remarks/>
 public void queryAsync(CAdxCallContext callContext, string publicName, CAdxParamKeyValue[] objectKeys, int listSize) {
     this.queryAsync(callContext, publicName, objectKeys, listSize, null);
 }
예제 #9
0
 /// <remarks/>
 public void queryAsync(CAdxCallContext callContext, string publicName, CAdxParamKeyValue[] objectKeys, int listSize, object userState) {
     if ((this.queryOperationCompleted == null)) {
         this.queryOperationCompleted = new System.Threading.SendOrPostCallback(this.OnqueryOperationCompleted);
     }
     this.InvokeAsync("query", new object[] {
                 callContext,
                 publicName,
                 objectKeys,
                 listSize}, this.queryOperationCompleted, userState);
 }
예제 #10
0
 /// <remarks/>
 public void readAsync(CAdxCallContext callContext, string publicName, CAdxParamKeyValue[] objectKeys) {
     this.readAsync(callContext, publicName, objectKeys, null);
 }
예제 #11
0
 public CAdxResultXml query(CAdxCallContext callContext, string publicName, CAdxParamKeyValue[] objectKeys, int listSize) {
     object[] results = this.Invoke("query", new object[] {
                 callContext,
                 publicName,
                 objectKeys,
                 listSize});
     return ((CAdxResultXml)(results[0]));
 }
예제 #12
0
 public CAdxResultXml read(CAdxCallContext callContext, string publicName, CAdxParamKeyValue[] objectKeys) {
     object[] results = this.Invoke("read", new object[] {
                 callContext,
                 publicName,
                 objectKeys});
     return ((CAdxResultXml)(results[0]));
 }
예제 #13
0
 /// <remarks/>
 public void saveAsync(CAdxCallContext callContext, string publicName, string objectXml, object userState) {
     if ((this.saveOperationCompleted == null)) {
         this.saveOperationCompleted = new System.Threading.SendOrPostCallback(this.OnsaveOperationCompleted);
     }
     this.InvokeAsync("save", new object[] {
                 callContext,
                 publicName,
                 objectXml}, this.saveOperationCompleted, userState);
 }
예제 #14
0
 /// <remarks/>
 public void saveAsync(CAdxCallContext callContext, string publicName, string objectXml) {
     this.saveAsync(callContext, publicName, objectXml, null);
 }
예제 #15
0
 public CAdxResultXml actionObjectKeys(CAdxCallContext callContext, string publicName, string actionCode, CAdxParamKeyValue[] objectKeys) {
     object[] results = this.Invoke("actionObjectKeys", new object[] {
                 callContext,
                 publicName,
                 actionCode,
                 objectKeys});
     return ((CAdxResultXml)(results[0]));
 }
예제 #16
0
 public CAdxResultXml getDescription(CAdxCallContext callContext, string publicName) {
     object[] results = this.Invoke("getDescription", new object[] {
                 callContext,
                 publicName});
     return ((CAdxResultXml)(results[0]));
 }
예제 #17
0
 /// <remarks/>
 public void actionObjectKeysAsync(CAdxCallContext callContext, string publicName, string actionCode, CAdxParamKeyValue[] objectKeys) {
     this.actionObjectKeysAsync(callContext, publicName, actionCode, objectKeys, null);
 }
예제 #18
0
 /// <remarks/>
 public void getDescriptionAsync(CAdxCallContext callContext, string publicName) {
     this.getDescriptionAsync(callContext, publicName, null);
 }
예제 #19
0
 public CAdxResultXml getDataXmlSchema(CAdxCallContext callContext, string publicName) {
     object[] results = this.Invoke("getDataXmlSchema", new object[] {
                 callContext,
                 publicName});
     return ((CAdxResultXml)(results[0]));
 }
예제 #20
0
 public CAdxResultXml modify(CAdxCallContext callContext, string publicName, CAdxParamKeyValue[] objectKeys, string objectXml) {
     object[] results = this.Invoke("modify", new object[] {
                 callContext,
                 publicName,
                 objectKeys,
                 objectXml});
     return ((CAdxResultXml)(results[0]));
 }
예제 #21
0
 /// <remarks/>
 public void getDataXmlSchemaAsync(CAdxCallContext callContext, string publicName, object userState) {
     if ((this.getDataXmlSchemaOperationCompleted == null)) {
         this.getDataXmlSchemaOperationCompleted = new System.Threading.SendOrPostCallback(this.OngetDataXmlSchemaOperationCompleted);
     }
     this.InvokeAsync("getDataXmlSchema", new object[] {
                 callContext,
                 publicName}, this.getDataXmlSchemaOperationCompleted, userState);
 }
예제 #22
0
 /// <remarks/>
 public void modifyAsync(CAdxCallContext callContext, string publicName, CAdxParamKeyValue[] objectKeys, string objectXml) {
     this.modifyAsync(callContext, publicName, objectKeys, objectXml, null);
 }
예제 #23
0
 public CAdxResultXml deleteLines(CAdxCallContext callContext, string publicName, CAdxParamKeyValue[] objectKeys, string blocKey, string[] lineKeys) {
     object[] results = this.Invoke("deleteLines", new object[] {
                 callContext,
                 publicName,
                 objectKeys,
                 blocKey,
                 lineKeys});
     return ((CAdxResultXml)(results[0]));
 }
예제 #24
0
 /// <remarks/>
 public void modifyAsync(CAdxCallContext callContext, string publicName, CAdxParamKeyValue[] objectKeys, string objectXml, object userState) {
     if ((this.modifyOperationCompleted == null)) {
         this.modifyOperationCompleted = new System.Threading.SendOrPostCallback(this.OnmodifyOperationCompleted);
     }
     this.InvokeAsync("modify", new object[] {
                 callContext,
                 publicName,
                 objectKeys,
                 objectXml}, this.modifyOperationCompleted, userState);
 }
예제 #25
0
 /// <remarks/>
 public void deleteLinesAsync(CAdxCallContext callContext, string publicName, CAdxParamKeyValue[] objectKeys, string blocKey, string[] lineKeys, object userState) {
     if ((this.deleteLinesOperationCompleted == null)) {
         this.deleteLinesOperationCompleted = new System.Threading.SendOrPostCallback(this.OndeleteLinesOperationCompleted);
     }
     this.InvokeAsync("deleteLines", new object[] {
                 callContext,
                 publicName,
                 objectKeys,
                 blocKey,
                 lineKeys}, this.deleteLinesOperationCompleted, userState);
 }
예제 #26
0
 public CAdxResultXml actionObject(CAdxCallContext callContext, string publicName, string actionCode, string objectXml) {
     object[] results = this.Invoke("actionObject", new object[] {
                 callContext,
                 publicName,
                 actionCode,
                 objectXml});
     return ((CAdxResultXml)(results[0]));
 }
예제 #27
0
        private CAdxParamKeyValue[] GetCriteria(CAdxCallContext cAdxCallContext)
        {
            // Split Criteria string
            String[] keyValues = txtCriteria.Text.Split('\n');

            // Get left list keys
            XmlNode leftListNode = GetLeftListItems(cAdxCallContext);

            // SSHA Only supports upto 50 parameters
            CAdxParamKeyValue[] objectKeys = new CAdxParamKeyValue[keyValues.Length];

            if (leftListNode != null)
            {
                int keyIndex = 0;

                for (int i = 0; i < keyValues.Length; i++)
                {
                    if (String.IsNullOrEmpty(keyValues[i].Trim()) == false)
                    {
                        CAdxParamKeyValue paramKeyValue = CreateParamKeyValue(leftListNode, keyValues, i);
                        objectKeys[keyIndex] = paramKeyValue;
                        keyIndex++;
                    }
                }
            }

            return objectKeys;
        }
예제 #28
0
 /// <remarks/>
 public void actionObjectAsync(CAdxCallContext callContext, string publicName, string actionCode, string objectXml) {
     this.actionObjectAsync(callContext, publicName, actionCode, objectXml, null);
 }
예제 #29
0
        private void CallWebService()
        {
            try
            {
                //general variables
                string[] lineKeys;
                //Create WS objets
                CAdxWebServiceXmlCC.CAdxCallContext cAdxCallContext = new CAdxCallContext();
                CAdxWebServiceXmlCC.CAdxResultXml cAdxResultXml = new CAdxResultXml();
                CAdxParamKeyValue[] objectKeys;
                // Grab settings
                string objectXml = txtParam.Text.ToString().Trim();
                string blockKey = txtBlockKey.Text.Trim();
                int listSize = String.IsNullOrEmpty(txtListSize.Text) ? 0 : int.Parse(txtListSize.Text);
                string actionCode = txtActionCode.Text.Trim();
                //Records application start time
                DateTime dt = DateTime.Now;

                // Clear results, messages, traces, etc and set url
                ClearOutputs(true);

                // Set URL, get call context and authenticate
                _x3Ws.Url = txtWebsite.Text.Trim() + "/soap-generic/syracuse/collaboration/syracuse/CAdxWebServiceXmlCC";
                cAdxCallContext = GetCallContext();

                //Trust all certificates
                System.Net.ServicePointManager.ServerCertificateValidationCallback = ((sender, certificate, chain, sslPolicyErrors) => true);

                // Trust our stagging server
                // System.Net.ServicePointManager.ServerCertificateValidationCallback = ((sender, cert, chain, errors) => cert.Subject.Contains("sagex3.com"));

                //System.Net.ServicePointManager.ServerCertificateValidationCallback = ((sender, cert, chain, errors) => cert.Subject.Contains("sageerpx3online.com"));

                // If you are using a third party certificate, add code here to validate it.

                // V9 requires prior authorization, establish the authorization method
                if (rdbBasic.Checked == true)
                {
                    //use basic authentication
                    _x3Ws.BasicAuth = true;
                    _x3Ws.Credentials = new System.Net.NetworkCredential(txtCodeUser.Text.ToString().Trim(), txtPassword.Text.ToString().Trim());
                }else
                {
                    //use Sage-ID OAuth authentication
                    _x3Ws.BasicAuth = false;
                    _x3Ws.AccessToken = GetAccessToken(txtRetrievalUrl.Text.Trim());
                }
                _x3Ws.PreAuthenticate = true;

                // Call appropiate WS method
                string wsName = cmbWebService.Text.ToUpper().Trim();
                string methodName = lstMethods.Text.ToUpper().Trim();
                switch (methodName)
                {
                    case "GETDESCRIPTION":
                        cAdxResultXml = _x3Ws.getDescription(cAdxCallContext, wsName);
                        break;
                    case "GETDATAXMLSCHEMA":
                        cAdxResultXml = _x3Ws.getDataXmlSchema(cAdxCallContext, wsName);
                        break;
                    case "RUN":
                        cAdxResultXml = _x3Ws.run(cAdxCallContext,wsName, objectXml);
                        break;
                    case "QUERY":
                        objectKeys = GetCriteria(cAdxCallContext);
                        cAdxResultXml = _x3Ws.query(cAdxCallContext, wsName, objectKeys, listSize);
                        break;
                    case "READ":
                        objectKeys = GetCriteria(cAdxCallContext);
                        cAdxResultXml = _x3Ws.read(cAdxCallContext,wsName, objectKeys);
                        break;
                    case "MODIFY":
                        objectKeys = GetCriteria(cAdxCallContext);
                        cAdxResultXml = _x3Ws.modify(cAdxCallContext,wsName, objectKeys, objectXml);
                        break;
                    case "SAVE":
                        cAdxResultXml = _x3Ws.save(cAdxCallContext, wsName, objectXml);
                        break;
                    case "DELETE":
                        objectKeys = GetCriteria(cAdxCallContext);
                        cAdxResultXml = _x3Ws.delete(cAdxCallContext,wsName, objectKeys);
                        break;
                    case "DELETELINES":
                        objectKeys = GetCriteria(cAdxCallContext);
                        lineKeys = GetDeleteLineKeys();
                        cAdxResultXml = _x3Ws.deleteLines(cAdxCallContext, wsName, objectKeys, blockKey, lineKeys);
                        break;
                    case "ACTIONOBJECT":
                        //**********************************************************************************************
                        cAdxResultXml = _x3Ws.actionObject(cAdxCallContext, wsName, actionCode, objectXml);
                        break;
                    default:
                        MessageBox.Show("Select a supported methods");
                        break;
                }

                ShowResults(cAdxResultXml, (DateTime.Now - dt).TotalMilliseconds.ToString());
            }
            catch (Exception ex)
            {
                ErrorHandler(ex.Message);
            }
        }
예제 #30
0
 /// <remarks/>
 public void runAsync(CAdxCallContext callContext, string publicName, string inputXml) {
     this.runAsync(callContext, publicName, inputXml, null);
 }