Solved

Access a Self-Hosted WCF from JSON / ScriptManager

Posted on 2011-03-22
4
787 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
This article discusses how to implement server side field validation and display customized error messages to the client.
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…

749 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