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());

                    }

错误:

    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
4

3 回答 3

0

请尝试下面的 URL 它在这里工作

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

于 2013-02-15T08:54:15.673 回答
0

您可以使用 Url.Encoder 和 URL.Decoder 来解决有关 URL 中使用的特殊字符的非法参数 Ecxeption 的问题。

于 2013-02-15T09:03:25.843 回答
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 它对我有用

于 2016-10-12T21:24:55.147 回答