Http error 404 on transmitting big data

Discussion in 'ASP .Net Web Services' started by hhp, May 23, 2008.

  1. hhp

    hhp Guest

    Hi,

    I have a web service with a method like:

    public string InsertData(string type, byte[] content)
    { ... }

    and a client which calls the method similar to:

    using (BinaryReader reader=new BinaryReader(new FileStream(name,..)))
    {
    byte[] data = reader.ReadBytes((int) reader.BaseStream.Length);
    webSvr.InsertData("file", data);
    }


    It's all ok but the data of content exceeds about 4 MByte of size. Then the
    client gets an 404 http error. It's the same on XP and Vista.

    What could happen here? Thanks in advance for any help.
    Harald Pitro
     
    hhp, May 23, 2008
    #1
    1. Advertising

  2. =?Utf-8?B?aGhw?= <> wrote in
    news::

    > I have a web service with a method like:
    >
    > public string InsertData(string type, byte[] content)
    > { ... }
    >
    > and a client which calls the method similar to:
    >
    > using (BinaryReader reader=new BinaryReader(new FileStream(name,..)))
    > {
    > byte[] data = reader.ReadBytes((int) reader.BaseStream.Length);
    > webSvr.InsertData("file", data);
    > }
    >
    > It's all ok but the data of content exceeds about 4 MByte of size.
    > Then the client gets an 404 http error. It's the same on XP and Vista.


    Check out the maxRequestLength attribute of httpRunTime (Web.config). This
    defaults to 4 MB.


    --
    Arnout.
     
    Arnout Grootveld, May 25, 2008
    #2
    1. Advertising

  3. hhp

    Joy Guest

    Hi,
    You will need to add this Key in your Web.config:

    <maxRequestLength = "YourValue">

    Where YourValue = numeric value signifying the size in KB

    regards,
    Joy

    "Arnout Grootveld" wrote:

    > =?Utf-8?B?aGhw?= <> wrote in
    > news::
    >
    > > I have a web service with a method like:
    > >
    > > public string InsertData(string type, byte[] content)
    > > { ... }
    > >
    > > and a client which calls the method similar to:
    > >
    > > using (BinaryReader reader=new BinaryReader(new FileStream(name,..)))
    > > {
    > > byte[] data = reader.ReadBytes((int) reader.BaseStream.Length);
    > > webSvr.InsertData("file", data);
    > > }
    > >
    > > It's all ok but the data of content exceeds about 4 MByte of size.
    > > Then the client gets an 404 http error. It's the same on XP and Vista.

    >
    > Check out the maxRequestLength attribute of httpRunTime (Web.config). This
    > defaults to 4 MB.
    >
    >
    > --
    > Arnout.
    >
     
    Joy, May 26, 2008
    #3
  4. hhp

    hhp Guest

    Hi Joey, hi Arnout,

    many thanks for your help! I'll give it a try.

    Regards,
    Harald Pitro


    "Joy" wrote:

    > Hi,
    > You will need to add this Key in your Web.config:
    >
    > <maxRequestLength = "YourValue">
    >
    > Where YourValue = numeric value signifying the size in KB
    >
    > regards,
    > Joy
    >
    > "Arnout Grootveld" wrote:
    >
    > > =?Utf-8?B?aGhw?= <> wrote in
    > > news::
    > >
    > > > I have a web service with a method like:
    > > >
    > > > public string InsertData(string type, byte[] content)
    > > > { ... }
    > > >
    > > > and a client which calls the method similar to:
    > > >
    > > > using (BinaryReader reader=new BinaryReader(new FileStream(name,..)))
    > > > {
    > > > byte[] data = reader.ReadBytes((int) reader.BaseStream.Length);
    > > > webSvr.InsertData("file", data);
    > > > }
    > > >
    > > > It's all ok but the data of content exceeds about 4 MByte of size.
    > > > Then the client gets an 404 http error. It's the same on XP and Vista.

    > >
    > > Check out the maxRequestLength attribute of httpRunTime (Web.config). This
    > > defaults to 4 MB.
    > >
    > >
    > > --
    > > Arnout.
    > >
     
    hhp, May 26, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Aleksej
    Replies:
    5
    Views:
    840
    Michal Nazarewicz
    Sep 10, 2006
  2. Shaguf
    Replies:
    0
    Views:
    538
    Shaguf
    Dec 24, 2008
  3. Shaguf
    Replies:
    0
    Views:
    496
    Shaguf
    Dec 26, 2008
  4. Shaguf
    Replies:
    0
    Views:
    269
    Shaguf
    Dec 26, 2008
  5. Shaguf
    Replies:
    0
    Views:
    244
    Shaguf
    Dec 24, 2008
Loading...

Share This Page