コード例 #1
0
ファイル: AFComponent.cs プロジェクト: matyapav/AFSwinx
        public async Task<String> getModelResponse()
        {
            AFSwinxConnection modelConnection = connectionPack.getMetamodelConnection();
            if (modelConnection != null)
            {
                RequestMaker maker = new RequestMaker(modelConnection.getHttpMethod(), modelConnection.getContentType(),
                        modelConnection.getSecurity(), null, Utils.GetConnectionEndPoint(modelConnection));

                String modelResponse = await maker.doRequest();
                return modelResponse;
            }
            else {
                throw new Exception("No model connection available. Did you call initializeConnections() before?");
            }
        }
コード例 #2
0
ファイル: AFComponent.cs プロジェクト: matyapav/AFSwinx
 public async Task<String> getDataResponse()
 {
     AFSwinxConnection dataConnection = connectionPack.getDataConnection();
     if (dataConnection != null)
     {
         RequestMaker getData = new RequestMaker(dataConnection.getHttpMethod(), dataConnection.getContentType(),
                 dataConnection.getSecurity(), null, Utils.GetConnectionEndPoint(dataConnection));
         String response = await getData.doRequest();
         return response;
     }
     return null;
 }
コード例 #3
0
ファイル: AFForm.cs プロジェクト: matyapav/AFSwinx
 public override async Task<Boolean> sendData()
 {
     if (getConnectionPack().getSendConnection() == null)
     {
         throw new Exception(
             "The post connection was not specify. Check your XML configuration or Connection which was used to build this form");
     }
     Object data = generateSendData();
     if (data == null)
     {
         return false;
     }
     Debug.WriteLine("SEND CONNECTION " +
                     Utils.GetConnectionEndPoint(getConnectionPack().getSendConnection()));
     RequestMaker sendMaker = new RequestMaker(getConnectionPack().getSendConnection().getHttpMethod(),
         getConnectionPack().getSendConnection().getContentType(),
         getConnectionPack().getSendConnection().getSecurity(), data,
         Utils.GetConnectionEndPoint(getConnectionPack().getSendConnection()));
     await sendMaker.doRequest();
     return true;
 }