Click here to Skip to main content
15,884,099 members
Home / Discussions / C#
   

C#

 
QuestionMVC Config File / MAPPING Pin
dataminers3-May-12 11:25
dataminers3-May-12 11:25 
GeneralUnderstanding various types of WCF bindings Pin
Vasudev Choudhary3-May-12 20:03
Vasudev Choudhary3-May-12 20:03 
AnswerRe: MVC Config File / MAPPING Pin
Richard MacCutchan3-May-12 23:36
mveRichard MacCutchan3-May-12 23:36 
Questioncritical rigion Pin
ammar24423-May-12 6:04
ammar24423-May-12 6:04 
AnswerRe: critical rigion Pin
Wes Aday3-May-12 6:13
professionalWes Aday3-May-12 6:13 
AnswerRe: critical rigion Pin
Bernhard Hiller3-May-12 21:23
Bernhard Hiller3-May-12 21:23 
AnswerRe: critical rigion Pin
Abhinav S3-May-12 22:00
Abhinav S3-May-12 22:00 
QuestionStreaming the response of type byte[] Pin
NarVish2-May-12 22:51
NarVish2-May-12 22:51 
I'm trying to write a client for a webservice method, which responds with byte[]
I would like to stream it because byte[] will be failed if there is large file. I changed Transfer Mode and Encoding to Streamed and Mtom respectively. I commented XMLTypeAttribute declaration in reference file for the byte[] class. Please correct the code.
Reference.cs
C#
/// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.4016")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    //[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http//tempuri.org/sample/types")]
    public partial class echoBinaryDataResponse : object, System.ComponentModel.INotifyPropertyChanged {
        
        private byte[] paramField;
        
        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(DataType = "base64Binary", Order = 0)]
        public byte[] param
        {
            get {
                return this.paramField;
            }
            set {
                this.paramField = value;
                this.RaisePropertyChanged("param");
            }
        }


My client call
-----------
C#
ServiceReference1.echoBinaryData echo = new ServiceReference1.echoBinaryData();
MemoryStream str = new MemoryStream(myByteArray);
echo.param = str; 
ServiceReference1.echoBinaryDataResponse echoResp = new ServiceReference1.echoBinaryDataResponse();
ServiceReference1.SamplePortTypeClient sample = new ServiceReference1.SamplePortTypeClient();
sample.echoBinaryData(echo);-----getting exception here

Note: myByteArray is of type byte[];
QuestionRe: Streaming the response of type byte[] Pin
Richard MacCutchan2-May-12 22:53
mveRichard MacCutchan2-May-12 22:53 
AnswerRe: Streaming the response of type byte[] Pin
NarVish2-May-12 23:31
NarVish2-May-12 23:31 
GeneralRe: Streaming the response of type byte[] Pin
Richard MacCutchan3-May-12 0:10
mveRichard MacCutchan3-May-12 0:10 
GeneralRe: Streaming the response of type byte[] Pin
NarVish3-May-12 0:42
NarVish3-May-12 0:42 
GeneralRe: Streaming the response of type byte[] Pin
Richard MacCutchan3-May-12 0:54
mveRichard MacCutchan3-May-12 0:54 
GeneralRe: Streaming the response of type byte[] Pin
NarVish3-May-12 2:03
NarVish3-May-12 2:03 
QuestionEnter-PSSession : Connecting to remote server failed Pin
Sebastian T Xavier2-May-12 20:30
Sebastian T Xavier2-May-12 20:30 
AnswerRe: Enter-PSSession : Connecting to remote server failed Pin
Richard MacCutchan2-May-12 22:52
mveRichard MacCutchan2-May-12 22:52 
QuestionHow to get video stream from usb cam buffer Pin
bunyamin_2-May-12 4:45
bunyamin_2-May-12 4:45 
Questioncan't found provider sqlserver Pin
MemberDotNetting2-May-12 1:39
MemberDotNetting2-May-12 1:39 
AnswerRe: can't found provider sqlserver Pin
Wes Aday2-May-12 1:45
professionalWes Aday2-May-12 1:45 
GeneralRe: can't found provider sqlserver Pin
MemberDotNetting2-May-12 2:06
MemberDotNetting2-May-12 2:06 
AnswerRe: can't found provider sqlserver Pin
egenis2-May-12 2:03
egenis2-May-12 2:03 
Questionc# windows form & google api v3 Pin
mrx1002-May-12 0:39
mrx1002-May-12 0:39 
AnswerRe: c# windows form & google api v3 Pin
Richard MacCutchan2-May-12 2:42
mveRichard MacCutchan2-May-12 2:42 
GeneralRe: c# windows form & google api v3 Pin
mrx1002-May-12 4:38
mrx1002-May-12 4:38 
GeneralRe: c# windows form & google api v3 Pin
mrx1002-May-12 4:49
mrx1002-May-12 4:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.