Welcome! Log In Create A New Profile

Advanced

Web Service not returning data from database

Posted by Prolay Sarkar 
Prolay Sarkar
Web Service not returning data from database
January 16, 2009 09:56AM
Hi,

I have deployed the following files
Final_WebService.WDL
Final_WebService.XML , I have configured the IIS properly and the web service is working fine when i return some static value from the web service like the procedure below

PROCEDURE ret()

RETURN "Hello"

but it gives me an error when i use to retrieve data from a table like the procedure below.

______________________________________________
PROCEDURE CheckLogin(b)
user is Clogin_master
ds is Data Source
Deserialize(user,b,psdXML)
MemoryToFile(user,login_master)
HExecuteSQLQuery(ds,"select * from login_master where user_id='"+ user:user_id+"'")
HReadFirst(ds)
IF HFound(ds) THEN
RESULT "True"
ELSE
RESULT "False"
END
_________________________________________________
I have WDL and XML files hosted , do i have to host any other analysis or class files to the soap server. I am receiving this error when i execute the web service
"analysis query/view not initialized". Does the deployment pc requires windev installed on it?? or i am missing something. I have tested the procedure without deoloying and it is working fine.

URGENT!! Please help!!

Regards,
Prolay
Paulo Oliveira
Re: Web Service not returning data from database
January 16, 2009 10:52AM
probably some dll's are missing.
To test webservices i use one text file to log all the possible errors, this is the only way i know to see what is hapening.

wlog is int=Fopen("c:\log_wbserv\log.txt,foCreateIfNotExist)
if not HExecuteSQLQuery(ds,"select * from login_master where user_id='"+ user:user_id+"'") then
fwriteline(wlog,"execsql "+errorinfo())
end
if not HReadFirst(ds) then
fwriteline(wlog,"readfirst "+errorinfo())
end
fclose(wlog)


Paulo Oliveira
Re: Web Service not returning data from database
January 16, 2009 10:57AM
Sorry,
The code isn't tested as you can see (missing one " in the Fopen), but I hope the idea helps.
Prolay Sarkar
Re: Web Service not returning data from database
January 16, 2009 11:29AM
Please help out with this error

execsql OLE DB access error.
Error Number = 170124

Failure opening connection:
Data Source: <RAHULA-PC>
OLEDB Provider: <SQLOLEDB>
Détail de l'erreur système : Description = Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
Source = Provider
Help Context = 1240640
Error Number = -2147217887
Native Error Number = -2147217887
Prolay Sarkar
Re: Web Service not returning data from database
January 16, 2009 12:02PM
Hi,

Data Source: RAHULA-PC
OLEDB Provider: SQLOLEDB

why is the webservice not able to access database? I tried it with other computer's address having the same database and still giving me that error. And how to dynamically allocate the connection string. Because different servers can have different connections to database

Regards,
Prolay
Fabrice Harari
Re: Web Service not returning data from database
January 16, 2009 12:04PM
Hi Prolay...

I totally agree with Paulo that you should test the return values of your functions... But just by reading your code, I have several things that look strange to me:

1. You are writing
ds is Data Source
But there is no definition of the source that I can see... How is your code supposed to know which DB to connect too if you are not defining it?

2. You are doing
MemoryToFile(user,login_master)
Why? This should be used to fill a file buffer before writing it to a file... And you are instead doing it just before a query on that file

Hope this help
Prolay Sarkar
Re: Web Service not returning data from database
January 16, 2009 02:39PM
Hi,

Problem Solved
The default connection to database was giving this error so i defined my own connection and it was working fine. I think the problem is related to the provider.

and MemoryToFile , I use it to insert data into the database, I know it was not required here!! and ds is temporary data source this is what i read in the tutorial. Am i Wrong??

Regards,
Prolay
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: