calling WCF service methods from JavaScript in another domain?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jake

    calling WCF service methods from JavaScript in another domain?

    Can someone please give me an example on how to call a wcf method that
    resides on a different domain from JavaScript (not from C#/asp.net)?
    All the examples that I have seen show how to call from the same
    domain.
    I don't care what the binding is. I'll use what works.
    I need concrete examples or links to concrete example please. Not
    just links to articles describing how to do it.
    Your help is greatly appreciated.

  • Duy Lam

    #2
    Re: calling WCF service methods from JavaScript in another domain?

    jake wrote:
    Can someone please give me an example on how to call a wcf method that
    resides on a different domain from JavaScript (not from C#/asp.net)?
    All the examples that I have seen show how to call from the same
    domain.
    I don't care what the binding is. I'll use what works.
    I need concrete examples or links to concrete example please. Not
    just links to articles describing how to do it.
    Your help is greatly appreciated.
    >
    We can use JavaScript to call a executable file but the security setting
    of IE must be set to lowest level; and then that file can call wcf
    method in turn
    If you want only JavaScript can do the calling, I think you must be the
    first one having that idea.


    --
    Thanks,
    Duy Lam Phuong

    Comment

    • jake

      #3
      Re: calling WCF service methods from JavaScript in another domain?

      On Mar 26, 10:57 am, Duy Lam <duylamphu...@g mail.comwrote:
      jake wrote:
      Can someone please give me an example on how to call awcfmethod that
      resides on a different domain from JavaScript (not from C#/asp.net)?
      All the examples that I have seen show how to call from the same
      domain.
      I don't care what the binding is. I'll use what works.
      I need concrete examples or links to concrete example please. Not
      just links to articles describing how to do it.
      Your help is greatly appreciated.
      >
      We can use JavaScript to call a executable file but the security setting
      of IE must be set to lowest level; and then that file can callwcf
      method in turn
      If you want only JavaScript can do the calling, I think you must be the
      first one having that idea.
      >
      --
      Thanks,
      Duy Lam Phuong
      JavaScript can call methods in regular web services. Why can't it
      call WCF methods as well?
      I highly doubt that I am the first one to think of this.
      Did everyone who used google (which has javascript calls to web
      services through the XMLHttpRequest) have to have IE or any other
      browser's security set to the lowest level?
      The structure of the website that I am building is such that some
      calls are to be made from the server (asp.net) side and some from the
      client side, to save bandwidth and such, and to be efficient.
      But please elaborate as to why this is such a strange thing to do (why
      would I be the first one to inquire about this).
      I am not being sarcastic; I really need to know if there is a better
      way to do what I am doing now.
      All help is greatly appreciated.
      Thanks
      jake

      Comment

      • Duy Lam

        #4
        Re: calling WCF service methods from JavaScript in another domain?

        jake wrote:
        JavaScript can call methods in regular web services. Why can't it
        call WCF methods as well?
        I highly doubt that I am the first one to think of this.
        Did everyone who used google (which has javascript calls to web
        services through the XMLHttpRequest) have to have IE or any other
        browser's security set to the lowest level?
        When saying set the IE security to lowest levelt, I meant to use ActiveX
        object (call an executable file).
        You use XMLHttpRequest to a call to server, and then what thing happen
        next? Does JavaScript *communicate* with WCF or wait for response from
        server? If you do that, it seems there is a misunderstand about your
        question.
        Anyway, trying to argue about this could go nowhere. You said you used
        JavaScript to trigger a calling to web server (by ajax), and it does not
        mean "JavaScript call a WCF method".
        The structure of the website that I am building is such that some
        calls are to be made from the server (asp.net) side and some from the
        client side, to save bandwidth and such, and to be efficient.
        But please elaborate as to why this is such a strange thing to do (why
        would I be the first one to inquire about this).
        I am not being sarcastic; I really need to know if there is a better
        way to do what I am doing now.
        All help is greatly appreciated.
        Thanks
        jake
        It seems you're angry about my reply. I'm sorry.


        --
        Thanks,
        Duy Lam Phuong

        Comment

        • jake

          #5
          Re: calling WCF service methods from JavaScript in another domain?

          On Mar 27, 9:18 am, Duy Lam <duylamphu...@g mail.comwrote:
          jakewrote:
          >
          JavaScript can call methods in regular web services. Why can't it
          >
          callWCFmethods as well?
          I highly doubt that I am the first one to think of this.
          Did everyone who used google (which has javascript calls to web
          services through the XMLHttpRequest) have to have IE or any other
          browser's security set to the lowest level?
          >
          When saying set the IE security to lowest levelt, I meant to use ActiveX
          object (call an executable file).
          You use XMLHttpRequest to a call to server, and then what thing happen
          next? Does JavaScript *communicate* withWCFor wait for response from
          server? If you do that, it seems there is a misunderstand about your
          question.
          Anyway, trying to argue about this could go nowhere. You said you used
          JavaScript to trigger a calling to web server (by ajax), and it does not
          mean "JavaScript call aWCFmethod".
          >
          The structure of the website that I am building is such that some
          calls are to be made from the server (asp.net) side and some from the
          client side, to save bandwidth and such, and to be efficient.
          But please elaborate as to why this is such a strange thing to do (why
          would I be the first one to inquire about this).
          I am not being sarcastic; I really need to know if there is a better
          way to do what I am doing now.
          All help is greatly appreciated.
          Thanks
          jake
          >
          It seems you're angry about my reply. I'm sorry.
          >
          --
          Thanks,
          Duy Lam Phuong
          No, no; I am not angry at all. Not even in the least bit. No need to
          be sorry. I am just anxious for some help. In fact, I am the one who
          should be sorry for asking and replying as ambiguously as I did.

          Let me try again:
          I need to make AJAX work with WCF from the client's JavaScript, to
          update only part of the web page instead of a full reload.
          I know AJAX (XmlHttpRequest ) works from the client's JavaScript to
          retrieve info from regular web services and update part of the web
          page.
          I need to do the same thing, but with a WCF service instead of a
          regular web service.
          In other words:
          instead of,
          client ---(through Get or Post request)---asp.net/C#/IIS ---(through
          XmlHttpRequest)---WCF service ---asp.net/C#/IIS ---client
          I would like
          client ----(through XmlHttpRequest)---WCF service ---client
          Is this possible?

          If this is still somewhat vague, let me know and I will clarify it
          some more.
          Thanks
          jake

          Comment

          Working...