| Line 33... |
Line 33... |
| 33 |
private static final String TRANSACTION_INVOICE_VALUE = "transactionInvoiceValue";
|
33 |
private static final String TRANSACTION_INVOICE_VALUE = "transactionInvoiceValue";
|
| 34 |
private static final String TRANSACTION_INVOICE_NUMBER = "transactionInvoiceNumber";
|
34 |
private static final String TRANSACTION_INVOICE_NUMBER = "transactionInvoiceNumber";
|
| 35 |
private static final String TRANSACTION_POLICY_NUMBER = "transactionPolicyNumber";
|
35 |
private static final String TRANSACTION_POLICY_NUMBER = "transactionPolicyNumber";
|
| 36 |
|
36 |
|
| 37 |
public static void submitToGadgetCops(GadgetCopsInsuranceModel gadgetCopsInsuranceModel) throws ProfitMandiBusinessException{
|
37 |
public static void submitToGadgetCops(GadgetCopsInsuranceModel gadgetCopsInsuranceModel) throws ProfitMandiBusinessException{
|
| 38 |
//RestClient rc = new RestClient(SchemeType.HTTP, "www.google.com", 8080);
|
- |
|
| 39 |
RestClient restClient = new RestClient(SchemeType.HTTP, HOST_NAME, 80);
|
- |
|
| 40 |
|
38 |
|
| - |
|
39 |
RestClient restClient = new RestClient();
|
| 41 |
Map<String, String> params = new HashMap<>(18);
|
40 |
Map<String, String> params = new HashMap<>(18);
|
| 42 |
//params.put(OP, REGISTER_POLICY);
|
41 |
//params.put(OP, REGISTER_POLICY);
|
| 43 |
params.put(MOBILE_BRAND, gadgetCopsInsuranceModel.getBrand());
|
42 |
params.put(MOBILE_BRAND, gadgetCopsInsuranceModel.getBrand());
|
| 44 |
params.put(MOBILE_MODEL, gadgetCopsInsuranceModel.getModelName());
|
43 |
params.put(MOBILE_MODEL, gadgetCopsInsuranceModel.getModelName());
|
| 45 |
params.put(MOBILE_IMEI, gadgetCopsInsuranceModel.getSerialNumber());
|
44 |
params.put(MOBILE_IMEI, gadgetCopsInsuranceModel.getSerialNumber());
|
| Line 60... |
Line 59... |
| 60 |
|
59 |
|
| 61 |
Map<String, String> headers = new HashMap<>(0);
|
60 |
Map<String, String> headers = new HashMap<>(0);
|
| 62 |
//headers.put(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED_VALUE);
|
61 |
//headers.put(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED_VALUE);
|
| 63 |
|
62 |
|
| 64 |
try {
|
63 |
try {
|
| 65 |
restClient.post(URI, params, headers);
|
64 |
restClient.post(SchemeType.HTTP, HOST_NAME, 80, URI, params, headers);
|
| 66 |
} catch (HttpHostConnectException e) {
|
65 |
} catch (HttpHostConnectException e) {
|
| 67 |
// TODO Auto-generated catch block
|
66 |
// TODO Auto-generated catch block
|
| 68 |
e.printStackTrace();
|
67 |
e.printStackTrace();
|
| 69 |
}
|
68 |
}
|
| 70 |
}
|
69 |
}
|
| 71 |
|
70 |
|
| 72 |
public static void submitToGadgetCops(GadgetCopsDocumentInsuranceModel gadgetCopsInsuranceModel) throws ProfitMandiBusinessException{
|
71 |
public static void submitToGadgetCops(GadgetCopsDocumentInsuranceModel gadgetCopsInsuranceModel) throws ProfitMandiBusinessException{
|
| 73 |
//RestClient rc = new RestClient(SchemeType.HTTP, "www.google.com", 8080);
|
- |
|
| 74 |
RestClient restClient = new RestClient(SchemeType.HTTP, HOST_NAME, 80);
|
72 |
RestClient restClient = new RestClient();
|
| 75 |
|
- |
|
| 76 |
Map<String, String> params = new HashMap<>(18);
|
73 |
Map<String, String> params = new HashMap<>(18);
|
| 77 |
//params.put(OP, REGISTER_POLICY);
|
74 |
//params.put(OP, REGISTER_POLICY);
|
| 78 |
params.put(MOBILE_BRAND, gadgetCopsInsuranceModel.getBrand());
|
75 |
params.put(MOBILE_BRAND, gadgetCopsInsuranceModel.getBrand());
|
| 79 |
params.put(MOBILE_MODEL, gadgetCopsInsuranceModel.getModelName());
|
76 |
params.put(MOBILE_MODEL, gadgetCopsInsuranceModel.getModelName());
|
| 80 |
params.put(MOBILE_IMEI, gadgetCopsInsuranceModel.getSerialNumber());
|
77 |
params.put(MOBILE_IMEI, gadgetCopsInsuranceModel.getSerialNumber());
|
| Line 95... |
Line 92... |
| 95 |
|
92 |
|
| 96 |
Map<String, String> headers = new HashMap<>(0);
|
93 |
Map<String, String> headers = new HashMap<>(0);
|
| 97 |
//headers.put(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED_VALUE);
|
94 |
//headers.put(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED_VALUE);
|
| 98 |
|
95 |
|
| 99 |
try {
|
96 |
try {
|
| 100 |
restClient.post(URI, params, headers);
|
97 |
restClient.post(SchemeType.HTTP, HOST_NAME, 80, URI, params, headers);
|
| 101 |
} catch (HttpHostConnectException e) {
|
98 |
} catch (HttpHostConnectException e) {
|
| 102 |
// TODO Auto-generated catch block
|
99 |
// TODO Auto-generated catch block
|
| 103 |
e.printStackTrace();
|
100 |
e.printStackTrace();
|
| 104 |
}
|
101 |
}
|
| 105 |
}
|
102 |
}
|