473,387 Members | 1,542 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

WSE 3.0 - Byte array being encoded as Base64 and not “MTOM-ing” to binary

I have followed lots of examples of how MTOM/XOP works in WSE 3.0 and have set up my project exactly as it seems is required. I have a Byte array field that is designated as DataType:-base64Binary. In this I put the Byte array of the attachment I want to add. When I run the application and check the request, the data is encoded inline as base64, i.e. without the XOP Include element and associated MIME part.

My understanding of MTOM within WSE 3.0 was that, when encoding it will take any field designated as base64Binary and encode it as binary and move it to a MIME part, replacing it with an XOP Include element. That is to say, it just worked. But I have set the service, in the Reference file, to inherit Microsoft.Web.Services3.WebServicesClientProtocol and have set the RequireMtom flag to true, and it is still not encoding correctly.

Have I missed something here? Is there any other steps that should be implemented for this to work?

EDIT: After looking through my code for the 100th time, I am wondering if it might be due to the fact that I have to serialise the payload before running the ProcessMessage method. Does this sound like it could be a problem? The reason we have serialised is because the method we have to use accepts a "Payload" parameter which has a content property, this content property is an XMLElement property and the only way we can get this is to serialise the required class. But does this stop the MTOM recognising the data type of the base64 field and therefore not converted to binary with the MIME parts and XOP? Just really clutching at straws now.
Jan 24 '12 #1

✓ answered by Peadar McMahon

Ok I finally figured it out and it was to do with the serialisation before invoking the method. I rewrote the class that was passed in to the method so it didn't require an XMLElement as a property, and therefore a pre-serialised class, and passed that in. This works correctly, after only 3 or 4 weeks of work...If anyone wants more clarification I can try to get it down here.

1 2482
Ok I finally figured it out and it was to do with the serialisation before invoking the method. I rewrote the class that was passed in to the method so it didn't require an XMLElement as a property, and therefore a pre-serialised class, and passed that in. This works correctly, after only 3 or 4 weeks of work...If anyone wants more clarification I can try to get it down here.
Jan 25 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Skwerl | last post by:
I'm trying to quickly grab the dimensions out of the headers of JPEG files. I need to look for the hex string FFC0001108 in a file that will be from 1-40 megs in size. If someone has experience...
2
by: Dmitri Shvetsov | last post by:
Hi All, Does somebody know what's the length's ratio in we convert byte to base64 string? Is it a constant ratio or it can be different from case to case? For example if I convert a byte array...
4
by: Dan | last post by:
I need to convert a byte array to a string in order to upload a binary file with an httpWebRequest. What's the most efficient way to do such a conversion?
6
by: realgeek | last post by:
I have a byte array with binary data and I want to get its contants into a string. tagContent = System.Text.Encoding.ASCII.GetString(str); screws binary data. foreach (byte b in str)
1
by: Esref DURNA | last post by:
I was make an function which reads file from windows path and read that image with bytereader I able to make it, Then I try to get that image from httpwebrequest but I get convert'ing problems...
0
by: Moshe Kravchik | last post by:
Hi! I have a following problem. I have a web service (written in ATL Server). It has 2 function, lets name them getData and setData. The getData returns a byte array, setData receives a byte...
3
by: abarberis | last post by:
I'm very confused with this. I have a .NET web service that I am trying to pass a variant byte array to from the client side. If the signature of the web service is set to accept an Object it seems...
5
by: Trapulo | last post by:
Hello, I need to send to a webservice a parameter that is a string containing an XML doc. In this xml, a node value came from a byte array (it's an RSA signature). What is the best way to convert...
10
by: sebastian nielsen | last post by:
If I have this code: Dim fs As New System.IO.FileStream("C:\application.exe", System.IO.FileMode.Open) Dim br As New System.IO.BinaryReader(fs) Dim data() as Byte data =...
10
by: Chunekit Pong | last post by:
I have a BYTE array - BYTE const* pbBinary I would like to know how many bytes in that byte array but if I do - sizeof(* pbBinary); - then I got 1 but if I do - sizeof( pbBinary); - then I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.