Autocomplete with jquery json. Internal server error 500? - c#

Autocomplete with jquery json with c#:
The program works on local but not works on server.Why?
[WebMethod]
public List<string> GetAutoCompleteData(string prefixText)
{
...
here is the error:
Internal server error 500
and also this error:
Server Error in '/' Application.
Unknown web method GetAutoCompleteData. Parameter name: methodName
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Unknown web method
GetAutoCompleteData. Parameter name: methodName
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentException: Unknown web method GetAutoCompleteData. Parameter
name: methodName]
System.Web.Script.Services.WebServiceData.GetMethodData(String
methodName) +539974
System.Web.Script.Services.RestHandler.CreateHandler(WebServiceData
webServiceData, String methodName) +10
System.Web.Script.Services.RestHandler.CreateHandler(HttpContext
context) +159
System.Web.Script.Services.RestHandlerFactory.GetHandler(HttpContext
context, String requestType, String url, String pathTranslated) +62
System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext
context, String requestType, String url, String pathTranslated) +47
System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execut
e()
+334 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184
Version Information: Microsoft .NET Framework Version:4.0.30319;
ASP.NET Version:4.0.30319.272

Ok, now we are getting somewhere.
If I understand this correctly, you have implemented a webmethod within your asp.net website in an asmx file (something that we are also doing in one of our products as well). In order for this to work properly in IIS (works fine in development environment), you will need to configure your IIS to allow .asmx pages (add a handler mapping). You can do this directly in the IIS config, or in your web.config.
Here is another question for reference:
ASMX service works on development server, returns 404 when deployed to IIS 7.5
Disregard bounty thing. Different question :)

Related

ParseExceptions not getting thrown for CallFunctionAsync

I recently updated my client sdk to parse 1.6.2 for xamarin, and I noticed that ParseExceptions are no longer getting thrown properly.
When calling something like this:
string result = await ParseCloud.CallFunctionAsync<string>( "function" )
If that function calls response.error I get:
System.Net.WebException The remote server returned an error: (400) Bad Request.
Raw
at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x0005e] in /Users/builder/data/lanes/2377/73229919/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net/HttpWebRequest.cs:944
Where as in the pass it would generate a ParseException with the contents of the response.error. The WebException also does not have an inner exception to inspect.
I also thought it had something to do with my cloud code, but I find a similar problem with user login. A bad password generates this exception now:
System.Net.WebException The remote server returned an error: (404) Not Found.
Raw
at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x0005e] in /Users/builder/data/lanes/2377/73229919/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/System/System.Net/HttpWebRequest.cs:944
A few other things were upgraded when I updated the parse sdk. I'm now using xamarin forms 2.* instead of 1.5.* and I think the mono system libraries were also updated.

WCF REST SOAP web service - unauthorized error

I get this error. I have WCF REST SOAP web service thats supposed to fetch data from sharepoint list using sharepoint API and output it in json format. it works well on test server but not on iis production server.
System.Data.Services.Client.DataServiceQueryException: An error occurred while p
rocessing this request. ---> System.Data.Services.Client.DataServiceClientExcept
ion: Unauthorized
at System.Data.Services.Client.QueryResult.ExecuteQuery(DataServiceContext co
ntext)
at System.Data.Services.Client.DataServiceRequest.Execute[TElement](DataServi
ceContext context, QueryComponents queryComponents)
--- End of inner exception stack trace ---
at System.Data.Services.Client.DataServiceRequest.Execute[TElement](DataServi
ceContext context, QueryComponents queryComponents)
at System.Data.Services.Client.DataServiceQuery`1.Execute()
at System.Data.Services.Client.DataServiceQuery1.GetEnumerator()
at WCF_SOAP_REST_Service.Service.MapColumnValues_Events(IEnumerable1 items,
String language)
how to fix it?

Asp.net MVC IIS Failed to Execute URL

Hello I'm using CKFinder on CKEditor in an asp.net mvc 5 web application. The problem to be only remote server, no problem in local server. When I select add image on CKEditor and click browse server, my url is //Scripts/ckfinder/ckfinder.html?type=Images&CKEditor=Text&CKEditorFuncNum=1&langCode=tr. Because of mvc do not allow direct link that is ckfinder.html IIS give error. The error is: System.Web.HttpException: Failed to Execute URL. How to fix error?
Description:
An unhandled exception occurred during the execution of the current
web request. Please review the stack trace for more information about
the error and where it originated in the code.
Exception Details:
System.Web.HttpException: Failed to Execute URL.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): Failed to Execute URL.]
System.Web.Hosting.ISAPIWorkerRequestInProcForIIS6.BeginExecuteUrl(String url, String method, String childHeaders, Boolean sendHeaders, Boolean addUserIndo, IntPtr token, String name, String authType, Byte[] entity, AsyncCallback cb, Object state) +2582829
System.Web.HttpResponse.BeginExecuteUrlForEntireResponse(String pathOverride, NameValueCollection requestHeaders, AsyncCallback cb, Object state) +412
System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state) +192
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +301
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
The error 0x80004005 seems to be permissions problem. Change IIS "pipeline mode" from "classic" to "integrated"

How Can I Extend the maximum file size to upload and send (via email) files while using jquery.MultiFile.js

I'm using a plugin from jquery to use a multiple file upload to create a program that sends e-mails..
Check the source
http://www.fyneworks.com/jquery/multiple-file-upload/
I downloaded it here, and I have not modified it yet...
I've noticed that you cannot upload more than 10MB in total, however, you're not allowed to send a single file that is over 4MB...
I have already been told that it's OK that you can't send over 10MB in files, but my boss just tried to send a pdf file that is 4.11MB, and it doesn't send it....
I tried it to send it via Visual Studio (that way I can debug it and see where the problem is... apparentely, once I have attached the file and click on SEND EMAIL... the program doesnt acces the page load nor the button, it just states that connection has been reset...
If you try to send (not using Visual Studio, but from the internet)... it sends this error
Maximum request length exceeded.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Maximum request length exceeded.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): Maximum request length exceeded.]
System.Web.HttpRequest.GetEntireRawContent() +9037851
System.Web.HttpRequest.GetMultipartContent() +68
System.Web.HttpRequest.FillInFormCollection() +247
System.Web.HttpRequest.get_Form() +104
System.Web.HttpRequest.get_HasForm() +9038959
System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +97
System.Web.UI.Page.DeterminePostBackMode() +69
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +135
I have already check the jquery files, but I can't seem to find anything that could resolve the problem.
Do you know where can the problem be? and how do I fix that issue?
Modify the web.config settings of httpRuntime element like below
<httpRuntime maxRequestLength="4096" />
The value is in KB. By default it is 4 MB.

Configuring web services on Windows Server 2003

We have recently moved from an online hosting provider to a local server and we are currently trying to set up a .net website with web services and are having difficulties.
We have two websites running on IIS (in Windows Server 2003) - one that is the actual website where we gain input from the user and one which is running the web services where we talk to the database / deal with logic etc...
At the moment we can display the main website page but as soon as it accesses the web services it receives the following 404 error:
The request failed with HTTP status 404: Not Found.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.WebException: The request failed with HTTP status 404: Not Found.
Source Error:
Line 1120: >[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:58605/Dev_GetVersion", RequestNamespace="http://localhost:58605", ResponseNamespace="http://localhost:58605", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
Line 1121: public string Dev_GetVersion() {
Line 1122: object[] results = this.Invoke("Dev_GetVersion", new object[0]);
Line 1123: return ((string)(results[0]));
Line 1124: }
Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\b0534295\1f56ee4c\App_WebReferences.mjxicnrr.0.cs Line: 1122
Stack Trace:
[WebException: The request failed with HTTP status 404: Not Found.]
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +431289
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +204
IPASWebServices.AccountManagementServices.Dev_GetVersion() in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\b0534295\1f56ee4c\App_WebReferences.mjxicnrr.0.cs:1122
MasterPage.displayVersionDetails() in c:\www_ipas\MasterPage.master.cs:46
MasterPage.Page_Load(Object sender, EventArgs e) in c:\www_ipas\MasterPage.master.cs:28
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082
I see it's trying to access the web server and then the method ("http://localhost:58605/Dev_GetVersion") but it is leaving out the actual web service name. (It should be "http://localhost:58605/AccountManagementServices.asmx?op=Dev_GetVersion").
Any idea why it does this? It works perfectly fine on the online web hosting and on the development computer, just not in this new environment.
Make sure the App is running as an account that has the proper rights in IIS. If unsure, make sure the account the app is running as is in the IIS_WPG group.
Here is more details on properly setting up the IIS App Pool Identity: http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/12a3d96c-65ea-4210-96ad-86a801f6a88c.mspx?mfr=true

Categories

Resources