Solved it myself:

Using VB.NET, attach a webservice (in the sample below I called the
attached webservice wsTestAttach) to the project (use the Web
Reference structure):

Imports System.IO

 Private Sub btnCreateAttach_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnCreateAttach.Click

        Dim myService As wsTestAttach.TestAttachmentService = New
wsTestAttach.TestAttachmentService
        Dim myName As wsTestAttach.AuthenticationInfo = New
wsTestAttach.AuthenticationInfo

        Dim sName As String
        Dim od As New OpenFileDialog
        Dim input As FileStream

        If od.ShowDialog() = DialogResult.OK Then
            input = File.OpenRead(od.FileName)
        End If

        Dim fi As FileInfo = New FileInfo(od.FileName)
        Dim ltemp As Long = fi.Length
        Dim ilung As Integer = Convert.ToInt32(ltemp)

        Dim doc(ilung) As Byte
        input.Read(doc, 0, ilung)
        input.Close()

        sName = od.FileName.Substring(od.FileName.LastIndexOf("\") +
1)

        myService.OpCreate(sName, doc, ilung, "assign to text", "short
desc", wsTestAttach.StatusType.Assigned, "someuser")

    End Sub

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor: RMI Solutions ARSlist: "Where the Answers Are"

Reply via email to