Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 170185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:45:48+00:00 2026-05-11T12:45:48+00:00

I had a webmethod working which returned a byte array to the caller: public

  • 0

I had a webmethod working which returned a byte array to the caller:

public byte[] DownloadPDF(string URI) 

I had to change this to return another output (a string). So, I decided to change the method completely by now returning void and having 3 parameters like this:

public void DownloadFile(string URI, out byte[] docContents, out string returnFiletype) 

My web service compiles correctly but I suspect something is wrong with the 2nd parameter (i.e. the byte array) because when I ‘Add Web Reference’ and build my proxy class, the method has only 2 parameters, not 3):

[System.Web.Services.Protocols.SoapDocumentMethodAttribute('http://tempuri.org/DownloadFile', RequestNamespace='http://tempuri.org/', ResponseNamespace='http://tempuri.org/', Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]     [return: System.Xml.Serialization.XmlElementAttribute('docContents', DataType='base64Binary')]     public byte[] DownloadFile(string URI, out string returnFiletype) {         object[] results = this.Invoke('DownloadFile', new object[] {                     URI});         returnFiletype = ((string)(results[1]));         return ((byte[])(results[0]));     } 

I don’t see why my 2nd parameter, the byte array, is being ignored, but it appears to be the source of the problem.

This of course messes me up in the web client app where I get an error message at compile time:

No overload for method 'DownloadFile' takes '3' arguments 

Here is the code in the web client where I need to pass 3 arguments:

myBrokerASMXProxy.ASMXProxy.FileService client = new myASMXProxy.ASMXProxy.FileService();          byte[] fileDataBytes;         string fileType;         client.DownloadFile(URI, fileDataBytes, fileType); 

I am thinking of changing it back to return a byte array and add just a single ‘out’ parameter but I thought I should ask you experts about this and in general, what is the best practice for handling multiple output requirements.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T12:45:48+00:00Added an answer on May 11, 2026 at 12:45 pm

    Why don’t your try putting this signature:

    public bool DownloadFile(string URI, out byte[] docContents, out string returnFiletype) 

    To see what happens? I agree with Jon Skeet, but you can still can return a bool with the result of the operation

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 214k
  • Answers 214k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer See: http://www.php.net/manual/en/info.configuration.php#ini.magic-quotes-gpc You can use stripslashes function (http://www.php.net/stripslashes) if you… May 12, 2026 at 10:40 pm
  • Editorial Team
    Editorial Team added an answer I don't see an "xd_receiver.htm" file in the location you… May 12, 2026 at 10:40 pm
  • Editorial Team
    Editorial Team added an answer How is Guy's answer code any different from the question?… May 12, 2026 at 10:40 pm

Related Questions

I just had a laptop crash (spilled water on it). I copied my working
I had a previous question can jquery ajax call external webservice? and some good
I'm now toying around with WebServices, using the .NET framework (.asmx files, not WCF).
I inherited a system that gets data from a webmethod in the form of

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.