Log in or register to post comments

Web Service

March 8, 2016 - 7:00am #1

I am now working with vuforia web service in Eclipse and encounter a problem.  Here is my code which is download from the Vuforia Web Services JAVA example.

 

public String getTargets() throws URISyntaxException, ClientProtocolException, IOException {
		

		 Thread thread=new Thread(new Runnable(){

			@Override
			public void run() {
				// TODO Auto-generated method stub
				try{
				HttpGet getRequest = new HttpGet();
				HttpClient client = new DefaultHttpClient();
				getRequest.setURI(new URI(url + "/targets"));
				setHeaders(getRequest);
				HttpResponse response = client.execute(getRequest);
				temp=EntityUtils.toString(response.getEntity());
				System.err.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"+temp);
			}
			catch(Exception e)
			{
				System.err.println("***************************************************");
				e.printStackTrace();
			}		
			}	
			 
		 });
		 thread.start();
		
		
		return temp;
	}

The result of temp is print out of  "Only https connenctions are allowed" . Can anybody tell me what the problem is and how to solve it ? Many thanks!

AttachmentSize
Image icon qq.png35.01 KB
Log in or register to post comments