Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
Posts: 18
Registered: ‎10-23-2012
My Device: 9500
My Carrier: Airtel

Web Service is Not Working..

Hi, i am useing this code to call a link, but not getting any responce..?

can any one help me..?

public class ConnectWebService
{
String _node,_element;
Connection _connectionthread;
String page;
String[] CategoryID_value = null;
String[] Date_value = null;

String str_value;
String str_name ;
String str_vanue ;
String str_start ;
String str_end ;

String[] _start = null;
String[] _end = null;
String[] _name = null;
String[] _venue = null;

public ConnectWebService()
{
}

public void WebServiceConnect(String page)
{
this.page = page;
_connectionthread = new Connection(page);
_connectionthread.start();
}

private class Connection extends Thread
{
String page;
public Connection(String page)
{
super();
this.page = page;
}

public void run()
{

Document doc;
StreamConnection conn;
try
{
String connectLink = "";
if(page.equals("News"))
connectLink = "http://api.search.yahoo.com/WebSearchService/V1/webSearch?appid=YahooDemo&query=umbrella&results=10";

System.out.println("Link:: "+connectLink);
conn=(StreamConnection)Connector.open(connectLink);
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder= docBuilderFactory.newDocumentBuilder();
docBuilder.isValidating();
doc = docBuilder.parse(conn.openInputStream());
doc.getDocumentElement().normalize();

NodeList CatIDlist = null;
CatIDlist = doc.getElementsByTagName("title");

NodeList DateIDlist = null;
DateIDlist = doc.getElementsByTagName("Date");

_node=new String();
_element = new String();

CategoryID_value = new String[CatIDlist.getLength()];
Date_value = new String[DateIDlist.getLength()];

_start = new String[CatIDlist.getLength()];
_end = new String[CatIDlist.getLength()];
_name = new String[CatIDlist.getLength()];
_venue = new String[CatIDlist.getLength()];

Object obj = Application.getEventLock();
for (int i=0;i<CatIDlist.getLength();i++)
{
synchronized(obj)
{
Element myNode = (Element) CatIDlist.item(i);
str_name = myNode.getAttribute("Name");
str_vanue = myNode.getAttribute("Venue");
str_start = myNode.getAttribute("Start_time");
str_end = myNode.getAttribute("End_time");
}
_start[i] = str_start;
_end[i] = str_end;
_name[i] = str_name;
_venue[i] = str_vanue;
/*System.out.println("str_name " + str_name);
System.out.println("str_vanue " + str_vanue);
System.out.println("str_value " + str_start);
System.out.println("str_value " + str_end);*/
}

conn.close();
}
catch (Exception e)
{
System.out.println(e.toString());
}
if(page.equals("Conf"))
{
UiApplication.getUiApplication().invokeLater(new Runnable()
{

public void run()
{
// ConferenceListView clv = new ConferenceListView(_start,_end,_name,_venue);
//UiApplication.getUiApplication().pushScreen(clv);
}
});
}
}
}
}

Contributor
Posts: 18
Registered: ‎10-23-2012
My Device: 9500
My Carrier: Airtel

Re: Web Service is Not Working..

 

"http://feeds.feedburner.com/snmsiteupdates" this address in geeting problem to call

Developer
Posts: 16,651
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Web Service is Not Working..

well, if you open the url in the browser it says "the service has been shut down", sounds like an explaination to me
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
Posts: 18
Registered: ‎10-23-2012
My Device: 9500
My Carrier: Airtel

Re: Web Service is Not Working..

HI simon,

 

i didn't get it..

this web address is correctly working with android .but not working in blackberry. .

Developer
Posts: 19,624
Registered: ‎07-14-2008
My Device: Not Specified

Re: Web Service is Not Working..

Just tried this URL:

http://feeds.feedburner.com/snmsiteupdates

on by BB device, got some data with the following error message:

 

This page contains the following errors:

 

error on line 486 at column 68:xmlParseEntityRef: no name.

 

Perhaps you are getting data and the data is not valid?

Developer
Posts: 53
Registered: ‎12-31-2010
My Device: 9800
My Carrier: Airtel

Re: Web Service is Not Working..

when i call the url, its showing error.
<Error>
The following errors were detected:
<Message>The service has been shut down. For further details, please see the Deprecated Services blog post http://developer.yahoo.com/blogs/ydn/posts/2010/08/api_updates_and_changes</Message></Error><!-- ws02.ydn.ac4.yahoo.com uncompressed/chunked Mon Feb 18 00:10:52 PST 2013 -->

Please check your url
R33