DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Bob Anderson Guest

    Passing a stream to a Web Service


    I'd like to set up a VB client app which will allow users to scan
    documents into .tif (image) files. I would like to send these
    files to Web Service running on a server where they can be stored,
    catalogued and referenced.

    When I use -

    m_WebService1.BeginWrite_Image(ImgStream, strContext,
    New AsyncCallback(AddressOf Me.SendImgParmsCallBack), Nothing)

    I get the error

    Value of type 'System.IO.Stream' cannot be converted to
    WindowsApplication.WebReference1.Stream

    Any suggestions?



    Bob Anderson

  2. #2
    Chris Deceuninck Guest

    Re: Passing a stream to a Web Service


    "Bob Anderson" <parksys741@hotmail.com> wrote:
    >
    >I'd like to set up a VB client app which will allow users to scan
    >documents into .tif (image) files. I would like to send these
    >files to Web Service running on a server where they can be stored,
    >catalogued and referenced.
    >
    >When I use -
    >
    >m_WebService1.BeginWrite_Image(ImgStream, strContext,
    > New AsyncCallback(AddressOf Me.SendImgParmsCallBack), Nothing)
    >
    > I get the error
    >
    >Value of type 'System.IO.Stream' cannot be converted to
    >WindowsApplication.WebReference1.Stream
    >
    >Any suggestions?
    >
    >
    >
    >Bob Anderson


    Bob,

    I have experienced the same problem. Somehow it seems logical to me that
    the webservice creates a new (proxy) object that is exposed to the 'public'
    so that the 'public' using the webservice knows how the object looks like
    if the webservice returns one.

    I want to do the same with a custom made object (e.g. a Person object) and
    when retrieving this object via a webservice with the function GetPerson()
    as Person it returns me a Person object created by the webservice but not
    my original one. Marking this Person object as serializable or even implementing
    custom serialization doesn't really change a thing. However when retrieving
    a dataset via a webservice, there seems to be no problem at all. So there's
    probably a way...

    Anyone a solution?

    Chris

  3. #3
    Bob Anderson Guest

    Re: Passing a stream to a Web Service


    Got the answer in another discussion group. Instead of a stream I used
    a byte array and it worked fine.

    "Chris Deceuninck" <deceuninck@yahoo.com> wrote:
    >
    >"Bob Anderson" <parksys741@hotmail.com> wrote:
    >>
    >>I'd like to set up a VB client app which will allow users to scan
    >>documents into .tif (image) files. I would like to send these
    >>files to Web Service running on a server where they can be stored,
    >>catalogued and referenced.
    >>
    >>When I use -
    >>
    >>m_WebService1.BeginWrite_Image(ImgStream, strContext,
    >> New AsyncCallback(AddressOf Me.SendImgParmsCallBack), Nothing)
    >>
    >> I get the error
    >>
    >>Value of type 'System.IO.Stream' cannot be converted to
    >>WindowsApplication.WebReference1.Stream
    >>
    >>Any suggestions?
    >>
    >>
    >>
    >>Bob Anderson

    >
    >Bob,
    >
    >I have experienced the same problem. Somehow it seems logical to me that
    >the webservice creates a new (proxy) object that is exposed to the 'public'
    >so that the 'public' using the webservice knows how the object looks like
    >if the webservice returns one.
    >
    >I want to do the same with a custom made object (e.g. a Person object) and
    >when retrieving this object via a webservice with the function GetPerson()
    >as Person it returns me a Person object created by the webservice but not
    >my original one. Marking this Person object as serializable or even implementing
    >custom serialization doesn't really change a thing. However when retrieving
    >a dataset via a webservice, there seems to be no problem at all. So there's
    >probably a way...
    >
    >Anyone a solution?
    >
    >Chris



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links