Java - Can A Webservice Be Secured With Authentication When Called From Ajax Client Side

Oct 31, 2010

How do I protect a webservice if it is called from ajax ?

Update: I realize that my question didn't reflect what I intended to ask. I don't want user to be able to do the request by pointing to it with its webbrowser but only in the context of my app.

View 2 Replies


Similar Messages:

Access Webservice Developed Using C# Using Java Client Without Crossdomain.xml File

Nov 27, 2010

Can we access a c# webservice using java client , even if there is no crossdomain.xml file present on for eg, IIS?

View 1 Replies

Use Remote Web Service By Using Java Script On Client Side?

May 18, 2010

I've spent a week trying to use [URL] methods on client side. How to do that?

View 4 Replies

Javascript - Client Side Validation And Server Side Validation In Java Script And Respectively ?

Sep 6, 2010

want to know that can we validate a control which is out side a form element in asp.net(server side validation)and outside a form element in html(client side validation) let's take a closer look

<html>
<body>
<input type="text" name="first name"/>
</body>
</html>

can we apply clien side validation on above text box by java script ?in asp.net

<form runat="server">
</form>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

View 2 Replies

Validation Controls Are Not Validating On Enabling On Client Side Using Java Script?

Jun 11, 2010

As per requirement I disabled all validation controls in page on PageLoad event in server side.

On clicking submit button I want to activate them and validate the page and if the page is ok submit other wise not.

I am able to enable all validaters but one thing that I am unable to understand is that they do not validate the page. I set alerts and check they are being enabled but they do not validate the page and let the page submit.

Below is my script:

[code]....

View 1 Replies

Autopostback Event Will Fire For Textbox When Java Script Desable At Client Side

Dec 13, 2010

i have set autopostback property for text box . will it fire when java script desable at client side

<asp:TextBox ID="Slider1" runat="server" OnTextChanged="Slider1_TextChanged" AutoPostBack="True" >

View 1 Replies

AJAX :: Webservice Not Being Called

Feb 24, 2011

I am new to ASP.NET (2 months) and my very first assignment is to create a website for a municipality. Purchasing as much reading material as possible, I got started and after some time, I have a decent website (coded in C#) that is ready to be internally tested on the departmental webserver. The Web server is running IIS 7 and the pages were developed with Visual Studio 2010. On the main default page, I wanted to implement a slide show using the AJAXControlToolkit which I installed. I watched the ASP.net tutorial [URL] and literally coded my slide show verbatim. I try to launch my slideshow within my default.aspx page and absolutely nothing happens. The steps that I took are

1. Created a webservice (SlidesService.asmx) which generated a code behind file (SlidesService.cs).

2. I created the web method GetSlides() containing a 22 element array which I place in the code behind file.

3. Implement the ToolkitScriptManager establishing my image control.

4. Defined my Previous, Play and Next buttons.

5. Implemented my SlideShowExtender providing my SlideShowServicePath and SlideShowServiceMethod.

Assumptions: In doing all of the above, I noticed that the SlidesService.asmx file needs no code (as I placed all code within the codebehind file). The SlidesService.cs code behind file should reside in the App_Code folder whereas the the SlidesService.asmx file can remain in the root folder. No Button e.g Button_Click needs to be attached to the code behind source file. If I have conveyed my steps properly, can anyone shed some light on why when clicking the play button, nothing happens? Code is listed below.

[Code]....

SlidesService.asmx - code
<%@ WebService Language="C#" CodeBehind="~/App_Code/SlidesService.cs" Class="SlidesService" %>

View 2 Replies

WCF / ASMX :: Webservice To Import Data From Client Side

Apr 28, 2010

I want to build a webservice that has to get some data as parameter from the client application. the data from the client side are records from there database. my websercie has to send then these data to a soap server through 'HttpWebRequest'. Can i get the data as Datatable? and then send as stream to the soap server? Or maybe there is a better easier ways?

View 2 Replies

WCF / ASMX :: Adding Parameter To Soap Header In Webservice From Client Side

Jan 4, 2011

I am trying to consume a third party web service. In order to access any web method I need to pass session id with soap header in each request. I am trying to modify my header but haven't been successful. I am using proxy in 2.0. I created a separate class which inherits the soap header. I have copied my code but I am not sure how to go about this. How do I attach this header to proxy.

[Code]....

View 2 Replies

AJAX :: Can Send An Object From Client-side JavaScript To Server-side Code Via AJAX

Mar 16, 2011

I know that I can receive an javascript object from the server via ASP.NET AJAX using Json. But I am not sure how can I send an javascript object from my client-side javascript to my server-side code. And if I can, how can I extract this object in my server-side code and access its members?

View 1 Replies

Security - Securing Forms Authentication Token On Client Side?

Jul 16, 2010

In my website, I am not using any authentication or authorization. I've created login page to capture the user credentials and check against database. If the user successfully authenticates, it's storing the user data in session and navigating to other pages. How thinking of implementing Forms Authentication, but my concern is how to secure the authentication token in client browser for security reasons. Does anyone have any ideas how to secure the authentication token?

View 1 Replies

Ajax - Listbox Items Client Side Reordering Not Reflected In Server Side?

Jan 5, 2010

I reordered some items in a listbox using Javascript. When I read the items in a postback in the code behind (ASP.NET), the order is in the original order. How do I get the same order as shown in the screen after Javascript manipulation?

View 3 Replies

AJAX :: To Know Error Like Username Or Password Is Incorrect On Client Side Instead Server Side?

Oct 4, 2010

I m using site login Control in my login.ascx file and disaplaying login control in Div so if there is login link in page and i click on that then Login Div will popup which is site login.May i know how can handle error like username or password is incorrect on client side instead server side?

View 6 Replies

VS 2005 AJax Tab Container - Enable The Server Side Not Client Side

Feb 4, 2010

I have set the ajax tabs disable on form load. ON button click, I want to enable the tab server side,not client side.

protected void btnEnableCostPetroleumTab_Click(object sender, EventArgs e)
{
TabContainer2.Tabs[0].Enabled = true;
}

But its not enabling the tab?

View 12 Replies

First Invoke Server Side Code Then Client Side Script Without Using AJAX?

May 18, 2010

in a form i have a buttoin, when click both OnclientClick and postback should happen. on clicking the "Email" button a client side "mailto" tag should do the work and pull a new message window on the client's machine.

whereas, the email addresses should be invoked by the post back. so , when clicking the button the server side post should happen and on return the client side script should be invokded with the values read during post back, and populate all the email addresses.

i need know how to first do a server hit take the values and then execute the client script with those values without using AJAX

View 1 Replies

AJAX :: Calling Server Side Methods From Client Side Using PageMethods?

Jan 24, 2016

I am calling server side methids from client side using PageMethods. Can those methods return value back to client side. If yes then how and if no then how can that be achieved? refer to my code below.

function getValuesFromPSS(s,e)
{
debugger;

[Code]....

View 1 Replies

AJAX :: How To Call A Server Side Method From Client Side

Jul 16, 2010

I am using VS2010 and .NET4 for a web app. I have a script manager/update panel that has a couple of grids.

The client just leaves the page opens and views an updated grid every 30 seconds or so.

I want to refresh the grid by calling the server side method to load the grid, but not load the whol page using meta refresh or similar (too much screen flicker and unnecessary bandwith).

Is it possible to set some timer using javascript or something and call a specific server method to refresh controls?

View 3 Replies

AJAX :: Calling A Server-side Function From Client-side?

Feb 28, 2011

I want to do something a little bit tricky here. I want to call a server side fonction from the javascript. I know it can be done but I get some errors. This is my Javascript fonction where I want to call the server side fonction:

[Code]....

And this is the code in my VB page:

[Code]....

View 1 Replies

How To Execute Web Services Asynchronously In Server Side When Called By JQuery's .ajax

Mar 22, 2011

I have an ASP.NET (3.5) web page which calls a few web methods (SOAP based) using jQuery's .ajax method. The web methods implement 'ScriptMethod' attribute and return JSON data. The web service file (asmx) is local to the same project.

I noticed these web methods execute synchronously on the server which means they run sequentially and affect performance negatively, some methods are waiting, when some of them are slow.

I read this article and I am not sure if I understand that WebMethods which implement Scriptmethod can run synchronously only (they implement IHttpHandler not IHttpAsyncHandler).

If this is true, I might have to change the design. I am looking for other designs, maybe like using WCF, where the browser can call webmethods using JavaScript and the web methods run asynchronously on the server.

View 2 Replies

Javascript - User Control With Client + Server Side CustomValidation; Wrong Client Side Validator Is Picked

Nov 23, 2010

I have a user control which contains a CustomValidator which is used according to whether a RadioButton is checked or not (there are several RadioButtons, I'm only showing the relevant one)

<asp:RadioButton runat="Server" ID="RadioBetween" GroupName="DateGroup" CssClass="date_group_options_control_radio" />
[code]...

There is some client + server side validation code (the server side code does exactly the same thing and is skipped for brevity)

<script type="text/javascript">
function ValidateDateFields_Client(source, args) [code]...

There are two instances of this control in the page. When running the client side version it hits the wrong one (the version of the control which is disabled). You can see from the generated HTML both are correctly specified. I'm not sure how .NET works out which clientside function to call given they both have the same name.

<script type="text/javascript">
//<![CDATA[
var ctl00_MCPH1_QueryTextValidator = document.all ? document.all["ctl00_MCPH1_QueryTextValidator"] : document.getElementById("ctl00_MCPH1_QueryTextValidator");

[code]...
Do i need to add something in to scope it? What's the best way to achieve this? If I disable the loading of the second control everything works fine.

View 1 Replies

AJAX :: Fire A Javascript Onclick Function Before The Server Side Event(SelectedNodeChanged) Called?

May 12, 2010

I have developed a web application which contains aspdotnet treeview control. In this treeview control has binded with some database value.. that controls has one parent node and more than one child nodes for each parent node.

my problem is here, when the user clicks the parent node, I need to fire a javascript onclick function before the server side event(SelectedNodeChanged) called..

If I provide javascript to the parnet node when it is binding, then I could not fire the server side event(SelectedNodeChanged).

How to provide onclick javascript event for parent node in treeview control even the parent node has SelectedNodeChanged event.

View 6 Replies

Ajax - Call An ASMX Webservice In Javascript Without Resetting Authentication Timers

Nov 23, 2010

Pinging back to a webservice in ajax from the client keeps the user's session alive, I don't want this to happen. More extensive summary For a website we're developing, we need the client to ping back (in js) to a webservice (ASMX) on the server (IIS7.5). This happens to let the server know that the user is still on the site, and hasn't browsed away to another site. This is as our customer wants to let users lock records, but if they browse away to other sites, then let other people take over those locked records. Perhaps the distinction between the client being on the site but inactive and on another site seems unimportant, but that's kinda irrelevant, I don't get to write the UI spec, I just have to make it work.

My problem is this, the ping stops the user from being timed out on the server through the standard forms authentication timeout mechanism. Not surprising as there is that 30 second ping in the background keeping the session alive. Even though we want to know if the user is still on the site, we want the normal forms authentication timeout mechanism to be honoured. I thought I might be able to fix this by removing the ASP.NET_SessionId and .ASPXAUTH cookies in the XMLHttpRequest that is the server ping, but I can't figure out how to do this. This is how my web service & method are defined:

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ScriptService]
public class PingWS : WebService
{
[WebMethod]
public void SessionActive(string sessionID)
{
// does stuff here
}
This is how I'm calling it in js (request is over HTTPS, :
$.ajax({
type: "POST",
url: "PingWS.asmx/SessionActive",
data: 'sessionID=' + aspSessionID + '}',
beforeSend: function (xhr) {
xhr.setRequestHeader('Cookie', '');
xhr.setRequestHeader('Cookie', 'ASP.NET_SessionId=aaa; .ASPXAUTH=bbb;');
},
dataType: "json"
});

I was trying with the setRequestHeader, but that just appends to the header rather than overwrites the header, and IIS is happy to ignore that junk I added. I'm thinking maybe I should be trying to do this at the server end, someone take PingWS.asmx out of the loop so that it doesn't keep the session active, but I'm not sure how to do this. Although the title of the question is focused on clearing the cookie in the header, I'd be super happy if anyone points out that I'm being really stupid and there is actually a much better way of trying to do what I'm doing.

I'm thinking at this stage maybe I need to add something to the webmethod that says how long this particular page has been inactive, and use that knowledge to timeout manually. That actually sounds pretty easy, so I think I'll do that for now. I'm still convinced that there must be an easy way to do what I originally wanted to do though. Update I'm thinking I'm pretty screwed in terms of cookie manipulation here as both the .ASPXAUTH and ASP.NETSessionId cookie are HttpOnly, which means the browser takes them out of your hands, you can't access them via the document.cookies object. So I would say that leaves me with:

Updating my SessionAlive webmethod to track each request so I can tell how long the user has been sitting idle on a page and timeout if needs be Marking the .asmx page somehow on the server end so that it's taken out of the normal authentication/session tracking flow I know how to do 1. so I'll start there but 2. seems much cleaner to me.

View 3 Replies

WCF / ASMX :: Calling Java Webservice From C#

Dec 9, 2010

I need to call a Java webservice from my ASP.Net application. The webservice uses Java Key Store (JKS) certificate. Could some one help me with how I could do this? As a side note, when I try to add Web Reference or Service Reference to my Visual Studio project by providing the WSDL, Visual Studio always crashes.

View 1 Replies

AJAX :: Registering Client Side Script To Interact With AJAX Controls

Sep 13, 2010

Im using some animationExtenders in my project. The thing is, the objects to be animated are created programmatically, hence i need to also build programmatically the javascript code that will interact with them.

It runs properly but, when i interact with these animated controls and the javascript functions are supposed to get to work, i keep getting the usual run-time error saying that the javascript functions are not defined. But, if i check the final html code generated, i can see how all the controls i built programmatically are there ,as well as the script.

Tried both RegisterStartupScript and RegisterClientScriptBlock, no luck.

View 1 Replies

Security :: Calling A Java Webservice Using Credentials From Application?

May 19, 2010

I am using Asp.Net application for calling an existing Java webservice. Recently the web service is configured with Security certificates. Now I need to call the webservice using "https:URL .." and by passing the credentials i.e. UserId and Password.

When I call the webservice using [URL] I get the below error. Is the change in my code is causing this error?

Error:Client found response content type of 'text/html; charset=iso-8859-1', but expected 'text/xml'. The request failed with the error message: --

500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request. contact the server administrator, you@your.address and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log.

IBM_HTTP_Server Server at ............ Port 443

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved