B
Brybot
I am trying to allow HTTP POST file uploads to my web service.
Currently I have it working perfectly for a SOAP/XML request reading
in a byte[ ] using MemoryStream/FileStream but I cannot figure out how
to encode a file on a POST to the same web service. The definition
requires a base64binary encoded file, which I have tried. The form is
also using a mutlipart/form-data enctype, but I either get a 500 error
or 'Request format is invalid'. Is there a trick to serializing a
form so that the web service will accept it as a byte[ ]?
Alternatively, I would be happy to differentiate the methods used and
create the files accordingly, ie. if its done over SOAP/XML use my
current method, or if its a POST call, use HttpFileCollection or
something? Can you differentiate how a web service was called within
the service itself?
Currently I have it working perfectly for a SOAP/XML request reading
in a byte[ ] using MemoryStream/FileStream but I cannot figure out how
to encode a file on a POST to the same web service. The definition
requires a base64binary encoded file, which I have tried. The form is
also using a mutlipart/form-data enctype, but I either get a 500 error
or 'Request format is invalid'. Is there a trick to serializing a
form so that the web service will accept it as a byte[ ]?
Alternatively, I would be happy to differentiate the methods used and
create the files accordingly, ie. if its done over SOAP/XML use my
current method, or if its a POST call, use HttpFileCollection or
something? Can you differentiate how a web service was called within
the service itself?