dimOn писал(а):
Совершенно бессмысленно что-то советовать, если непонятно не только что нужно в итоге, но даже в чём конкретно проблема в данный момент.
Сторонняя система, crm, там записываются поля об абоненте (параметры договора). Есть ограничение на количество символов в урле. Охото получать из этой системы данные и записывать в параметры договора в биллинг.
Код:
String authtoken = "218587c";
String targetURL = "https://crm.zoho.com/crm/private/xml/Accounts/getRecordById?id="+AccountId;//20795";
String paramname = "content";
PostMethod post = new PostMethod(targetURL);
post.setParameter("authtoken",authtoken);
post.setParameter("scope","crmapi");
HttpClient httpclient = new HttpClient();
PrintWriter myout = null;
/*-------------------------------------- Execute the http request--------------------------------*/
try
{
long t1 = System.currentTimeMillis();
int result = httpclient.executeMethod(post);
System.out.println("HTTP Response status code: " + result);
System.out.println(">> Time taken " + (System.currentTimeMillis() - t1));
/*-------------------------------------- Execute the http request--------------------------------*/
/* ---------------------------writing the response to a file--------------------*/
//myout = new PrintWriter(new File("response.xml"));
//myout.print(post.getResponseBodyAsString());
//myout.flush();
//myout.close();
/*File f = new File("/usr/local/BGBillingServer/response1.xml");
myout = new PrintWriter(f);
System.out.println("f.length() "+f.length());
myout.flush();
myout.close();
System.out.println("f.exists() "+f.exists());*/
/* ---------------------------writing the response to a file--------------------*/
/*-----------------------Get response as a string ----------------*/
String postResp = post.getResponseBodyAsString();
System.out.println("postResp=======>"+postResp);
вот единственное что есть в примерах получения
_________________
Код:
Клиент: вер. 6.2.714 / 25.05.2015 17:27:15
os: Linux; java: Java HotSpot(TM) 64-Bit Server VM, v.1.8.0_45
Сервер: вер. 6.2.881 / 22.05.2015 17:56:55
os: Linux; java: Java HotSpot(TM) 64-Bit Server VM, v.1.8.0_45
Помощь по администрированию bgbilling в jabber конференции или Группа в telegramСтиль программирования - пьяный мастерстер
Разработка мобильных приложений