Last post Jun 03, 2013 08:54 AM by OzgurAkin
May 31, 2013 03:35 AM|OzgurAkin|LINK
I need to create a web service used by a government project. I am using vb.net 2010. The procedure should be like this:
function sendfile(byval reqdoc as DocumentRequest) as DocumentResponce
The type DocumentRequest should be like
public class DocumentRequest
public docType as DocumentType
public Class DocumentType
Public FileName As String
Public Hash As String
Public BinaryData() As Byte
Document Response is simple
Public Class DocumentResponse
Public Hash As String
Public Msg As String
I can do this using datacontract and datamember attributes. But to be able to use MTOM, I have searched internet and find that I should use messagecontract instead of datacontract. I should define messagebody as byte array and other field at messageheader.
I can not define such a declaration. Even skipping middle documentrequest type and using directly document type in the function I can not use the resulted web service in other programs. Can I define such a function with WCF? With WSE 3.0 it was easy, But I
can not use WSE 3.0 becouse it is obselete and IE 7.0 can not work with wse 3.0. What can I do?
May 31, 2013 05:28 PM|Illeris|LINK
Check this : http://msdn.microsoft.com/en-us/library/aa528822.aspx
It shows you how to enable MTOM for asmx webservice.
For WCF :
Jun 01, 2013 07:21 AM|OzgurAkin|LINK
doing with asmx is easy. But we can not use wse 3.0 with IE 7.0. I need to solve the problem with WCF. I need to send a struct to the function sendfile. The example you send is a basic one, and the parameter of function is a simple stream.
Jun 03, 2013 08:24 AM|Illeris|LINK
You can use the FileResponse principle for input arguments also...
Jun 03, 2013 08:54 AM|OzgurAkin|LINK
I have tryed:
Public FileName as string
I start that and try to use from a test client, I can not see DocumentType as a type. If I manually code the type and use in th sendfile function, IDE gives an error that the procedure waits for a simple byte arrary as argument. Also, I could not find a way
to constract the necessary top level struct.
should use in the function parameter RequestType defined like
it is not working. There are to few examples on MTOM with WCF. I could not find any other document saying that MTOM is only avaible through MessageContract. Even MessageContract section of framework 4.0 help file does not mention anything about MTOM.