Hi,
I have a 3 tier system using web services
I want to attach on the 3rd tier - data access
to the middle tier - business rules
and call the business rule tier from the front end to get the attachment
So the first problem is getting it from the back end tier to the middle tier
The middle tier calls the back end tier to get the attachment whci it then
streams and reattaches for the front end
1) Do I need to stream and reattach to the soap message or can I pass
Straight through to the front end
2) As the schema in 1 ie stream and reattach I can see the attachment added
in the data access tier but there is no attachment when it gets to the middle
tier
The basic code in my data access tier is
<WebMethod(BufferResponse:=True, _
MessageName:="streamServerAttachment", _
Public Sub streamServerAttachment()
..........
.................
' create dime attachment
objBuffer = New MemoryStream(objFile)
objDimeAttach = New Attachment(lcMimeType, objBuffer)
objContext = RequestSoapContext.Current
objContext.Attachments.Add(objDimeAttach)
......
End Sub
where in the debugger the attachment count is 1
When it returns to the business rule tier the count is zero
basic code is
Dim objStream As Stream
Dim objContext As HttpApplication
Dim objSoapContext As SoapContext
Dim ObjDimeAttach As Attachment
Dim lcMimeType As String
Dim arByte() As Byte
Dim objBuffer As MemoryStream
Try
' call attachment routine from data access tier
objAttachment.streamServerAttachment()
If objAttachment.RequestSoapContext.Attachments.Count <> 0 Then
objStream =
objAttachment.ResponseSoapContext.Attachments(0).S tream
objStream.Read(arByte, 0, objStream.Length)
lcMimeType = objCommon.getMimeType(p_nMimeType)
' repack
' create dime attachment
objBuffer = New MemoryStream(arByte)
ObjDimeAttach = New Attachment(lcMimeType, objBuffer)
objSoapContext = RequestSoapContext.Current
objSoapContext.Attachments.Add(ObjDimeAttach)
Any ideas please
TIA
Stu