When I call my web service from a web service I use this line of code:
ImageDB(0) = WS.RetreiveImageDB(userid, patientid, recordid)
This is the format of my web service:
<WebMethod()> _
Public Function RetreiveImageDB(ByVal uid As String, ByVal pid As String, ByVal rid As String) As Byte()
' MY code
Return b
End Function
This is the error message I get:
Input string was not in a correct format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.FormatException: Input string was not in a correct format.
Source Error:
Line 66: Dim WS As New ImageRetreival.WS1.GetImage
Line 67: Dim ImageDB As Byte()
Line 68: ImageDB(0) = WS.RetreiveImageDB(userid, patientid, recordid)
Line 69: Dim strfn As String = Convert.ToString(DateTime.Now.ToFileTime)
Line 70: Dim fs As New FileStream(strfn, FileMode.CreateNew, FileAccess.Write)
Source File: C:\Inetpub\ Line: 68
Stack Trace:
[FormatException: Input string was not in a correct format.]
Microsoft.VisualBasic.CompilerServices.DoubleType.Parse(String Value, NumberFormatInfo NumberFormat)
Microsoft.VisualBasic.CompilerServices.DoubleType.Parse(String Value)
Microsoft.VisualBasic.CompilerServices.ByteType.FromString(String Value)
[InvalidCastException: Cast from string "/9j/4AAQSkZJRgABAgEAYABgAAD/7RBK" to type 'Byte' is not valid.]
Microsoft.VisualBasic.CompilerServices.ByteType.FromString(String Value)
ImageRetreival.image.Page_Load(Object sender, EventArgs e) in C:\Inetpub\ System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()
ImageDB(0) = WS.RetreiveImageDB(userid, patientid, recordid)
This is the format of my web service:
<WebMethod()> _
Public Function RetreiveImageDB(ByVal uid As String, ByVal pid As String, ByVal rid As String) As Byte()
' MY code
Return b
End Function
This is the error message I get:
Input string was not in a correct format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.FormatException: Input string was not in a correct format.
Source Error:
Line 66: Dim WS As New ImageRetreival.WS1.GetImage
Line 67: Dim ImageDB As Byte()
Line 68: ImageDB(0) = WS.RetreiveImageDB(userid, patientid, recordid)
Line 69: Dim strfn As String = Convert.ToString(DateTime.Now.ToFileTime)
Line 70: Dim fs As New FileStream(strfn, FileMode.CreateNew, FileAccess.Write)
Source File: C:\Inetpub\ Line: 68
Stack Trace:
[FormatException: Input string was not in a correct format.]
Microsoft.VisualBasic.CompilerServices.DoubleType.Parse(String Value, NumberFormatInfo NumberFormat)
Microsoft.VisualBasic.CompilerServices.DoubleType.Parse(String Value)
Microsoft.VisualBasic.CompilerServices.ByteType.FromString(String Value)
[InvalidCastException: Cast from string "/9j/4AAQSkZJRgABAgEAYABgAAD/7RBK" to type 'Byte' is not valid.]
Microsoft.VisualBasic.CompilerServices.ByteType.FromString(String Value)
ImageRetreival.image.Page_Load(Object sender, EventArgs e) in C:\Inetpub\ System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()