You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Pivot-Steven Dahlin <pi...@gmail.com> on 2010/03/14 00:09:20 UTC

with webquery getting "uri can't be null"

In executing a webquery I am getting a "Uri can't be null" when trying to
execute a query.  It is a sample app for showing restaurants.  I setup the
query like so:

        GetQuery getQuery = new GetQuery("http://local.yahooapis.com",

"/LocalSearchService/V3/localSearch" );
        getQuery.getParameters().put("appid", "YahooDemo");
        getQuery.getParameters().put("query", "pizza");
        getQuery.getParameters().put("location", txtFind.getText());
        getQuery.getParameters().put("distance", "5");
        getQuery.getParameters().put("output", "json");

        getQuery.execute();

The execute returns an exception "Uri can't be null".  If I execute a
browser query with this everything works fine.  The hostname is filled out
as is the path so I am a little unsure of what is happening here

Thanks

Re: with webquery getting "uri can't be null"

Posted by Pivot-Steven Dahlin <pi...@gmail.com>.
I realized that after I had sent the message.  Thanks for you help!

On Sun, Mar 14, 2010 at 6:45 AM, Greg Brown <gk...@mac.com> wrote:

> Try dropping the protocol from the first argument (it is only supposed to
> contain the host name).
>
> On Mar 13, 2010, at 6:09 PM, Pivot-Steven Dahlin wrote:
>
> In executing a webquery I am getting a "Uri can't be null" when trying to
> execute a query.  It is a sample app for showing restaurants.  I setup the
> query like so:
>
>         GetQuery getQuery = new GetQuery("http://local.yahooapis.com",
>
> "/LocalSearchService/V3/localSearch" );
>         getQuery.getParameters().put("appid", "YahooDemo");
>         getQuery.getParameters().put("query", "pizza");
>         getQuery.getParameters().put("location", txtFind.getText());
>         getQuery.getParameters().put("distance", "5");
>         getQuery.getParameters().put("output", "json");
>
>         getQuery.execute();
>
> The execute returns an exception "Uri can't be null".  If I execute a
> browser query with this everything works fine.  The hostname is filled out
> as is the path so I am a little unsure of what is happening here
>
> Thanks
>
>
>

Re: with webquery getting "uri can't be null"

Posted by Greg Brown <gk...@mac.com>.
Try dropping the protocol from the first argument (it is only supposed to contain the host name).

On Mar 13, 2010, at 6:09 PM, Pivot-Steven Dahlin wrote:

> In executing a webquery I am getting a "Uri can't be null" when trying to execute a query.  It is a sample app for showing restaurants.  I setup the query like so:
> 
>         GetQuery getQuery = new GetQuery("http://local.yahooapis.com",
>                                          "/LocalSearchService/V3/localSearch" );
>         getQuery.getParameters().put("appid", "YahooDemo");
>         getQuery.getParameters().put("query", "pizza");
>         getQuery.getParameters().put("location", txtFind.getText());
>         getQuery.getParameters().put("distance", "5");
>         getQuery.getParameters().put("output", "json");
> 
>         getQuery.execute();
> 
> The execute returns an exception "Uri can't be null".  If I execute a browser query with this everything works fine.  The hostname is filled out as is the path so I am a little unsure of what is happening here
> 
> Thanks