Solved

Access a Self-Hosted WCF from JSON / ScriptManager

Posted on 2011-03-22
4
781 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
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…

805 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