Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3438428
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:11:12+00:00 2026-05-18T08:11:12+00:00

UPDATE 3 var local = ‘http://localhost:1163/CustomerService.svc/getcustomer?method=?’; var dev = ‘http://yourserver.com/CustomerService.svc/GetCustomer?method=?’; $.getJSON(dev, function (customer) {

  • 0

UPDATE 3

var local = 'http://localhost:1163/CustomerService.svc/getcustomer?method=?';
            var dev = 'http://yourserver.com/CustomerService.svc/GetCustomer?method=?';
            $.getJSON(dev, function (customer) {    
                alert(customer.Address);
                alert(customer.Name);
            });

if i run http://yourserver.com/CustomerService.svc/getcustomer?method=foo' on the remote domain i get access denied error AND if i run http://yourserver.com/CustomerService.svc/getcustomer?method=?' i get this error(see below) and i have exactly what you have in your sample page. it seems that “method=foo” “get access denied” and “method=?” throw this error: URI:

"http://yourserver.com/CustomerService.svc.svc/GetCustomer?method=jsonp1290197214042"

UPDATE3

UPDATE2

i have tested with two different scenario:

1) works fine with localhost

 $.getJSON('http://localhost:1163/service.svc/getcustomer?method=?', function (customer) {
                alert(customer.Address);
                alert(customer.Name); 
            });

2) does not work with cross domain

 $.getJSON('http://yourserver.com/CustomerService.svc/getcustomer?method=?', function (customer) {

                alert(customer.Address);
                alert(customer.Name); 
            });

i get this error:

Message: Expected ‘;’
Line: 1
Char: 11
Code: 0

URI: http://yourserver.com/CustomerService.svc/GetCustomer?method=jsonp1290183992345

UPDATE2

UPDATE1

when i run the service in the browser
http://yourserver.com/CustomerService.svc/getcustomer
i get the the popup window asking for me to fine or save the file, so i save the file to browser and i open it in the notepad and i see that the data so its returning me the jsonp.

{"Address":"1 Example Way","Name":"Bob"}

where exactly you want me to put return false in the button?

on the debugger i put just for steping in the code.

UPDATE1

UPDATE:
below is how i am calling to my cross domain service.

 $(document).ready(function () {
        $("#driver").click(function (event) {

            $.getJSON('http://yourserver.com/CustomerService.svc/getcustomer?method=?', function (customer) {
            debugger
                alert(customer.Address);
                alert(customer.Name); 
            });
        });
    });

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2; MS-RTC LM 8; .NET4.0C; .NET4.0E)
Timestamp: Fri, 19 Nov 2010 14:56:22 UTC

Message: Expected ';'
Line: 1
Char: 11
Code: 0
URI: 'http://yourserver.com/CustomerService.svc/GetCustomer?method=JsonPCallBack

i get the above error:

Update end

I’ve been learning and building JSONP Web services using WCF on fx3.5. I finally got a sample togather with the help of this article and MSDN article JSON with Padding (AJAX)

i am running the service on my local

http://localhost:4058/WiringJsonImpl.svc

to test it out.

instead of getting the standard wsdl screen it display the message “Metadata publishing for this service is currently disabled”

i paste the address in the url

 http://yourserver.com/LocationService.svc/GetLocation?method=jsonpCallback

and hit enter i see the blank screen with this message in IE browser.

The webpage cannot be found 
 HTTP 400  

in my web.conig i see the error but does not stop running the application:

 <bindings>
   <customBinding>
    <binding name="jsonpBinding">
     <jsonpMessageEncoding/> //<<<error here
     <httpTransport manualAddressing="true"/>
    </binding>
   </customBinding>
  </bindings>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:11:13+00:00Added an answer on May 18, 2026 at 8:11 am

    In the provided sample application (JSONP) the service method is called GetCustomer and not GetLocation. So to call it:

    http://localhost:1163/service.svc/getcustomer?method=jsoncallback
    

    which returned the following response in my browser:

    jsoncallback( {"Address":"1 Example Way","Name":"Bob"} );
    

    The reason that Visual Studio Intellisense underlines the <jsonpMessageEncoding/> is because this is a custom binding element and not part of the schema and it is not known. You can safely ignore this warning.

    The only problem with this sample is that the files are packaged in a Class Library instead of Web Application. In order to run the service more easily in the Visual Studio built in server you could create a new Web Application, copy all the files to this new application and run it. You just need to modify this line in web.config:

    <add name="jsonpMessageEncoding"
         type="Microsoft.Ajax.Samples.JsonpBindingExtension, service, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
                                                                ^
    

    to include your web application name:

    <add name="jsonpMessageEncoding"
         type="Microsoft.Ajax.Samples.JsonpBindingExtension, MyWebAppName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
                                                                  ^
    

    That’s all. Now go ahead and write a client application which consumes this JSONP stream. jquery does a great job with the $.getJSON() method:

    $.getJSON('http://localhost:1163/service.svc/getcustomer?method=?', function(customer) {
        alert(customer.Address); 
    });
    

    I have uploaded my working version here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As made clear in update 3 on this answer , this notation: var hash
I would like to update my SQL lite database with the native update-method of
Is there any performance hit for writing a function such that local var statements
Using Linq, trying to select all records not in my local set fails: var
Update: Solved, with code I got it working, see my answer below for the
Update: Check out this follow-up question: Gem Update on Windows - is it broken?
Update: giving a much more thorough example. The first two solutions offered were right
UPDATE: Focus your answers on hardware solutions please. What hardware/tools/add-in are you using to
Update : Looks like the query does not throw any timeout. The connection is
Update: Now that it's 2016 I'd use PowerShell for this unless there's a really

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.