RE: Possible value for type parameter in DimeAttach constructor
- From: VancouverMike <VancouverMike@xxxxxxxxxxxxxxxxx>
- Date: Tue, 21 Nov 2006 07:51:02 -0800
Thanks, Steven. You're always very helpful!
Mike
"Steven Cheng[MSFT]" wrote:
Hello Mike,.
From your description, you're using WSE 2.0 DimeAttachment to upload some
binary document in webservice. And you're wondering what's the proper value
should be pased to the constructor of DimeAttachment class, correct?
As for the DimeAttachment constructor, it mainly take some paramters to
determine the content type(mime type) and content (binary stream) of the
attachment. e.g.
=============
Dim dimeDocument As DimeAttachment = New DimeAttachment("text/xml",
TypeFormat.MediaType, New MemoryStream(Encoding.UTF8.GetBytes(docXml)))
=============
Therefore, for the first string based "type" parameter, you can just pass
the http mime type according to the document's type you want to upload. For
example, for jpeg image, it is "image/jpeg", for pdf file ,it is
"application/pdf", for rtf file ,it is "application/rtf". Also, if you
really not sure the exact content type of hte binary stream, you can simply
pass "application/octet-stream" for any unknown binary content. For second
TypeFormat enum parameter, you can simply use TypeFormat.MediaType.
BTW, DIME is a legacy binary transfering mechanism in WSE2.0 and in WSE
3.0, it has involved the new MTOM approach which is more recommended. If
possible, we would suggest you consider upgrade to use WSE 3.0 and MTOM.
Please feel free to post here if there is anything unclear.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights
- References:
- RE: Possible value for type parameter in DimeAttach constructor
- From: Steven Cheng[MSFT]
- RE: Possible value for type parameter in DimeAttach constructor
- Prev by Date: I have problem whis Windows Media Services 9 Series.
- Next by Date: Out Of Memory Exception - Large Responses
- Previous by thread: RE: Possible value for type parameter in DimeAttach constructor
- Next by thread: I have problem whis Windows Media Services 9 Series.
- Index(es):
Relevant Pages
|