Solved

Access a Self-Hosted WCF from JSON / ScriptManager

Posted on 2011-03-22
4
777 Views
Last Modified: 2012-05-11
Given a self-hosted WCF (not IIS), operating at http://myserver:8080/Myservice/
I want to configure the app.config for the above so that ScriptManager can reach it.

Since it's self hosted there doesn't seem to be support for an svc file, so that's evidently not an option.
I'm calling the service from the same domain, but different port ... so it probably looks like a separate domain to script...

Is this possible?

Currently...
if I browse to the service url I get the "you have created a service. To test the service, you will need to creat a client..." message.
If I browser to ...service/?wsdl, I get the service definition file.
If I browse to ...service/HelloWorld (a contract method), I get nothing back...

If I assign the service url to ScriptManager, I get:
http://mysite:8080/serviceurl//jsdebug        400 (Bad Request)

I've also tried jquery $.ajax call with no response back whatsoever... (error response with no exception object and only "error")






0
Comment
Question by:ERobishaw
  • 2
4 Comments
 
LVL 10

Expert Comment

by:khan_webguru
ID: 35192868
Hello Bro!

If the selfhost wcf is running on different machine, or on same machine with different port(not 80), then you may encounter the Cross-Domain issue. cross-domain service call in javascript is not allowed.

There are some workaround for calling crossdomain service by javascript, please have a look

http://www.simple-talk.com/dotnet/asp.net/calling-cross-domain-web-services-in-ajax/

http://developer.yahoo.com/javascript/howto-proxy.html


Hope this will help you.

Regards,

Asif Ahmed Khan
0
 
LVL 10

Accepted Solution

by:
khan_webguru earned 500 total points
ID: 35192884
Hello Bro!

I found another helpful article regarding your problem please see the link below.

http://dotnetbyexample.blogspot.com/2008/02/calling-wcf-service-from-javascript.html

Hope this will help you to fix your problem.

Regards,

Asif Ahmed Khan
0
 
LVL 19

Expert Comment

by:Amandeep Singh Bhullar
ID: 37230467
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now