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?"); } }
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; }
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; }