473,659 Members | 3,277 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.

Mar 25 '08 #1
4 5929
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
Mar 26 '08 #2
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
Mar 26 '08 #3
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
Mar 27 '08 #4
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
Mar 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1760
by: Jessica | last post by:
I have a .Net 1.0 web service that uses a .Net 1.1 assembly to create users, change users' passwords, validate users, and remove users from an LDAP server. The 1.1 code uses the DirectoryServices namespace. I am administering Active Directory through the Active Directory Users and Computers UI application on box 1 in domain A. Box 1 is not the domain controller in domain A. I can run the Web service from box 3 in another domain. I use...
1
6729
by: Lakshmi | last post by:
Hi All, I am having performance issues with the .NET client calling the Java Webservice running on axis. Have detailed the problem below. Please help. I wrote a webservice in Java. Lets name this WebService1. (using Apache Axis 1.1) Scenario 1: -----------
3
3556
by: Merav Orion via .NET 247 | last post by:
I have a problem calling webservice from client side javascript. The javascript call the settimeout() method. when the user press submit button it ignore the press and keep refreshing the page. it looks like the data is not transferred to the asp page from the web service. just after going to internet option -> security -> Custom level -> Access data sources across domains -> and check the enable radio -> the problem is fixed. I need a...
3
2502
by: Grant Schenck | last post by:
Hello, I have a Windows Service developed in C# .NET. I'm making it a remote server and I can, via an IPC Channel, expose methods and call them from a client. However, I now want my remoted object to be able to invoke a method on my server object and given that the object is built in a C# Class DLL shared between the client and server I'm not sure how to get access to the server object from the remoted object. So, what techniques...
2
2844
by: Johan | last post by:
We have run into problems calling a web service from a client running .NET framework 2.0. The problem is that the first call to the web service, after the client has been started, takes very long time, something like 15 to 30 seconds. All subsequent calls are really fast (about 10 milliseconds). But when the client is restarted, the first call once more takes long time. We have been testing a few different scenarios to figure out what is...
3
6615
dmjpro
by: dmjpro | last post by:
plz send me a good link which can clearify me how the J2EE framework works i want the details information .... plz help thanx
4
2502
by: Nuno | last post by:
Hello, I'm trying to call some web services only using javascript from a html page. I succeeded on doind this in IE with the use of the behavior:url(webservice.htc); (technique founded in the microsft site) but when i'm going to try this in a diferente browser (firefox for example) the behavior command is not accepted in this browser. So i try to find why and i don't understand, but i found a way of calling web services using the mozila...
0
957
by: =?Utf-8?B?V2ViemVzdA==?= | last post by:
Greetings: I am attempting to generate a Microsoft Office Communicator 2005 client installer that needs to interface with a Web service that resides on the LCS Server. Specifically, the Web Service has the following two methods: GetLCSState ( Domain As string , SamaccountName As string ) As LCSState LCSEnableAccount ( Domain As string , SamaccountName As string , EmailAddress As string , Operator As string , Tool As string ) As...
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8628
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2754
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1978
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.