on 10-26-2011 11:13 AM
Hi,
I wrote a wd java application to get weather information from google url for a city
('http://www.google.com.tr/ig/api?weather=istanbul') .
When i execute program it gets error below:
WDURLExceptionFailed to generate URL to deployable object 'http://www.google.com.tr/ig/api?weather=istanbul', application 'ApproverInbox'.
What must i do the program run properly? Does it need some configuration on portal?
Thanks.
Below is source code.
String l_strXMLPath = null;
try {
l_strXMLPath = WDURLGenerator.getApplicationURL("http://www.google.com.tr/ig/api?weather=istanbul", "ApproverInbox");
FileReader l_xmlTemplate = new FileReader(l_strXMLPath);
InputSource l_inputSource = new InputSource(l_xmlTemplate);
DocumentBuilderFactory l_dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder l_db = l_dbf.newDocumentBuilder();
Document l_xmlDoc = null;
l_xmlDoc = l_db.parse(l_inputSource);
NodeList XML_BookNode = l_xmlDoc.getElementsByTagName("forecast_conditions");
for (int i = 0; i < XML_BookNode.getLength(); i++) {
Node XML_Node = XML_BookNode.item(i);
IPrivateKurApp2View.IForecast_conditionsElement l_bookEle =
wdContext.nodeForecast_conditions().createForecast_conditionsElement();
l_bookEle.setDay_of_week(
XML_Node
.getChildNodes()
.item(1)
.getChildNodes()
.item(0).getAttributes()
.toString());
l_bookEle.setLow(
XML_Node
.getChildNodes()
.item(3)
.getChildNodes()
.item(0).getAttributes()
.toString());
l_bookEle.setHigh(
XML_Node
.getChildNodes()
.item(5)
.getChildNodes()
.item(0).getAttributes()
.toString());
l_bookEle.setIcon(
XML_Node
.getChildNodes()
.item(7)
.getChildNodes()
.item(0).getAttributes()
.toString());
l_bookEle.setCondition(
XML_Node
.getChildNodes()
.item(9)
.getChildNodes()
.item(0).getAttributes()
.toString());
wdContext.nodeForecast_conditions().addElement(l_bookEle);
}
} catch (WDURLException e) {
wdComponentAPI.getMessageManager().reportSuccess(
"WDURLException" + e.getMessage());
} catch (FileNotFoundException e) {
wdComponentAPI.getMessageManager().reportSuccess(
"FileNotFoundException" + e.getMessage());
} catch (FactoryConfigurationError e) {
wdComponentAPI.getMessageManager().reportSuccess(
"FactoryConfigurationError" + e.getMessage());
} catch (SAXException e) {
wdComponentAPI.getMessageManager().reportSuccess(
"SAXException" + e.getMessage());
} catch (ParserConfigurationException e) {
wdComponentAPI.getMessageManager().reportSuccess(
"ParserConfigurationException" + e.getMessage());
} catch (IOException e) {
wdComponentAPI.getMessageManager().reportSuccess(
"IOException" + e.getMessage());
}
who told you to use this WDURLGenerator.getApplicationURL?
Do you know what is this api for?have you ever read the api doc?
i think you should use java.net.URL
Edited by: John Wu on Oct 26, 2011 12:44 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.