After some helpful hints from folks in this newsgroup, I finally got my
webservice consumer to get SOMETHING back from my very simple web service.
(see below)
What I get back, however, is a string that looks like this:
<?xml version="1.0" encoding="utf-8"?>
<base64Binary
xmlns="http://bencoTest.org/">VGhpcyBpcyBqdXN0IGEgc2ltcGxlIHRleHQgZmlsZSB1c2Vk IHRvIHRlc3QNCnRoZSB3ZWIgc2VydmljZXMuIFdlIHdhbnQgdG 8gdXNlIHNvbWUgY2FycmlhZ2UNCnJldHVybnMgYW5kIGxpbmUg ZmVlZHMsIGp1c3QgdG8gbWFrZSBzdXJlDQppdCB3b3JrcyBwcm 9wZXJseQ==</base64Binary>
My question now is, how do I get this back to disk in the same format (.zip)
as the original?
I've tried removing the XML stuff and using Utility.base74decode on the
remainder, but that doesn't work.
Thanks in advance,
Joe
====================
<WebService(Namespace:="http://bencoTest.org/")_
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicPr ofile1_1)_
<Global.Microsoft.VisualBasic.CompilerServices.Des ignerGenerated()_
Public ClassService
InheritsSystem.Web.Services.WebService
<WebMethod()_
PublicFunction RetrieveZip() As Byte()
DimFilePath As String= "C:\test.zip"
Dimfs As FileStream
Try
' Read file and return contents
fs = File.Open(FilePath, FileMode.Open, FileAccess.Read)
DimlngLen As Long= fs.Length
DimabytBuffer(CInt(lngLen - 1)) As Byte
fs.Read(abytBuffer, 0, CInt(lngLen))
ReturnabytBuffer
Finally
' Make sure that file stream is
' closed even if an error occurs.
fs.Close()
EndTry
EndFunction