| Author: J Ramesh 04 Sep 2008 | Member Level: Silver | Rating:  Points: 2 |
Hi Ben,
Did you check whether you have the write permissions to the folder where you are trying to generate the PDF file through webservice.
Check that may be the folder does not have permission to write.
Regards Ramesh
|
| Author: Ben 05 Sep 2008 | Member Level: Bronze | Rating:  Points: 2 |
Hi Ramesh, Thanks for your reply. Yes i do have the write permission for that folder. I have opened a txt editor and i was able to save a file. i was also copy few pdf documents to that folder also. Let me know if anything else i can do in this regard.
Thanks
|
| Author: J Ramesh 08 Sep 2008 | Member Level: Silver | Rating: Points: 1 |
Hi Ben,
What is the error (if any) you are getting when trying to write the file in folder.
I think the other issue can be the com object which you use, check if the ASP.Net user has permissions to access the com object and the com object is available in the webserver.
Hope this helps
regards Ramesh
|
| Author: Ben 08 Sep 2008 | Member Level: Bronze | Rating:  Points: 2 |
Hi ramesh,
Thanks for the reply. i think that the web services object has permission.. can u be more specfif how can i check that.. To be more clear form me .. The web service works very well in the developer machine. When published into the web server all the web services works well EXCEPT one service.( This web service is to check for an existing pdf file. if that file does not exist then create it in the root folder say ABC folder that has all the rights to write a file into it). The users can open the file if exists and shows http 500 error if not exists. I tried to install VS in the web server and debug the web services and the files get created in that folder. But when i try browse as a user..it gives me a error that file is not existing. I also tried to debug the website source file in the webserver and it give me a file not found catch error. Hope i am clear and let me know if i hve to do something else.
|
| Author: J Ramesh 09 Sep 2008 | Member Level: Silver | Rating:   Points: 3 |
Hi Ben,
I think I understand your problem, it is that if you dont have a file (pdf) in the specific location then you are getting error. I think you are getting the error because you are not checking if the file exists before opening.
I suggest you do the following: 1. Check for the File in the Directory before trying to open.
2. If the file exists then you say it works, if the file is not there then write a else case to create the file and then try to open,
regards Ramesh
|
| Author: Ben 09 Sep 2008 | Member Level: Bronze | Rating:   Points: 3 |
Hi Ramesh . Thanks for your time.I hve that file check option coded when i was doing my webmethod itself.. to be more clear.. i am giving you the issue again.
I developed a web services with few methods. one of the web method is called as getpaycheckimg() is to create a pdf file in a C:\foldername, and display that file to the user. All the web methods including this method works great in the DEVELOPMENT machine. When the webservice is being published into the WEBSERVER (ie. in Inetpub/wwwroot/webservice/foldername.) all the web methods works fine except this one and i get an error in the client machine that the pdf file is not found. When i installed vs2008 in the webserver and tried to copy the source code of the web services and debug it it works great creating the file and no errors come up. But when i tried to openup the website source code in the webserver and tried to invoke the web method this web method alone gives me an error as http 500 and upon refresh of the error page i get " Request format is unrecognized for URL unexpectedly ending in '/Getpaycheckimg'. I tried to browse in the google and found few step to work out but i am unable to fix this. Let me know what changes i have to do so that i can solve the issue. note: Inside the web method i am using the doucument com object( a third party software) to write the pdf file the return type is as a Byte[] array. All the webmethod expect this method works great and fine in the development machine. and also in the web server. I am struck out and not able to move futher. Solving this would be a great help. Thanks
|
| Author: J Ramesh 19 Sep 2008 | Member Level: Silver | Rating:  Points: 2 |
Hi Ben,
Iam assuming that you have provided physical path in your webservice "C:\foldername". You cannot use physical path, It should be the virtual path like "http://yourwebsitename/foldername".
If your webservice/virtualdirectory is in location say "C:\Inetpub\wwwroot\foldername\*.asmx", then create a folder at this place to write your pdf and use "~/foldername/*.pdf" to write it.
I hope it is the problem.
Regards Ramesh
|