Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Webservice and proxy

Webservice and proxy

Scheduled Pinned Locked Moved C#
sysadmin
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mogyi
    wrote on last edited by
    #1

    Hello all of you, I made a webservice and I can't get this to run via proxy. the basic procedure on the client side looks like this:

    MyWebservice service = new MyWebservice();

    WebProxy iProxy = new WebProxy(_proxyAdress, true);

    service.Proxy = iProxy;

    ...

    if(service.LogOn(user, pass))
    {

    ...

    data = service.GetMyData();

    now what happens is that the session variables are lost on the GetMyData() call on the server side:

    [WebMethod (EnableSession = true)]
    public bool Logon(string s, string p)
    {
    ...

    Context.Session.Add ("LoggedIn", true);

    ...

    return
    }

    [WebMethod (EnableSession = true)]
    public SomeData GetMyData()
    {

    ...

    if(Context.Session ["LoggedIn"]) //<-- LoggedIn == null

    ...
    }

    Whitout proxy it goes but with proxy dosen't. Please drop some tips if you have some. Thx. ;)

    K L 2 Replies Last reply
    0
    • M Mogyi

      Hello all of you, I made a webservice and I can't get this to run via proxy. the basic procedure on the client side looks like this:

      MyWebservice service = new MyWebservice();

      WebProxy iProxy = new WebProxy(_proxyAdress, true);

      service.Proxy = iProxy;

      ...

      if(service.LogOn(user, pass))
      {

      ...

      data = service.GetMyData();

      now what happens is that the session variables are lost on the GetMyData() call on the server side:

      [WebMethod (EnableSession = true)]
      public bool Logon(string s, string p)
      {
      ...

      Context.Session.Add ("LoggedIn", true);

      ...

      return
      }

      [WebMethod (EnableSession = true)]
      public SomeData GetMyData()
      {

      ...

      if(Context.Session ["LoggedIn"]) //<-- LoggedIn == null

      ...
      }

      Whitout proxy it goes but with proxy dosen't. Please drop some tips if you have some. Thx. ;)

      K Offline
      K Offline
      Keith Barrow
      wrote on last edited by
      #2

      Have you tried regenerating the proxy?

      CCC solved so far: 2 (including a Hard One!)

      M 1 Reply Last reply
      0
      • M Mogyi

        Hello all of you, I made a webservice and I can't get this to run via proxy. the basic procedure on the client side looks like this:

        MyWebservice service = new MyWebservice();

        WebProxy iProxy = new WebProxy(_proxyAdress, true);

        service.Proxy = iProxy;

        ...

        if(service.LogOn(user, pass))
        {

        ...

        data = service.GetMyData();

        now what happens is that the session variables are lost on the GetMyData() call on the server side:

        [WebMethod (EnableSession = true)]
        public bool Logon(string s, string p)
        {
        ...

        Context.Session.Add ("LoggedIn", true);

        ...

        return
        }

        [WebMethod (EnableSession = true)]
        public SomeData GetMyData()
        {

        ...

        if(Context.Session ["LoggedIn"]) //<-- LoggedIn == null

        ...
        }

        Whitout proxy it goes but with proxy dosen't. Please drop some tips if you have some. Thx. ;)

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        I suppose you need to attach CookieContainer to your web service instance using CookieContainer property of SoapHttpClientProtocol class.

        service.CookieContainer=new System.Net.CookieContainer();
        

        Read here more about Session and web methods. :)

        Life is a stage and we are all actors!

        M 1 Reply Last reply
        0
        • K Keith Barrow

          Have you tried regenerating the proxy?

          CCC solved so far: 2 (including a Hard One!)

          M Offline
          M Offline
          Mogyi
          wrote on last edited by
          #4

          Yes I did, thx for the tip

          1 Reply Last reply
          0
          • L Lost User

            I suppose you need to attach CookieContainer to your web service instance using CookieContainer property of SoapHttpClientProtocol class.

            service.CookieContainer=new System.Net.CookieContainer();
            

            Read here more about Session and web methods. :)

            Life is a stage and we are all actors!

            M Offline
            M Offline
            Mogyi
            wrote on last edited by
            #5

            I use cookie container, thx for the response...

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups