@@ -72,6 +72,7 @@ public CompareComplyService(string versionDate) : this(versionDate, ConfigBasedA
72
72
public CompareComplyService ( string versionDate , Authenticator authenticator ) : base ( versionDate , authenticator , serviceId )
73
73
{
74
74
Authenticator = authenticator ;
75
+
75
76
if ( string . IsNullOrEmpty ( versionDate ) )
76
77
{
77
78
throw new ArgumentNullException ( "A versionDate (format `yyyy-mm-dd`) is required to create an instance of CompareComplyService" ) ;
@@ -81,7 +82,6 @@ public CompareComplyService(string versionDate, Authenticator authenticator) : b
81
82
VersionDate = versionDate ;
82
83
}
83
84
84
-
85
85
if ( string . IsNullOrEmpty ( GetServiceUrl ( ) ) )
86
86
{
87
87
SetServiceUrl ( defaultServiceUrl ) ;
@@ -140,13 +140,10 @@ public bool ConvertToHtml(Callback<HTMLReturn> callback, System.IO.MemoryStream
140
140
141
141
req . OnResponse = OnConvertToHtmlResponse ;
142
142
143
- RESTConnector connector = RESTConnector . GetConnector ( Authenticator , "/v1/html_conversion" , GetServiceUrl ( ) ) ;
144
- if ( connector == null )
145
- {
146
- return false ;
147
- }
143
+ Connector . URL = GetServiceUrl ( ) + "/v1/html_conversion" ;
144
+ Authenticator . Authenticate ( Connector ) ;
148
145
149
- return connector . Send ( req ) ;
146
+ return Connector . Send ( req ) ;
150
147
}
151
148
152
149
private void OnConvertToHtmlResponse ( RESTConnector . Request req , RESTConnector . Response resp )
@@ -225,13 +222,10 @@ public bool ClassifyElements(Callback<ClassifyReturn> callback, System.IO.Memory
225
222
226
223
req . OnResponse = OnClassifyElementsResponse ;
227
224
228
- RESTConnector connector = RESTConnector . GetConnector ( Authenticator , "/v1/element_classification" , GetServiceUrl ( ) ) ;
229
- if ( connector == null )
230
- {
231
- return false ;
232
- }
225
+ Connector . URL = GetServiceUrl ( ) + "/v1/element_classification" ;
226
+ Authenticator . Authenticate ( Connector ) ;
233
227
234
- return connector . Send ( req ) ;
228
+ return Connector . Send ( req ) ;
235
229
}
236
230
237
231
private void OnClassifyElementsResponse ( RESTConnector . Request req , RESTConnector . Response resp )
@@ -310,13 +304,10 @@ public bool ExtractTables(Callback<TableReturn> callback, System.IO.MemoryStream
310
304
311
305
req . OnResponse = OnExtractTablesResponse ;
312
306
313
- RESTConnector connector = RESTConnector . GetConnector ( Authenticator , "/v1/tables" , GetServiceUrl ( ) ) ;
314
- if ( connector == null )
315
- {
316
- return false ;
317
- }
307
+ Connector . URL = GetServiceUrl ( ) + "/v1/tables" ;
308
+ Authenticator . Authenticate ( Connector ) ;
318
309
319
- return connector . Send ( req ) ;
310
+ return Connector . Send ( req ) ;
320
311
}
321
312
322
313
private void OnExtractTablesResponse ( RESTConnector . Request req , RESTConnector . Response resp )
@@ -413,13 +404,10 @@ public bool CompareDocuments(Callback<CompareReturn> callback, System.IO.MemoryS
413
404
414
405
req . OnResponse = OnCompareDocumentsResponse ;
415
406
416
- RESTConnector connector = RESTConnector . GetConnector ( Authenticator , "/v1/comparison" , GetServiceUrl ( ) ) ;
417
- if ( connector == null )
418
- {
419
- return false ;
420
- }
407
+ Connector . URL = GetServiceUrl ( ) + "/v1/comparison" ;
408
+ Authenticator . Authenticate ( Connector ) ;
421
409
422
- return connector . Send ( req ) ;
410
+ return Connector . Send ( req ) ;
423
411
}
424
412
425
413
private void OnCompareDocumentsResponse ( RESTConnector . Request req , RESTConnector . Response resp )
@@ -500,13 +488,10 @@ public bool AddFeedback(Callback<FeedbackReturn> callback, FeedbackDataInput fee
500
488
501
489
req . OnResponse = OnAddFeedbackResponse ;
502
490
503
- RESTConnector connector = RESTConnector . GetConnector ( Authenticator , "/v1/feedback" , GetServiceUrl ( ) ) ;
504
- if ( connector == null )
505
- {
506
- return false ;
507
- }
491
+ Connector . URL = GetServiceUrl ( ) + "/v1/feedback" ;
492
+ Authenticator . Authenticate ( Connector ) ;
508
493
509
- return connector . Send ( req ) ;
494
+ return Connector . Send ( req ) ;
510
495
}
511
496
512
497
private void OnAddFeedbackResponse ( RESTConnector . Request req , RESTConnector . Response resp )
@@ -672,13 +657,10 @@ public bool ListFeedback(Callback<FeedbackList> callback, string feedbackType =
672
657
673
658
req . OnResponse = OnListFeedbackResponse ;
674
659
675
- RESTConnector connector = RESTConnector . GetConnector ( Authenticator , "/v1/feedback" , GetServiceUrl ( ) ) ;
676
- if ( connector == null )
677
- {
678
- return false ;
679
- }
660
+ Connector . URL = GetServiceUrl ( ) + "/v1/feedback" ;
661
+ Authenticator . Authenticate ( Connector ) ;
680
662
681
- return connector . Send ( req ) ;
663
+ return Connector . Send ( req ) ;
682
664
}
683
665
684
666
private void OnListFeedbackResponse ( RESTConnector . Request req , RESTConnector . Response resp )
@@ -751,13 +733,10 @@ public bool GetFeedback(Callback<GetFeedback> callback, string feedbackId, strin
751
733
752
734
req . OnResponse = OnGetFeedbackResponse ;
753
735
754
- RESTConnector connector = RESTConnector . GetConnector ( Authenticator , string . Format ( "/v1/feedback/{0}" , feedbackId ) , GetServiceUrl ( ) ) ;
755
- if ( connector == null )
756
- {
757
- return false ;
758
- }
736
+ Connector . URL = GetServiceUrl ( ) + string . Format ( "/v1/feedback/{0}" , feedbackId ) ;
737
+ Authenticator . Authenticate ( Connector ) ;
759
738
760
- return connector . Send ( req ) ;
739
+ return Connector . Send ( req ) ;
761
740
}
762
741
763
742
private void OnGetFeedbackResponse ( RESTConnector . Request req , RESTConnector . Response resp )
@@ -830,13 +809,10 @@ public bool DeleteFeedback(Callback<FeedbackDeleted> callback, string feedbackId
830
809
831
810
req . OnResponse = OnDeleteFeedbackResponse ;
832
811
833
- RESTConnector connector = RESTConnector . GetConnector ( Authenticator , string . Format ( "/v1/feedback/{0}" , feedbackId ) , GetServiceUrl ( ) ) ;
834
- if ( connector == null )
835
- {
836
- return false ;
837
- }
812
+ Connector . URL = GetServiceUrl ( ) + string . Format ( "/v1/feedback/{0}" , feedbackId ) ;
813
+ Authenticator . Authenticate ( Connector ) ;
838
814
839
- return connector . Send ( req ) ;
815
+ return Connector . Send ( req ) ;
840
816
}
841
817
842
818
private void OnDeleteFeedbackResponse ( RESTConnector . Request req , RESTConnector . Response resp )
@@ -969,13 +945,10 @@ public bool CreateBatch(Callback<BatchStatus> callback, string function, System.
969
945
970
946
req . OnResponse = OnCreateBatchResponse ;
971
947
972
- RESTConnector connector = RESTConnector . GetConnector ( Authenticator , "/v1/batches" , GetServiceUrl ( ) ) ;
973
- if ( connector == null )
974
- {
975
- return false ;
976
- }
948
+ Connector . URL = GetServiceUrl ( ) + "/v1/batches" ;
949
+ Authenticator . Authenticate ( Connector ) ;
977
950
978
- return connector . Send ( req ) ;
951
+ return Connector . Send ( req ) ;
979
952
}
980
953
981
954
private void OnCreateBatchResponse ( RESTConnector . Request req , RESTConnector . Response resp )
@@ -1037,13 +1010,10 @@ public bool ListBatches(Callback<Batches> callback)
1037
1010
1038
1011
req . OnResponse = OnListBatchesResponse ;
1039
1012
1040
- RESTConnector connector = RESTConnector . GetConnector ( Authenticator , "/v1/batches" , GetServiceUrl ( ) ) ;
1041
- if ( connector == null )
1042
- {
1043
- return false ;
1044
- }
1013
+ Connector . URL = GetServiceUrl ( ) + "/v1/batches" ;
1014
+ Authenticator . Authenticate ( Connector ) ;
1045
1015
1046
- return connector . Send ( req ) ;
1016
+ return Connector . Send ( req ) ;
1047
1017
}
1048
1018
1049
1019
private void OnListBatchesResponse ( RESTConnector . Request req , RESTConnector . Response resp )
@@ -1108,13 +1078,10 @@ public bool GetBatch(Callback<BatchStatus> callback, string batchId)
1108
1078
1109
1079
req . OnResponse = OnGetBatchResponse ;
1110
1080
1111
- RESTConnector connector = RESTConnector . GetConnector ( Authenticator , string . Format ( "/v1/batches/{0}" , batchId ) , GetServiceUrl ( ) ) ;
1112
- if ( connector == null )
1113
- {
1114
- return false ;
1115
- }
1081
+ Connector . URL = GetServiceUrl ( ) + string . Format ( "/v1/batches/{0}" , batchId ) ;
1082
+ Authenticator . Authenticate ( Connector ) ;
1116
1083
1117
- return connector . Send ( req ) ;
1084
+ return Connector . Send ( req ) ;
1118
1085
}
1119
1086
1120
1087
private void OnGetBatchResponse ( RESTConnector . Request req , RESTConnector . Response resp )
@@ -1195,13 +1162,10 @@ public bool UpdateBatch(Callback<BatchStatus> callback, string batchId, string a
1195
1162
1196
1163
req . OnResponse = OnUpdateBatchResponse ;
1197
1164
1198
- RESTConnector connector = RESTConnector . GetConnector ( Authenticator , string . Format ( "/v1/batches/{0}" , batchId ) , GetServiceUrl ( ) ) ;
1199
- if ( connector == null )
1200
- {
1201
- return false ;
1202
- }
1165
+ Connector . URL = GetServiceUrl ( ) + string . Format ( "/v1/batches/{0}" , batchId ) ;
1166
+ Authenticator . Authenticate ( Connector ) ;
1203
1167
1204
- return connector . Send ( req ) ;
1168
+ return Connector . Send ( req ) ;
1205
1169
}
1206
1170
1207
1171
private void OnUpdateBatchResponse ( RESTConnector . Request req , RESTConnector . Response resp )
0 commit comments