AJAX :: 401 Error When Calling Web Service Internally While Debugging?
Jun 21, 2010
If I call my web service directly it works, however, when I try to call it from another controller on the same project I get a 401 exception. Below is the code I use to call the WS, and it is being run in VS not IIS.
i got a this exception when i calling my web service in producction server.i already test the web service in server side and this don't have problemasbut when i calling the web service in the development site this throw a
(spanish)"Error de la solicitud con el código de estado HTTP 417: Expectation failed." or (english)"The request failed with status code HTTP 417: Expectation failed."
When I am trying to call a service hosted in Java through .net I am encountering the below error
"WSE839: An HTTP response was received that used the following content type: text/xml; charset=utf-8. The following content type was expected: multipart/related; type=application/xop+xml."
I am trying to call a service from a silverlight application, but I am getting the following error.
Uncaught Error: Unhandled Error in Silverlight Application An exception occurred during the operation, making the result invalid. Check InnerException for exception details.
This works fine locally. I don't know if it make any sense, but locally if I add the url of the webservice on a browser, I am getting the details page of the service. In the other hand, on production server, it prompts me to download it.
public MainPage() { InitializeComponent(); Loaded += new System.Windows.RoutedEventHandler(MainPage_Loaded); }
I created an AutocompleteExtender web service. I am getting a Object reference not set error in the peice of the code where I am referring to System.Web.HttpContext.Current.Session. Does anyone know why this is. And I am checking to see if it is != null before I reference it. But it crashes. Is there another way to pass another parameter to the web service?
I have wcf web service, I works fine on my local machine,but when I move it to live then it throws following error
System.Security.SecurityException: Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.
I have an AJAX auto complete extender that calls a web service to generate a string[] for a textbox. Works great, The issue I am having is that I set the OnClientItemSelected property of the auto complete extender to call a JavaScript function that will intern call another web service to get the remaining data I need based on the item that was selected. (I need this because the auto complete web service only allows for key/value pairs and I need to return 10 columns of data) I cannot get the JS function to call the web service. I keep getting "(Namespace) is undefined" as a JS error. I tried to impliment Microsoft's example located at: [URL] but even if I copy there code line for line in a new project, I still encounter the same error.
Samples.AspNet.WebService.Add(a, b,SucceededCallback); //'Samples' is undefined - runtime If I remove the namespace so that it reads: Add(a, b,SucceededCallback); //Endless loop until you get stack overflow error Has anyone got MS C# example to work? I saw a lot of people had this line missing in the web service, but I already had it. [System.Web.Script.Services.ScriptService]
I am new to Ajax and i wanted to use the CascadingDropDown to get rid of the postbacks. But somethings wrong and when i debug i am not running any code from the Web Service for some strange reason.
I have one asp.net application, in which i am using "Calling WCF Service Operations in AJAX" method. I finished my work without the service hosting in IIS. I got the correct solution. But now, i have another requirement in which i am using the WCF service which is hosted on local host iis. But in clicking the button i got one javascript error like object expected. I don't know why this happened? My code is shown below.
<fieldset style="width: 804px" align="center"> <legend>Consuming WCF Service using Client-Side AJAX</legend> <div align="left" style="text-align: center"> <form id="form1" runat="server">
I am trying to call an asmx service using the jQuery ajax call-
[Code]....
I have double checked the url of the service and spelling/case of the name of the method as well as the parameters in the dataStr.
I still get the error-<b> Description: </b>HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. review the following URL and make sure that it is spelled correctly.
I am using AjaxControltoolKit.dll(3.0) with VS2008 C# application.Any webform having AjaxControltoolKit tools like ModalPopUp,AutoCompelte,etc.Gives Following error on Debugging:""
web service method(getMainHeads) with parameter is not calling with auto complete text box extender(same method with out parameter is calling fine). My Service is
[System.Web.Script.Services. ScriptService] public class InvService : System.Web.Services.WebService { ItemMainHeadMsts objItemMainHeadMsts; DatabaseHelper objDataHelper; [WebMethod] public string[] GetMainHeads(string value) { List<string> oList = new List<string >(); objItemMainHeadMsts = new ItemMainHeadMsts (); objDataHelper = new DatabaseHelper (); objItemMainHeadMsts = ItemMainHeadMstBase.SelectByFieldAuto("IMHDesc" , value); foreach (ItemMainHeadMst mainHead in objItemMainHeadMsts) { oList.Add(mainHead.IMHDesc); } return oList.ToArray();..........................
In IIS I have a virtual directory with only windows authentication enabled. From Javascript I call into a ASMX webservice. From the ASMX webservice I make a call to the SharePoint Search.asmx Webservice. whatever I try I keep getting the followin gerror message:
"The request failed with HTTP status 401: Unauthorized"
I use the following code to call the SharePoint webservice
[Code]....
My web.config settings are:
[Code]....
The Sharepoint farm is configured to use NTLM authentication.
Strangely everything works when I am testing in Visual Studio using the builtin webservice, but when I deply to my local IIS or Test Server it breaks.
I'm using a custom AJAX based validation control to check user name availability from database. It's working alright in my development machine but in production server we are using Windows Authentication to authenticate by domain.The control is inherited from base validator and checks for user name availability from database perfectly but on form submission at Page.IsValid check it gives the following error.
remote server returned an error 401 unauthorized
Both the form and webmethod are in the same page/file. I even tried creating webmethod in a separate standalone webservice but error still there.
ERROR MESSAGE:When visiting this URL directly: http://localhost:57667/ExampleService.svc/ProcessRequest
The exception message is 'No component for key example.ExternalWebServiceStubs.Example.ExampleService was found'. Castle.MicroKernel.DefaultKernel.get_Item(String key) at Castle.Facilities.WcfIntegration.WindsorInstanceProvider.GetInstance
I'm finishing up my first web service. It stores data on a dataset that I later need to check up on, so I need to keep that information around. I've already enabled the session in the web service's method "EnableSession = true" [WebMethod(Description = "Receives status requests, as well as status udpates.", EnableSession = true)]
If I debug the web service everything works but if I try to use the application that sends the requests to the web service while it is published, the session keeps restarting again and again and again.
I recently upgraded from VS2005 to VS2008. I did a full install of VS2008, then opened my existing project in it. This launched the conversion wizard which successfully converted my VS2005 project to VS2008 and it opened in VS2008 owever, when I first tried to build the solution in VS2008, I got an error on a page defining a web service saying
I have the following problem with a slideshow in Ajax. Hope I have put it in the right Ajax forum. Some info: I do use MS Access and in the 'autos table' i do have the following fields:
field 1: nummer (text field) - this is the name of the image field 2: cat (integer) - this is the category of the cars field 3: naam (text field) - this is the name of the car field 4: model (text field - this is the model of the car
In my masterpage i do have a menu where you can make the choice of a certain category of cars. This is done by a call to: slideshow.aspx?cat=100 In Slideshow.aspx a panel is setup and also buttons to manipulate the found images. Also the AjaxToolkit:Slideshowextender is defined as follows:
<ajaxToolkit:SlideShowExtender ID="SlideShowExtender1" runat="server" TargetControlID="Image1" SlideShowServicePath="slideservice.asmx" SlideShowServiceMethod="Getslides" AutoPlay="true" ImageTitleLabelID="Name" ImageDescriptionLabelID="Desc" NextButtonID="NextButton" PlayButtonID="PlayButton" PlayButtonText="Play" StopButtonText="Stop" PreviousButtonID="PrevButton" PlayInterval="4000" Loop="true" ContextKey="catid" /> As you can see the contactkey is also defined. Inside the codebehind of slideshow.aspx.vb their is a sub defined: Partial Class Slideshow Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load SlideShowExtender1.ContextKey = Request.QueryString("catid") End Sub End Class The call from slideshow.aspx is to a slideservice.asmx which contains: <%@ WebService Language="VB" CodeBehind="~/App_Code/SlideService.vb" %> Here we call slideservice.vb. The coding of the slideservice.vb file is: Imports System.Web Imports System.Web.Services Imports System.Web.Services.Protocols Imports System.Data.OleDb Imports System.Web.UI.Page <WebService(Namespace:="http://vancouver.com/")> _ <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _ <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ <System.Web.Script.Services.ScriptService()> _ Public Class SlideService Inherits System.Web.Services.WebService <WebMethod()> _ Public Function GetSlides(ByVal contextKey As String) As AjaxControlToolkit.Slide() Dim strconn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|Vancouver.mdb" Dim cn As New OleDbConnection(strconn) Dim SQLStr As String SQLStr = "SELECT nummer, naam, model FROM Autos WHERE ((Autos.cat) = @catid)" Try cn.Open() Dim cmd As New OleDbCommand(SQLStr, cn) Dim sCatid As String = "" ' Give the value to sCatid from contextkey If sCatid.Trim().Length = 0 Then sCatid = contextKey cmd.Parameters.AddWithValue("@catid", sCatid) Dim thisReader As OleDbDataReader = cmd.ExecuteReader() Dim photoCounter As Integer While thisReader.Read() photoCounter = photoCounter + 1 End While If (photoCounter > 0) Then 'we now know how many pictures there are in this category of the database Dim MySlides(photoCounter - 1) As AjaxControlToolkit.Slide 'set up the command string Dim photoLookupCmd As New OleDbCommand(SQLStr, cn) 'and add the parameters to it for the category photoLookupCmd.Parameters.AddWithValue("@catid", sCatid) thisReader = photoLookupCmd.ExecuteReader() Dim i As Integer For i = 0 To photoCounter - 1 thisReader.Read() Dim number As String = thisReader.GetString(0) Dim name As String = thisReader.GetString(1) + " - " + thisReader.GetString(2) MySlides(i) = New AjaxControlToolkit.Slide(("pictures" + number + ".jpg"), name, "") Next thisReader.Close() Return MySlides Else Dim MySlides(0) As AjaxControlToolkit.Slide MySlides(0) = New AjaxControlToolkit.Slide("pictures99999.jpg", "sorry - not available", "pls. mail us to report") thisReader.Close() Return MySlides End If Catch x As Exception Dim MySlides(0) As AjaxControlToolkit.Slide MySlides(0) = New AjaxControlToolkit.Slide("pictures99999.jpg", "Exception error", "pls. mail us to report") Return MySlides Finally cn.Close() End Try End Function End Class
When i run the code i will get an exception error and when following the code in debug mode i do see that inside the first loop in FOR i = 0 to photocounter - 1 : The first loop gets the right info from the database inside Myslide(1) fields. Going into the second loop i will get after dim name as string .....
the program goes to catch x as exception. I did see that number was found correctly during the previuous line. During an other debug session i noticed that the Parameter.item has the following error (which I do not understand), saying: Overload resolution failed because no accessible 'Item´ accepts this number of arguments.
I am new to Silverlight. In Silverlight, we can get data from server using ASP.Net (using WebClient and HTTPWebRequest classes in Silverlight) and using WCF Service.
Assuming that I do not need the cross domain capability, what is a good option in terms of Security and ease of development?
I am in the process of implementing jQuery calling WCF service which is hosted in the same domain. My application uses Win Auth that works fine with ASP.NET app. I would like to know from the team if the user calls the WCF service from the ASP.NET what is the security context in which the service runs? Or it uses the web.config security which is specified? Are there any links related to this where i can get some information.
ASP.NET 4.0, jQuery and WCF 4.0 in same web application
[ServiceContract] public interface IService1 { [OperationContract] string GetData(int value); // TODO: Add your service operations here } public class Service1 : IService1 { public string GetData(int value) { return string.Format("You entered: {0}", value); } }
the following call is working
protected void Button1_Click(object sender, EventArgs e) { ServiceReference1.Service1Client p = new ServiceReference1.Service1Client(); Label1.Text= p.GetData(5); }
but when I am trying to call it from jquery its not working
I am developing application for PDA. The Sql Server compact edition is installed on PDA. The data is stored on PDA's DB as well as the Server Database through wifi.
If the server is available,the data will be stored through web service, If not available ,the data should be inserted when the server is connected to the data.
which is better to transfer data whether the web service or windows service?
If web service means, how could i transfer the data to server database?
I have almost the same problem as you have described in [URL] service. I have a asp.net webservice that calls a WCF service. On my development machine this is working fine. But if i deploy my ASP.net Webservice it is not working. Both the ASP Webservice en WCF service needs my cridentials. How did you solved your problem. In the logging of the WCF service I see that my credentials is not passing to WCF.