URL Posting Fails in Medium Trust (3rd time posting this w/ zero replies so far)

Discussion in 'ASP .Net' started by AmitKu, Jan 5, 2007.

  1. AmitKu

    AmitKu Guest

    I am trying to do a URL post using HttpWebRequest, but it fails because
    I am hosting on Network Solutions, and their servers are all medium
    trust. Apparently HttpWebRequest doesn't work on medium trust.

    Is there any way to do URL posting in a medium trust environment? I'm
    hoping I don't need to switch hosts because of this.

    Btw I've posted this a 3rd time now because I've yet to receive any
    replies whatsoever. I've called around looking for new hosts, and both
    companies I've spoken with run in medium trust as well. So is URL
    posting not ever going to allowed again? Is there something simple here
    that I'm missing? Please help.

    Thanks in advance,
    Amit
    AmitKu, Jan 5, 2007
    #1
    1. Advertising

  2. If your ISP wont up the setting from medium - whicc is unlikely you may be
    better off trying to make a request using socket calls over http.

    Theres a really good article here that explains your problem.
    http://www.wrox.com/WileyCDA/Section/id-291738.html
    --
    --
    Regards

    John Timney (MVP)
    VISIT MY WEBSITE:
    http://www.johntimney.com
    http://www.johntimney.com/blog


    "AmitKu" <> wrote in message
    news:...
    >I am trying to do a URL post using HttpWebRequest, but it fails because
    > I am hosting on Network Solutions, and their servers are all medium
    > trust. Apparently HttpWebRequest doesn't work on medium trust.
    >
    > Is there any way to do URL posting in a medium trust environment? I'm
    > hoping I don't need to switch hosts because of this.
    >
    > Btw I've posted this a 3rd time now because I've yet to receive any
    > replies whatsoever. I've called around looking for new hosts, and both
    > companies I've spoken with run in medium trust as well. So is URL
    > posting not ever going to allowed again? Is there something simple here
    > that I'm missing? Please help.
    >
    > Thanks in advance,
    > Amit
    >
    John Timney \(MVP\), Jan 5, 2007
    #2
    1. Advertising

  3. AmitKu

    AmitKu Guest

    I've read the article already, and if I'm not mistaken, you need to use
    the <trust> tag in your web.config file.

    I've tried this, but unfortunately they've made it so that no overrides
    can be done. So having the <trust> tag at all causes an error.

    Any ideas now?

    Thanks,
    Amit


    John Timney (MVP) wrote:
    > If your ISP wont up the setting from medium - whicc is unlikely you may be
    > better off trying to make a request using socket calls over http.
    >
    > Theres a really good article here that explains your problem.
    > http://www.wrox.com/WileyCDA/Section/id-291738.html
    > --
    > --
    > Regards
    >
    > John Timney (MVP)
    > VISIT MY WEBSITE:
    > http://www.johntimney.com
    > http://www.johntimney.com/blog
    >
    >
    > "AmitKu" <> wrote in message
    > news:...
    > >I am trying to do a URL post using HttpWebRequest, but it fails because
    > > I am hosting on Network Solutions, and their servers are all medium
    > > trust. Apparently HttpWebRequest doesn't work on medium trust.
    > >
    > > Is there any way to do URL posting in a medium trust environment? I'm
    > > hoping I don't need to switch hosts because of this.
    > >
    > > Btw I've posted this a 3rd time now because I've yet to receive any
    > > replies whatsoever. I've called around looking for new hosts, and both
    > > companies I've spoken with run in medium trust as well. So is URL
    > > posting not ever going to allowed again? Is there something simple here
    > > that I'm missing? Please help.
    > >
    > > Thanks in advance,
    > > Amit
    > >
    AmitKu, Jan 5, 2007
    #3
  4. I would try making a raw socket call over http and see if that works. If it
    does, you can still extract your remote pages using standard get requests.
    Some good code about to get you started on something to test it easily.

    http://www.devarticles.com/c/a/C-Sharp/Socket-Programming-in-C-Part-I/

    --
    Regards

    John Timney (MVP)
    VISIT MY WEBSITE:
    http://www.johntimney.com
    http://www.johntimney.com/blog


    "AmitKu" <> wrote in message
    news:...
    > I've read the article already, and if I'm not mistaken, you need to use
    > the <trust> tag in your web.config file.
    >
    > I've tried this, but unfortunately they've made it so that no overrides
    > can be done. So having the <trust> tag at all causes an error.
    >
    > Any ideas now?
    >
    > Thanks,
    > Amit
    >
    >
    > John Timney (MVP) wrote:
    >> If your ISP wont up the setting from medium - whicc is unlikely you may
    >> be
    >> better off trying to make a request using socket calls over http.
    >>
    >> Theres a really good article here that explains your problem.
    >> http://www.wrox.com/WileyCDA/Section/id-291738.html
    >> --
    >> --
    >> Regards
    >>
    >> John Timney (MVP)
    >> VISIT MY WEBSITE:
    >> http://www.johntimney.com
    >> http://www.johntimney.com/blog
    >>
    >>
    >> "AmitKu" <> wrote in message
    >> news:...
    >> >I am trying to do a URL post using HttpWebRequest, but it fails because
    >> > I am hosting on Network Solutions, and their servers are all medium
    >> > trust. Apparently HttpWebRequest doesn't work on medium trust.
    >> >
    >> > Is there any way to do URL posting in a medium trust environment? I'm
    >> > hoping I don't need to switch hosts because of this.
    >> >
    >> > Btw I've posted this a 3rd time now because I've yet to receive any
    >> > replies whatsoever. I've called around looking for new hosts, and both
    >> > companies I've spoken with run in medium trust as well. So is URL
    >> > posting not ever going to allowed again? Is there something simple here
    >> > that I'm missing? Please help.
    >> >
    >> > Thanks in advance,
    >> > Amit
    >> >

    >
    John Timney \(MVP\), Jan 5, 2007
    #4
  5. AmitKu

    AmitKu Guest

    Actually socket calls do not work in medium trust either.....

    So is url posting just a thing of the past now since it's basically
    outlawed on shared environments, which is what most people use?

    --Amit


    John Timney (MVP) wrote:
    > I would try making a raw socket call over http and see if that works. If it
    > does, you can still extract your remote pages using standard get requests.
    > Some good code about to get you started on something to test it easily.
    >
    > http://www.devarticles.com/c/a/C-Sharp/Socket-Programming-in-C-Part-I/
    >
    > --
    > Regards
    >
    > John Timney (MVP)
    > VISIT MY WEBSITE:
    > http://www.johntimney.com
    > http://www.johntimney.com/blog
    >
    >
    > "AmitKu" <> wrote in message
    > news:...
    > > I've read the article already, and if I'm not mistaken, you need to use
    > > the <trust> tag in your web.config file.
    > >
    > > I've tried this, but unfortunately they've made it so that no overrides
    > > can be done. So having the <trust> tag at all causes an error.
    > >
    > > Any ideas now?
    > >
    > > Thanks,
    > > Amit
    > >
    > >
    > > John Timney (MVP) wrote:
    > >> If your ISP wont up the setting from medium - whicc is unlikely you may
    > >> be
    > >> better off trying to make a request using socket calls over http.
    > >>
    > >> Theres a really good article here that explains your problem.
    > >> http://www.wrox.com/WileyCDA/Section/id-291738.html
    > >> --
    > >> --
    > >> Regards
    > >>
    > >> John Timney (MVP)
    > >> VISIT MY WEBSITE:
    > >> http://www.johntimney.com
    > >> http://www.johntimney.com/blog
    > >>
    > >>
    > >> "AmitKu" <> wrote in message
    > >> news:...
    > >> >I am trying to do a URL post using HttpWebRequest, but it fails because
    > >> > I am hosting on Network Solutions, and their servers are all medium
    > >> > trust. Apparently HttpWebRequest doesn't work on medium trust.
    > >> >
    > >> > Is there any way to do URL posting in a medium trust environment? I'm
    > >> > hoping I don't need to switch hosts because of this.
    > >> >
    > >> > Btw I've posted this a 3rd time now because I've yet to receive any
    > >> > replies whatsoever. I've called around looking for new hosts, and both
    > >> > companies I've spoken with run in medium trust as well. So is URL
    > >> > posting not ever going to allowed again? Is there something simple here
    > >> > that I'm missing? Please help.
    > >> >
    > >> > Thanks in advance,
    > >> > Amit
    > >> >

    > >
    AmitKu, Jan 6, 2007
    #5
  6. I thought that would be the case. I expect you may have already tried, but
    if not have a crack at overriding the machine.config setting in your own web
    config for your application?

    <system.web>
    <trust level="High" originUrl="" />

    If that doesn't work (its not likely too) then I can only suggest you take
    it up with your ISP, as there should be no reason why they cannot set a
    custom Medium Trust configuration to allow you to use use IO operations.
    Its common practice on shared hosting. Your ISP should be able to add an
    IPermission class entry to the web_mediumtrust.config file on the web server
    to override for your application. If they dont know how to do this, they
    are clearly idiots and you might be better off taking your business
    elsewhere.

    --
    Regards

    John Timney (MVP)
    VISIT MY WEBSITE:
    http://www.johntimney.com
    http://www.johntimney.com/blog


    "AmitKu" <> wrote in message
    news:...
    > Actually socket calls do not work in medium trust either.....
    >
    > So is url posting just a thing of the past now since it's basically
    > outlawed on shared environments, which is what most people use?
    >
    > --Amit
    >
    >
    > John Timney (MVP) wrote:
    >> I would try making a raw socket call over http and see if that works. If
    >> it
    >> does, you can still extract your remote pages using standard get
    >> requests.
    >> Some good code about to get you started on something to test it easily.
    >>
    >> http://www.devarticles.com/c/a/C-Sharp/Socket-Programming-in-C-Part-I/
    >>
    >> --
    >> Regards
    >>
    >> John Timney (MVP)
    >> VISIT MY WEBSITE:
    >> http://www.johntimney.com
    >> http://www.johntimney.com/blog
    >>
    >>
    >> "AmitKu" <> wrote in message
    >> news:...
    >> > I've read the article already, and if I'm not mistaken, you need to use
    >> > the <trust> tag in your web.config file.
    >> >
    >> > I've tried this, but unfortunately they've made it so that no overrides
    >> > can be done. So having the <trust> tag at all causes an error.
    >> >
    >> > Any ideas now?
    >> >
    >> > Thanks,
    >> > Amit
    >> >
    >> >
    >> > John Timney (MVP) wrote:
    >> >> If your ISP wont up the setting from medium - whicc is unlikely you
    >> >> may
    >> >> be
    >> >> better off trying to make a request using socket calls over http.
    >> >>
    >> >> Theres a really good article here that explains your problem.
    >> >> http://www.wrox.com/WileyCDA/Section/id-291738.html
    >> >> --
    >> >> --
    >> >> Regards
    >> >>
    >> >> John Timney (MVP)
    >> >> VISIT MY WEBSITE:
    >> >> http://www.johntimney.com
    >> >> http://www.johntimney.com/blog
    >> >>
    >> >>
    >> >> "AmitKu" <> wrote in message
    >> >> news:...
    >> >> >I am trying to do a URL post using HttpWebRequest, but it fails
    >> >> >because
    >> >> > I am hosting on Network Solutions, and their servers are all medium
    >> >> > trust. Apparently HttpWebRequest doesn't work on medium trust.
    >> >> >
    >> >> > Is there any way to do URL posting in a medium trust environment?
    >> >> > I'm
    >> >> > hoping I don't need to switch hosts because of this.
    >> >> >
    >> >> > Btw I've posted this a 3rd time now because I've yet to receive any
    >> >> > replies whatsoever. I've called around looking for new hosts, and
    >> >> > both
    >> >> > companies I've spoken with run in medium trust as well. So is URL
    >> >> > posting not ever going to allowed again? Is there something simple
    >> >> > here
    >> >> > that I'm missing? Please help.
    >> >> >
    >> >> > Thanks in advance,
    >> >> > Amit
    >> >> >
    >> >

    >
    John Timney \(MVP\), Jan 6, 2007
    #6
  7. AmitKu

    AmitKu Guest

    As I wrote earlier, I've tried that and they won't let me override the
    machine.config file...

    And I'm afraid they might be idiots as you're saying. Unfortunately,
    it seems every host I've contacted is in medium trust. Does that mean
    that half of asp.net is not going to work ever again until I get rich
    and can buy my own server and set it up the way I want?

    Do you know of any nice asp.net 2.0 host that allows you to do what you
    want to do, or at least let you make some small overrides on their
    machine.config file?

    --Amit

    John Timney (MVP) wrote:
    > I thought that would be the case. I expect you may have already tried, but
    > if not have a crack at overriding the machine.config setting in your own web
    > config for your application?
    >
    > <system.web>
    > <trust level="High" originUrl="" />
    >
    > If that doesn't work (its not likely too) then I can only suggest you take
    > it up with your ISP, as there should be no reason why they cannot set a
    > custom Medium Trust configuration to allow you to use use IO operations.
    > Its common practice on shared hosting. Your ISP should be able to add an
    > IPermission class entry to the web_mediumtrust.config file on the web server
    > to override for your application. If they dont know how to do this, they
    > are clearly idiots and you might be better off taking your business
    > elsewhere.
    >
    > --
    > Regards
    >
    > John Timney (MVP)
    > VISIT MY WEBSITE:
    > http://www.johntimney.com
    > http://www.johntimney.com/blog
    >
    >
    > "AmitKu" <> wrote in message
    > news:...
    > > Actually socket calls do not work in medium trust either.....
    > >
    > > So is url posting just a thing of the past now since it's basically
    > > outlawed on shared environments, which is what most people use?
    > >
    > > --Amit
    > >
    > >
    > > John Timney (MVP) wrote:
    > >> I would try making a raw socket call over http and see if that works. If
    > >> it
    > >> does, you can still extract your remote pages using standard get
    > >> requests.
    > >> Some good code about to get you started on something to test it easily.
    > >>
    > >> http://www.devarticles.com/c/a/C-Sharp/Socket-Programming-in-C-Part-I/
    > >>
    > >> --
    > >> Regards
    > >>
    > >> John Timney (MVP)
    > >> VISIT MY WEBSITE:
    > >> http://www.johntimney.com
    > >> http://www.johntimney.com/blog
    > >>
    > >>
    > >> "AmitKu" <> wrote in message
    > >> news:...
    > >> > I've read the article already, and if I'm not mistaken, you need to use
    > >> > the <trust> tag in your web.config file.
    > >> >
    > >> > I've tried this, but unfortunately they've made it so that no overrides
    > >> > can be done. So having the <trust> tag at all causes an error.
    > >> >
    > >> > Any ideas now?
    > >> >
    > >> > Thanks,
    > >> > Amit
    > >> >
    > >> >
    > >> > John Timney (MVP) wrote:
    > >> >> If your ISP wont up the setting from medium - whicc is unlikely you
    > >> >> may
    > >> >> be
    > >> >> better off trying to make a request using socket calls over http.
    > >> >>
    > >> >> Theres a really good article here that explains your problem.
    > >> >> http://www.wrox.com/WileyCDA/Section/id-291738.html
    > >> >> --
    > >> >> --
    > >> >> Regards
    > >> >>
    > >> >> John Timney (MVP)
    > >> >> VISIT MY WEBSITE:
    > >> >> http://www.johntimney.com
    > >> >> http://www.johntimney.com/blog
    > >> >>
    > >> >>
    > >> >> "AmitKu" <> wrote in message
    > >> >> news:...
    > >> >> >I am trying to do a URL post using HttpWebRequest, but it fails
    > >> >> >because
    > >> >> > I am hosting on Network Solutions, and their servers are all medium
    > >> >> > trust. Apparently HttpWebRequest doesn't work on medium trust.
    > >> >> >
    > >> >> > Is there any way to do URL posting in a medium trust environment?
    > >> >> > I'm
    > >> >> > hoping I don't need to switch hosts because of this.
    > >> >> >
    > >> >> > Btw I've posted this a 3rd time now because I've yet to receive any
    > >> >> > replies whatsoever. I've called around looking for new hosts, and
    > >> >> > both
    > >> >> > companies I've spoken with run in medium trust as well. So is URL
    > >> >> > posting not ever going to allowed again? Is there something simple
    > >> >> > here
    > >> >> > that I'm missing? Please help.
    > >> >> >
    > >> >> > Thanks in advance,
    > >> >> > Amit
    > >> >> >
    > >> >

    > >
    AmitKu, Jan 8, 2007
    #7
  8. If they are hosting asp 2.0 then medium trust is the default. What you need
    to ask is if they will provide custom medium trusts.

    I cant really recommend any hosters as I host my servers myself.

    --
    Regards

    John Timney (MVP)
    VISIT MY WEBSITE:
    http://www.johntimney.com
    http://www.johntimney.com/blog


    "AmitKu" <> wrote in message
    news:...
    > As I wrote earlier, I've tried that and they won't let me override the
    > machine.config file...
    >
    > And I'm afraid they might be idiots as you're saying. Unfortunately,
    > it seems every host I've contacted is in medium trust. Does that mean
    > that half of asp.net is not going to work ever again until I get rich
    > and can buy my own server and set it up the way I want?
    >
    > Do you know of any nice asp.net 2.0 host that allows you to do what you
    > want to do, or at least let you make some small overrides on their
    > machine.config file?
    >
    > --Amit
    >
    > John Timney (MVP) wrote:
    >> I thought that would be the case. I expect you may have already tried,
    >> but
    >> if not have a crack at overriding the machine.config setting in your own
    >> web
    >> config for your application?
    >>
    >> <system.web>
    >> <trust level="High" originUrl="" />
    >>
    >> If that doesn't work (its not likely too) then I can only suggest you
    >> take
    >> it up with your ISP, as there should be no reason why they cannot set a
    >> custom Medium Trust configuration to allow you to use use IO operations.
    >> Its common practice on shared hosting. Your ISP should be able to add an
    >> IPermission class entry to the web_mediumtrust.config file on the web
    >> server
    >> to override for your application. If they dont know how to do this, they
    >> are clearly idiots and you might be better off taking your business
    >> elsewhere.
    >>
    >> --
    >> Regards
    >>
    >> John Timney (MVP)
    >> VISIT MY WEBSITE:
    >> http://www.johntimney.com
    >> http://www.johntimney.com/blog
    >>
    >>
    >> "AmitKu" <> wrote in message
    >> news:...
    >> > Actually socket calls do not work in medium trust either.....
    >> >
    >> > So is url posting just a thing of the past now since it's basically
    >> > outlawed on shared environments, which is what most people use?
    >> >
    >> > --Amit
    >> >
    >> >
    >> > John Timney (MVP) wrote:
    >> >> I would try making a raw socket call over http and see if that works.
    >> >> If
    >> >> it
    >> >> does, you can still extract your remote pages using standard get
    >> >> requests.
    >> >> Some good code about to get you started on something to test it
    >> >> easily.
    >> >>
    >> >> http://www.devarticles.com/c/a/C-Sharp/Socket-Programming-in-C-Part-I/
    >> >>
    >> >> --
    >> >> Regards
    >> >>
    >> >> John Timney (MVP)
    >> >> VISIT MY WEBSITE:
    >> >> http://www.johntimney.com
    >> >> http://www.johntimney.com/blog
    >> >>
    >> >>
    >> >> "AmitKu" <> wrote in message
    >> >> news:...
    >> >> > I've read the article already, and if I'm not mistaken, you need to
    >> >> > use
    >> >> > the <trust> tag in your web.config file.
    >> >> >
    >> >> > I've tried this, but unfortunately they've made it so that no
    >> >> > overrides
    >> >> > can be done. So having the <trust> tag at all causes an error.
    >> >> >
    >> >> > Any ideas now?
    >> >> >
    >> >> > Thanks,
    >> >> > Amit
    >> >> >
    >> >> >
    >> >> > John Timney (MVP) wrote:
    >> >> >> If your ISP wont up the setting from medium - whicc is unlikely you
    >> >> >> may
    >> >> >> be
    >> >> >> better off trying to make a request using socket calls over http.
    >> >> >>
    >> >> >> Theres a really good article here that explains your problem.
    >> >> >> http://www.wrox.com/WileyCDA/Section/id-291738.html
    >> >> >> --
    >> >> >> --
    >> >> >> Regards
    >> >> >>
    >> >> >> John Timney (MVP)
    >> >> >> VISIT MY WEBSITE:
    >> >> >> http://www.johntimney.com
    >> >> >> http://www.johntimney.com/blog
    >> >> >>
    >> >> >>
    >> >> >> "AmitKu" <> wrote in message
    >> >> >> news:...
    >> >> >> >I am trying to do a URL post using HttpWebRequest, but it fails
    >> >> >> >because
    >> >> >> > I am hosting on Network Solutions, and their servers are all
    >> >> >> > medium
    >> >> >> > trust. Apparently HttpWebRequest doesn't work on medium trust.
    >> >> >> >
    >> >> >> > Is there any way to do URL posting in a medium trust environment?
    >> >> >> > I'm
    >> >> >> > hoping I don't need to switch hosts because of this.
    >> >> >> >
    >> >> >> > Btw I've posted this a 3rd time now because I've yet to receive
    >> >> >> > any
    >> >> >> > replies whatsoever. I've called around looking for new hosts, and
    >> >> >> > both
    >> >> >> > companies I've spoken with run in medium trust as well. So is
    >> >> >> > URL
    >> >> >> > posting not ever going to allowed again? Is there something
    >> >> >> > simple
    >> >> >> > here
    >> >> >> > that I'm missing? Please help.
    >> >> >> >
    >> >> >> > Thanks in advance,
    >> >> >> > Amit
    >> >> >> >
    >> >> >
    >> >

    >
    John Timney \(MVP\), Jan 8, 2007
    #8
    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. Paul Hatcher

    Medium Level Trust and Reflection

    Paul Hatcher, Feb 25, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    472
    Paul Hatcher
    Feb 25, 2005
  2. Michael Howes
    Replies:
    0
    Views:
    480
    Michael Howes
    Jan 26, 2006
  3. AmitKu

    Url Posting Fails / Medium Trust

    AmitKu, Jan 3, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    355
    AmitKu
    Jan 3, 2007
  4. AmitKu

    URL posting fails in medium trust

    AmitKu, Jan 3, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    291
    AmitKu
    Jan 3, 2007
  5. Linda
    Replies:
    1
    Views:
    534
    Dominick Baier
    Aug 31, 2006
Loading...

Share This Page