Need help with WCF Ajax service that can be called from client with json\javascript.

I was able to successfully set this up in my development environment by adding the web services to the same project as my client pages.  I am now trying to connect to a different web services outside of my project that is being hosted in IIS. 

 If i open a browser and type in the url for the .svc file everything looks fine, I can even append the \js and the proxy code is generated.  However on my client side I get erros in my javascript code "object doesn't support this property or method"  Below I have pasted my javascript, scriptmanager, interface class and web services class.  Can someone help me narrow down where my problem is?  If so I would greatly appreciate it.


<script type="text/javascript" language="javascript">

function test()



ret = BWWebXChangeWCF.TestLibrary(OnComplete, OnTimeOut, OnError);



function OnComplete(args)





function OnTimeOut(args)


"Service call timed out.");



function OnError(args)


"Error calling service method");







function Button2_onclick() {



-- Script Manager:

<asp:ScriptManager ID="ScriptManager1" runat="server">


<asp:ServiceReference Path="http://denqasoweb1/BWWebXChangeWCF/BWWebXChangeWCF.svc" />



<asp:ScriptReference Path="http://denqasoweb1/BWWebXChangeWCF/BWWebXChangeWCF.cs" />




-- Interface class:

namespace BWWebXChangeWCF


ServiceContract(Namespace = "")]

public interface IBWWebXChangeWCF



string TestLibrary();


-- Here is web service class:

namespace BWWebXChangeWCF



AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]


public class BWWebXChangeWCF : IBWWebXChangeWCF


private string DBITSSQLServer = "";

private string SSACustConnectString = "";

private string SSADefsConnectString = "";

private string SSASaleConnectString = "";

private string SSAWebSaleConnectString = "";

private string IntegratedDBConnectString = "";

private string BWLoginConnectString = "";

private EventLog _evtLog = null;

private ssiSQL.ssiSQLDB ssiSQLDB = new ssiSQL.ssiSQLDB();

private long iCompanyID = 0, iLogID = 0;

//localConfig will get populated as long as you call ValidateUser

private ssiLocalConfig.ssiLocalConfigns localConfig;

private ssiMasterConfig.ssiMasterConfigns masterConfig;

private long ssiCorpID = 0; public BWWebXChangeWCF()




ssiSQLDB.DB.SQLWorkstationName =

ssiSQLDB.DB.SQLApplicationName = "bwWebXChangeWCF";

ServerConfig.BwConfig bw = new ServerConfig.BwConfig("SFA");

ssiSQLDB.DB.SQLUserName = bw.GetConfigSetting("sUserName", "");

ssiSQLDB.DB.SQLUserPassword = bw.GetConfigSetting("sPassword", "");BWLoginConnectString = bw.GetServerConnectString().Replace("BrandwiseOperations", "BrandwiseLogin");

ssiSQLDB.DB.BWSQLServerName = bw.sBWLoginServerName;

DBITSSQLServer = bw.GetConfigSetting("sDBITSServerName", "");

if (DBITSSQLServer == "")


Exception ex = new Exception("DBITS SQL Name not set in Application Module Settings");throw ex;


bw = new ServerConfig.BwConfig("Brandwise System");

SSACustConnectString = bw.GetConfigSetting("SSACustConnectString", "");

SSADefsConnectString = bw.GetConfigSetting("SSADefsConnectString", "");

SSASaleConnectString = bw.GetConfigSetting("SSASaleConnectString", "");

SSAWebSaleConnectString = bw.GetConfigSetting("SSAWebSaleConnectString", "");

localConfig = new ssiLocalConfig.ssiLocalConfigns(this.ssiSQLDB);masterConfig = new ssiMasterConfig.ssiMasterConfigns(ssiSQLDB);




ssiSQLDB =



public void Dispose()






catch { }ssiSQLDB = null;


public string TestLibrary()


return "HELLO WORLD";


4/18/2008 9:26:04 PM 378 articles. 0 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 44

I was able to get this working by running the web project and web service on the same IIS machine.  In your script manager you only need to point to the .svc in a service reference tag.

4/24/2008 4:32:52 PM

Similar Artilces:

ajax 3.5 extensions preview and .NET 3.5
I'm a little bit confused.On one hand you say the AJAX framework is included in .NET 3.5. On the other hand there's an ajax extensions preview which "provides new functionality being added to ASP.NET 3.5 and ADO.NET in 2008." Is the latter like an addon to the .NET 3.5 built-in framework? Out of a developer perspective I would like to know if it is "safe" to develop with the 3.5 extension preview.. and if at any state its functionality is added to the .NET framework. Do I need to install the 3.5 extension preview on my host running IIS, too? Or i...

Cannot call a web service from java script using ajax in .net 3.5 web applications
As like 2005 .net websites i tried to consume a web service from client side java script  using Ajax script manager in  .net 3.5 (2008) version web application it was not working, Event it works with 3.5 web sites, What i have to do to solve the issue. Thanks in advance Hi, can you create the least amount of code to reproduce it and post it? This gives us the ability to check out your code and better guide you. Also please check out this article: Create a Simple WCF Web Service and Use In JavaScript With Visual Studio 2008 and .Net 3.5.  Grz, Kris.Read my blog. Handy Fire...

precompiled 3.0 wcf service has references to .net 3.5
after I installed .net 3.5 my existing web site with a wcf serivce has references to the 3.5 versions of System.WorkflowService and System.ServiceModel.Web. They are inserted in the .svc.compiled file when precompiled non updateable. I found them in the customString attribute in the preserve tag. Even when I precompile with VS 2005 and deploy it to any system without .net 3.5 it doesn't work (the assemblies couldn't be found...). I found out that the framework (2.0) web.config is modified after 3.5 installation. There are 2 assembly references (the two above...

.Net 3.5 ADO.Net Data Service & Ajax
 Hello, I was trying to use the example in the following video and I keep getting "Server Method "Categories" failed" error. I have .Net 3.5 SP1 and VS 2008, is there any workable example out there? I also added the Entity Data Model.  I really like the way how you can access data in the database using javascript. Any help on this code? thx Default.aspx     <input id="ButtonQuery" type="button" value="Perform Query" onclick="return ButtonQuery_oncli...

Can we replace Microsoft .Net framework 3.5 with Microsoft .NET Compact Framework 3.5
Hi, I have installed vs2008 in C drive and removed it from there  including Microsoft .Net framework 3.5, due to space crunch, then I started installing it in D drive, in this case it did not install .Microsoft .Net framework 3.5 and now it does not show me Microsoft .Net framework 3.5 it shows .NET Compact Framework 3.5 in Add remove program list. My question is will VS2008 work fine with .NET Compact Framework 3.5. apart from it it also has .NET Framework 3.5 SP1 in the list, all what is missing is microsoft .net framework 3.5  Please let me know ...

Can I switch from .Net 3.5 to .Net 3
After finishing the website that I built in VS 2008 and has AjaxControlToolkit controls. I was informed by the network admin that the server has .Net 3 and that we can't install .Net 3.5. I tried to change the application settings from Property Page --> Build node, and then select .Net Framework 3.0 from Target Framework Dropdownlist, and then click OK BUT then I can't run my application I get error message and the     <asp:ScriptManager ID="ScriptManager1" runat="server" />   is unknown even when I try ...

Issue with clients consuming a web service that was upgraded from .NET 1.1 to .NET 3.5
I am currently working with an application that was converted from Visual Studio 2003 to Visual Studio 2008 and we are having issues with a client consuming the web service portion of the application.  The web services were written in .NET 1.1 using the Web Services Enhancements 2.0 and was upgraded to use the .NET 3.5 framework.  One of our clients application, which is still written in .NET 1.1 was reference the upgraded web service and tried to consume the web service and received the following error: System.Web.Services.Protocols.SoapException: Se...

install Ajax toolkit for Net 3.5? who can give me address how ajax install ?video lesson?
hi friends i saw this lesson but i cant find it now. My ajax toolkit broken.. i cant see ajax toolkit. why ? i dont know .. maybe karamasoft :) install Ajax toolkit for Net 3.5? who can give me address how ajax install ?video lesson? cheersMark as me if my question or my answer can be helpful for you :) | Twitter epascarello | LinkedIn...

Can i setup endpoints in my web config so i can call my wfc ajax web service from both the client and the server?
I am having trouble setting up a webHTTPbinding endpoint and a wsHTTPbinding endpoint on the same site so i can call my web services from the client or server.  Seems to work fine i chose one or the other, has anyone else tried to do this?  Thanks for any help. Wayne...

Where can I get native PB drivers for ( Oracle Version with Oracle Net Client Version 7.3.3
( Oracle Version with Oracle Net Client Version 7.3.3 with SQL *Net version 2.x , 32 bit implementation. All versions of PB Enterprise (5,6,7) have the native O73 driver. If you have PB Professional, you can only use ODBC to connect to Oracle. -- Terry Dykstra (TeamSybase) Canadian Forest Oil Ltd. Check out Sybase Developer's Network: Veena Madhavi <> wrote in message > ( Oracle Version with Oracle Net Client Version 7.3.3 with SQL > *Net version 2...

.Net 3.5, Ajax, Javascript APIs
I have created a simple form with which the user updates thier information to a SQL database. It runs with an update panel and as such is part of a partial page update. After a successful update to the data (using try catch, assuming not exception is thrown) it will update a label to "Sucessfully updated your profile". I don't want this to stay there; if they update again on the same page, there is no new indicator it was successful because the label is already set. I like mootools and scriptaculous APIs for javascript animations. I've done registration of scripts and what ...

Need help with styles in .net 3.5 .
Hi i currently have a page with the following:<html xmlns="" > <head runat="server"> <title>Invoice Approval</title><LINK href="../Common/Style/MyStyle.css" type="text/css" rel="stylesheet"> <style type="text/css"> .style1 { width: 878px; height: 512px;position: absolute; left: 10px;top: 56px; } #BtnApprove {width: 93px; height: 23px;font-family: Arial,Helvetica, sans-serif; font-size: 12px; font-weight: bold; color:#ffffff; BACKGROUND-COLOR:#678FC2...

using MSBuild in .net 3.5 need help
Hi all,   I know that MSBuild comes with the .net 3.5. How to use this so that my application builds with the MSBuild. I dont know where to start. Frist do I need to Run the MSbuild in the .net 3.5 folder and then compile or Do i have to change any file (eg web.config). 8-)     Please help me. Thanks for all your time.     msbuild is a command that is internally used by visual studio to build the projects ,and it can be used out of visual studio environemnt through the "visual studio command prompt" ( all Programs -> cisual studio 2008 ->...

Help installing AJAX on VS2008 .NET 3.5
Hi folks I am really struggling to get AJAX working despite following the tutorial video.  Here are the steps I have followed: 1. Downloaded the latest AJAX Control Toolkit Framework from 2. Extracted the files to a directory called AJAX Control Toolkit in Program Files 3. Navigated to Progarm Files\AJAX Control Toolkit\SampleWebSite\Bin and copied all those files to Program Files\AJAX Control Toolkit\Binaries 4. Opened VS2008 and created a new ASP.NET Web Site (ensuring the framework selected w...

Web resources about - Need help with WCF Ajax service that can be called from client with json\javascript. -

JavaScript Kit- Your comprehensive JavaScript, DHTML, CSS, and Ajax stop
Your comprehensive JavaScript, DHTML, CSS, and Ajax stop

Let's Code: Test-Driven Javascript by James Shore — Kickstarter
James Shore is raising funds for Let's Code: Test-Driven Javascript on Kickstarter! A screencast series focusing on rigorous, professional Javascript ...

Eloquent JavaScript: A Modern Introduction to Programming
... and pragmatics. I loved the tutorial-style game-like program development. This book rekindled my earliest joys of programming. Plus, JavaScript! ...

Lightbox (JavaScript) - Wikipedia, the free encyclopedia
On a Lightbox-enabled page, a user can click an image to have it magnified in a Lightbox window, which resizes itself according to the size of ...

Open Directory - Computers: Programming: Languages: JavaScript: Tools: Obfuscators
about dmoz - help Top : Computers : Programming : Languages : JavaScript : Tools : Obfuscators Tools for obfuscation/compression JavaScript code. ...

Facebook File-Transfer App Pipe Relaunches, Now Works Via JavaScript, WebRTC
... allowed Facebook users to send and receive files up to 1 gigabit in size. A new version of Pipe debuted Monday, and the app now works via JavaScript ...

Under the Hood: The JavaScript SDK - The use of polyfills - Facebook
Facebook Engineering hat eine Notiz mit dem Titel Under the Hood: The JavaScript SDK - The use of polyfills geschrieben. Du kannst den vollständigen ...

JavaScript SDK - Facebook-Entwickler
Overview The JavaScript SDK provides a rich set of client-side functionality for accessing Facebook...

Senior Front-End Developer (Javascript and AJAX)
Company: Sometrics Category: Software Development Location: Los Angeles, CA How to Apply: Description: We are looking for ...

Badass JavaScript (@badass_js) on Twitter
WebGLWorker is an open source library that allows using WebGL from Web Workers. Great work as always from @kripken .… ...

Resources last updated: 12/9/2015 8:40:25 PM