Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems calling a web service from an .aspx page

Status
Not open for further replies.

Sanjeet1

Programmer
Sep 4, 2003
26
US
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()
 
Are they form objects? userid would then need to be userid.Text
marty
 
I meant calling from a web page sorry. I don't have a problem passing in the parameters its only when the byte array gets returned I get the error message.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top