2013-12-10 40 views

回答

0

您可以簡單地從webservices調用那些鋸齒狀端點。 對這些端點做一個簡單的HTTP Post;

如:

// create a post request to addAPI. 
String addAPIendpoint = "http://localhost:9763/publisher/site/blocks/item-add/ajax/add.jag"; 
      HttpClient httpclient = new DefaultHttpClient(); 
      HttpPost httppost = new HttpPost(addAPIendpoint); 

// Request parameters and other properties. 
      List<NameValuePair> params = new ArrayList<NameValuePair>(12); 
params.add(new BasicNameValuePair(API_ACTION, API_ADD_ACTION)); 
      params.add(new BasicNameValuePair(API_NAME, serviceName)); 
      params.add(new BasicNameValuePair(API_CONTEXT, serviceName)); 
..... 

    HttpResponse response = httpclient.execute(httppost, httpContext);