C# - Can't Call A Web-service Twice In One Page

May 11, 2010

I built a web-application which calls a web-service twice in the application's log-in page - first, on Page_Load, and the second time is after a button click. When debugging, everything goes well, but after publishing the web-application and trying it - I cannot make the two calls for the web-service (each call is invoking a different function in the same web-service).

If I call it once (say, in the Page_Load) its OK, but once I get to the button click event, the page just seems to be loading but actually doing nothing (loading to infinity).

When I disabled the web-service call in Page_Load, the web-service call after the button click worked well, and if I switched between them (disabled the call in button click and enabled the call in Page_Load) the enabled one worked OK.

How come this is happening? What did I do wrong? Could it be related to the fact that the location where I published my web-application has some URL-rewriting rules?

View 3 Replies


Similar Messages:

Can Call Method That Exist On Aspx Page Through Web Service

Feb 24, 2011

Can we call a Method that exist on a aspx page through Web Services.

It is like Reflection that method exists in dll form , but is it possible to call method from Aspx page.

View 2 Replies

C# - Can Call Aspx Page Which Is A Part Of Web Service Through A Web Application

Nov 17, 2010

I have written a sample web service, which consist of certain .aspx pages. I have written a code to consume webmethods from that web service. Now, is it possible to load the aspx page which is a part of the web service from the calling web application i.e. from another aspx page which is outside the web service.

How this scenario is;

I have one web application running with a page say Page1.aspx in browser. 2. I have created a web service which is having an aspx page say Page2.aspx. 3. There is a button on Page1.aspx. 4. Now, when client click on the button, is it possible to load Page2.aspx, which is not a part of web application, but the web service.

[code]...

What I am trying to do is, get response obtained in Gen.aspx and pass it to default.aspx page.

View 1 Replies

VS 2013 - Call Web Service Function Within (Code Behind) Using AJAX On Page

Dec 4, 2014

I am trying to call a web service function within my own ASP.net (code behind) using AJAX on the page.

Once i push the button to execute the JS/AJAX/codebehind - I got an error.

POST http://************/admin/Admin.aspx/getDBInformation 500 (Internal Server Error)

This is my code below that I am currently using:

Code:
<WebMethod> _
Public Shared Function getDBInformation() As String
loadDBData()
Return JsonConvert.SerializeObject(dbInfo, System.Xml.Formatting.Indented)
End Function
End Class

The code behind looks like this:

Code:
Imports System.DirectoryServices
Imports System.Security.Principal
Imports System.Net
Imports System.Drawing
Imports System.IO
Imports System.Data.SqlClient
Imports System.Web.Services
Imports Newtonsoft.Json

[Code] ......

How can I correct this issue so that I am able to call **loadDBData()** without that 500 error?

View 2 Replies

AJAX :: How To Avoid Cascading Dropdowns To Call Their Service Methods On Every Postback Of The Page

Feb 24, 2011

I have three cascading dropdowns on my web page and they work fine. The issue I am facing is that there are other controls on the page which cause a postback and with each postback the cascading drop downs are being re-populated (service methods are called) which is becoming a performnace issue.

View 1 Replies

WCF / ASMX :: How To Call Synchronous Service Call For Combo Boxes

Mar 29, 2010

How to call Synchronous service call for combo boxes? As I know Synchronous calls do not create a good user experience because the application is hung waiting for the Web service call to return. Then it is my requirement.

View 1 Replies

Possible To Call An Web Service On Private Corporate Network From Web Service Located In Dmz

May 18, 2010

whether its possible to call an web service on a private corporate network from a web service located in a dmz?

View 2 Replies

WCF / ASMX :: How To Call Web Service Hosted In Window Service And Having End Point Over Tcp

Aug 4, 2010

i have created a normal web service and i want to host it outside IIS. one idea i got is to use window service as hosting environment. i have created a web service and hosted it window service and its window service is running now.would anybody please let me know that how can i call web service hosted in window service binded over soap.tcp. here is my sample code.

[Code]....
[Code]....

View 1 Replies

WCF / ASMX :: Create Web Service - How To Web Page Call Sales_Services.asmx

May 5, 2010

if i have the web application with many pages like add order page, edit order page, and delete order page actually they also interact with the Sql Server 2008 and i also create web service page call Sales_Service.asmx. i know just i need to put something like query into Web Method in Sales_Service.asmx but i have a lot of queries, i don't know which query i should put into it and how the web page call the Sales_Services.asmx

View 2 Replies

Talking To A Rest Service / Call A Rest Service Without Having To Redirect?

Feb 8, 2010

I need to call a Rest service but would like to do so without having to redirect. Here is my dilemma. The Rest service we are trying to integrate offers the option to sign up for a subscription but does not allow us to upgrade an existing subscription. So if a user wants to upgrade an existing subscription we have to first cancel and then have the user sign up for a brand new subscription. I don't know how I can make this so it flows nicely in my code. I ideally I would like to do something like this

User decides to upgrade

Click upgrade button

Existing account is being cancelled, if cancellation was successful

New account is being created

How can I do this with a Rest service? Here is a sample URI/URL

https://someservice.com?
Action=CancelSubscriptionAndRefund
&AWSAccessKeyId=AKIAIIFXJCFIHITREP4Q
&CallerReference=CallerReference07
&CancelReason=MyWish
&RefundAmount.CurrencyCode=USD
&RefundAmount.Value=1
&SignatureMethod=HmacSHA256
&SignatureVersion=2
&Signature=1uFUSSFvau1zadnSzKRS5ZchuLMn9p5M3ifaHGHie7M%3D
&SubscriptionId=17d62772-c53e-4bdb-9667-65d7b7841cfc
&Timestamp=2009-10-06T08%3A05%3A13.296Z
&Version=2008-09-

Could anybody give me some ideas how to make this work in an elegant manner. We thought we could keep the old subscription and then just sign the user up for a new subscription for the difference of the money. For example the first subscription would be 2.95 and the second one would be 2.00 which would amount to a subscription of 4.95. I think it is not elegant and the user would see 2 charges on the credit card, weird, I think. Since I don't know much about Rest maybe there is a way that this can be solved.

View 1 Replies

.net - Using And Web Service Call?

Feb 11, 2010

What does the using statement do? Is it actually needed?

using (MyWebservice x = new MyWebservice())
{
//random code
}

View 4 Replies

How To Asynchronously Call A Web Service

Aug 27, 2010

I need to asychronously call a web service from an ASP.NET application. The aspx does not need the answer from the web service. It's just a simple notification.

I'm using the ...Async() method from web service stub and <%@Page Async="True" %>.

ws.HelloWorldAsync();

My problem: the web page request is waiting for the web service response.

How to solve this problem? How to avoid any resource leak when the web service is down or when there is an overload?

View 5 Replies

WCF / ASMX :: Call Url From Another Web Service?

Jan 12, 2011

I need to download a file from a website to my specified folder and use in my asp.net application.The file is update everyday and i need to pull the latest file.

View 5 Replies

How To Call To The Database Via Ria Service

Oct 18, 2010

I was wondering why you would still use ASP over Silverlight, since with silverlight there is a lot you can do already. And you dont have to use css, jquery, js, html, etc.

Also with silverlight you can do a call to the database via ria service.

I can only think of 1 reason which is, that not every one has the plugin installed. But thats just a matter of time.

View 5 Replies

How To Call Web Service(.wsdl) Using Asp.net

Dec 14, 2010

I got .wsdl file from my client. by using this webservice i need validate customer information. So how to achieve this one .if customer is there or not
xml :

<xs:element name="FetchClubMembershipRequest">
<xs:annotation>
<xs:documentation>Request to fetch customers' membership information.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="Customer_ID" type="xs:string" />
<xs:element minOccurs="1" maxOccurs="1" name="Customer_Code" type="xs:string" />
<xs:element minOccurs="1" maxOccurs="1" name="Last_Name" type="xs:string" />
<xs:element minOccurs="1" maxOccurs="1" name="First_Name" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>

this is from wsdl.file

View 3 Replies

C# - Call A Web Service From The Controller?

Jun 17, 2010

I have an asp.net MVC2 application that needs to call a web service from the controller. How do I do this? It is a RESTful service that returns Json data.

View 4 Replies

WCF / ASMX :: What Happens After A Web Service Call

Oct 4, 2010

I am expecting results from a jsonp web service call. The expected result is, for example "This is a test".

The result returned is correct when I checked at debug mode.

However the actual result taken from fiddler is "This is );jsonp1286206213419( a test"

Why is a ");jsonp1286206213419(" inserted into the result? How do I troubleshoot this?

View 2 Replies

C# - Call A Web Service From Javascript?

Jan 6, 2010

How to Call A ASPNET web Service from javascript?

View 2 Replies

C# - Call A Service From Within Assembly?

Apr 3, 2010

I have a C# library. From within it, I want to call a static method that exists within the same library but through Javascript. Can I use WebResource to call a C# method?

View 1 Replies

Call A Web Service In Javascript?

Nov 5, 2010

As the title states, I'm trying to call a web service written in ASP.Net (Same solution, but different project in visual studio) from javascript. Since I added the web reference for the service prior to this for calling it in VB.Net, I tried to use this reference by directly calling it.In the body of the Default.aspx page, I have this code:

<asp:ScriptManager id="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="~/App_WebReferences/localhost/ServiceName.discomap" InlineScript="true" />
</Services>
</asp:ScriptManager>

but in javascript, I can't call my service at all. Could anyone explain me how? I'd want to do something like this:

<script type="text/javascript">
alert(ServiceName.HelloWorld())
</script>

View 2 Replies

AJAX :: Trying To Get AutoComplete To Call Web Service

Apr 26, 2010

I'm going on my 3rd day trying to get my Ajax AutoComplete textbox to call my web method. Based on my google searches, I'm not alone. I suspect the problem has something to do with the ServicePath property on the extender, although I'm not sure. My web service is at the same level, on the same server as my test web page. I'm not sure exactly what should go into the ServicePath property, although I think I've tried every possibility. Below is my web service followed by my script.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Configuration;
using System.Web;
using System.Web.Services;
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using AjaxControlToolkit;
using System.Text;
using System.Xml;
using System.Xml.XPath;
using System.IO;
using System.Collections.Specialized;
using System.Web.Services.Protocols;
[WebService(Namespace = [URL])]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
[System.Web.Script.Services.ScriptService]

public class Service : System.Web.Services.WebService
{
public Service()
{
}
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public string[] AutoCompleteNames(string prefixText, int count)
{
System.Data.SqlClient.SqlConnection cxn = new System.Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings["HumanResourcesConnectionString"].ConnectionString);
cxn.Open();.....................

View 11 Replies

C# - How To Cancel A Web Service Call If It's Not Responding

Apr 8, 2010

I have a web page (.aspx) that calls a third party web service to get some data. It usually takes couple of seconds to get the response back, and then the rest of the page will load. Occasionally the call gets stuck either due to the web service is down, or internet connection, etc., the page just hang there and will not load.

My questions is:

1) Is there a way to abort/cancel the web service call after a set amount of time?

2) Is it even possible to verify the status of the web service before calling it?

View 2 Replies

Call Web Service From Another Web Application Using Jquery?

Dec 12, 2010

I have created an WCF data service in a new asp.net web application and i want to call this web service from another web application using jquery, but it always returns null.

My jquery call looks like this:

[code]....

Note that [URL] works in the browser but since the jquery call is from localhost:3410 i assume its a problem with cross domain.

I have been reading that i should use jsonp for this, but i have a hard time figuring it out.

View 2 Replies

Call A WCF Service Outside Of The Impersonation Context?

Jul 30, 2010

I'm having problems with impersonation in WCF. Namely, I'm calling a named pipe service from within ASP.NET with impersonation turned on. This fails (due to permissions on the pipe blocking anyone from the network). So, is there any way I can make the call outside of the impersonation context? I don't need to be impersonating to make this call, but can't see any way of doing this.

PS. I need to do this declaratively, through config...

View 1 Replies

How To Call WCF Http Service Behind SiteMinder

Mar 10, 2011

I am trying to call WCF 4 Http Web Services which are hosted within an ASP.NET application. The Service is protected behind SiteMinder.

I was wondering how I could programmatically call the web service, and more specifically what information will I need to pass to be authorized within SiteMinder to access my resources.

I am making the request from the ASP.NET application running on the same server, so I have access to the authentication cookie.

View 1 Replies







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