All,
I made a webservice and can Invoke the HelloWorld that gets made by the IDE. I also made a Webmethod that returns a record set thing and that seems to work fine, I can breakpoint in the code and everything.\
However the following Webmethod does not work with the string argument:
However, if I remove the string argument, I can call the Webmethod just fine.Code:[WebMethod] public byte[] FilePickUp(string sFileName) { string sFilePath="C:\\Temp\\Dave.png"; byte[] byteContent = null; try { if (IsFileExist(sFilePath) == true) { FileStream fs = new FileStream(sFilePath, FileMode.Open, FileAccess.ReadWrite); byteContent = new byte[fs.Length]; fs.Read(byteContent, 0, (int)fs.Length); fs.Close(); } else { byteContent=new byte[1]; byteContent[0]=0; } } catch(Exception ex) { throw ex; } return byteContent; }
The Webmethod compiled with the string argument shows a text box under the Invoke button when I run from the IDE. However pressing Invoke just causes a nasty error:
So when I remove the string argument I can call the Webmethod just fine, and get the .PNG junk dumped back into my browser.HTML Code:The page cannot be displayed There is a problem with the page you are trying to reach and it cannot be displayed. -------------------------------------------------------------------------------- Please try the following: Open the localhost:1639 home page, and then look for links to the information you want. Click the Refresh button, or try again later. Click Search to look for information on the Internet. You can also see a list of related sites. HTTP 500 - Internal server error Internet Explorer
Any ideas?




Reply With Quote