2013-02-15 45 views
0
protected void onPreExecute() 
       { 
        super.onPreExecute();    
        progressDialog = ProgressDialog.show(getActivity(),"Fetching", "Fetching Contacts", true, false); 
       } 

       @Override 


       protected ArrayList<String> doInBackground(Void... params) { 

       // TODO Auto-generated method stub 

       ODataConsumer c = ODataJerseyConsumer.create("http://mythreeg.dyndns.org:8088/WcfService_Officetail/WcfDataService.svc/VW_CONTACTS()/?$filter=mobile ne null"); 

       List<OEntity> listEntities = c.getEntities("VW_CONTACTS").execute().toList(); 

       System.out.println("Size - " + listEntities.size()); 



        for (OEntity entity : listEntities) { 

         categories.add((String) entity.getProperty("contact_name").getValue() + (String) entity.getProperty("mobile").getValue()); 

        } 

錯誤:拋出:IllegalArgumentException:在查詢非法字符

02-15 13:26:26.260: E/AndroidRuntime(330): Caused by: java.lang.IllegalArgumentException: Illegal character in query at index 102: 
    http://mythreeg.dyndns.org:8088/WcfService_Officetail/WcfDataService.svc/VW_CONTACTS()/?$filter=mobile ne null/$metadata 

回答

0

請嘗試以下網址是在這裏工作

mythreeg.dyndns.org:8088/WcfService_Officetail/WcfDataService.svc/VW_CONTACTS/?$ filter = mobile%20ne%20null

0

您可以使用Url.Encoder和URL.Decoder來解決有關URL中使用的特殊字符的非法參數Ecxeption的問題。

0

試試這個

url="http://mythreeg.dyndns.org:8088/WcfService_Officetail/WcfDataService.svc/VW_CONTACTS()/?$filter=mobile ne null"; 
url.replaceAll(" ","%20"); 
ODataConsumer c = ODataJerseyConsumer.create(url); 

只需更換與20%的空間,它爲我工作

相關問題