Error HTTP/1.1 500 Internal Server Error with Indy FireDac DataSnap XE7

*I made a server application that calling the methods by browse, everything works perfect,*
*but to test my methods build a client using TdHTTP it and call the methods as follows:*

procedure TF_CLIENTE.SBEnviar2Click(Sender: TObject);
var Url        : String;
    lJSO       : String;
    jsonToSend : TStringStream;
begin
 
  Url := 'http://localhost:809...ecomandoPOST/';
 
  lJSO                                    := ('{"name":"TESTE"}');
  jsonToSend                          := TStringStream.Create(lJSO,TEncoding.UTF8);
 
  idHttp.ProxyParams.Clear;
  idHttp.ProxyParams.BasicAuthentication  := false;
  idHttp.Request.BasicAuthentication         := True;
  idHttp.Request.Accept                            := 'text/javascript';
  IdHTTP.Request.ContentType                   := 'application/json';
  IdHTTP.Request.ContentEncoding            := 'utf-8';
  idHttp.Request.Method                           := 'POST';
  IdHTTP.Request.BasicAuthentication        := True;
  IdHTTP.Request.Authentication                 := TIdBasicAuthentication.Create;
  IdHttp.Request.Authentication.Username  := 'MYUSER';
  IdHttp.Request.Authentication.password  := 'MYPASSWORD';
  IdHttp.Request.ContentLength            := Length(lJSO);
  try
    Memo1.Text := idHttp.Post(Url,jsonToSend);
  except
    on E : Exception do
      begin
        Memo1.Lines.Add('Exception class name = '+E.ClassName);
        Memo1.Lines.Add('Exception message = '+E.Message);
      end;
  end;
 
end;


*Have I released the ->  Dispatch:*
 
procedure TF_WebModule.WebModuleBeforeDispatch(Sender: TObject;
  Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
begin
  Response.SetCustomHeader('access-control-allow-origin','*');
  Response.SetCustomHeader('access-control-allow-Methods','PUT, POST, GET, DELETE');
  Response.SetCustomHeader('access-control-allow-Headers','accept, authorization, origin');
  if FServerFunctionInvokerAction <> nil then
  FServerFunctionInvokerAction.Enabled := AllowServerFunctionInvoker;
end;


*Have Validei the User and comes to just right of indy authentication:*
 
procedure TF_WebModule.DSAuthenticationManager1UserAuthenticate(Sender: TObject;
  const Protocol, Context, User, Password: string; var valid: Boolean;
  UserRoles: TStrings);
begin
 
  if Request.Method = 'OPTIONS' then
    valid := False
  else
    if ((User = 'MYUSER') and (Password = 'MYPASSWORD')) then
      valid := True
    else
      valid := False;

end;

*Report Error:*

Exception class name = EIdHTTPProtocolException
Exception message = HTTP/1.1 500 Internal Server Error

*help me please!!!!*
0
aparecido
2/15/2015 4:00:28 PM
embarcadero.delphi.firedac 822 articles. 2 followers. Follow

1 Replies
2775 Views

Similar Articles

[PageSpeed] 53

This is not FireDAC question. Please post it to DataSnap forum.

-- 
With best regards,
Dmitry Arefiev / FireDAC Architect
1
Dmitry
2/16/2015 6:32:32 AM
Reply:

Similar Artilces:

HTTP/1.1 500 Error
I am getting the above error, with the message "Server not available."  I have a hunch that the problem can be traced to a patch I installed this month.  The patch (SP2DBFix1.1.1.mxp) was supposed to correct an interaction problem between Dreamweaver and Asp.Net.History:  Everything in Visual Studio worked just fine last semester, when I took the Asp.Net class.  Now, none of the Asp.Net applications work, although the VB.Net apps in my Visual Studio still work as expected.  Help, please!Dee Start by finding the real error:http://www.aspfaq.com/show.asp?id=2109JeffP...

Start up Error: HTTP/1.1 500 Internal server Error
When I attempt to create a new project or open an existing one, I recieve the following error.  "The Web server reported the following error when attempting to create or open the Web project located at the following URL: 'http://localhost/PROJECTNAME'.  'HTTP/1.1 500 Internal server Error'. Now I have a fix for this, but it requires me to have to do it everytime I reboot my computer.  It's kind of a lengthy process and I've looked just about everywhere for perm. fixes for this error but have come up empty.  I've had just about enough of d...

Start up error: HTTP/1.1 500 Server Error
I recieved the following error when trying to create a program'The web server reported the following error when attempting to create or the open the Web project located at the following URL: http://localhost/asptest 'HTTP/1.1 500 Server Error'here are the event viewer errors:Event Type: ErrorEvent Source: DCOMEvent Category: NoneEvent ID: 10004Date:  10/27/2008Time:  2:05:36 PMUser:  N/AComputer: LNOxxxxCFD2YDescription:DCOM got error "Logon failure: the user has not been granted the requested logon type at this computer...

Got an Error HTTP/1.1 500 Server Error
Hi is there anybody can help me with my problem in asp.net... coz everytime i open .net and create new asp files i got an error of "The Web server reported the following error when attempting to create or open the web project located at the following URL: 'http://pc03/localhost/MyWeb/Application'.'HTTP/1.1 500 Server Error'. thanks... pilots Have you turned off Friendly Errors in Tools | Internet Options | Advanced. Usually this is the problem. Corey...

Server error running asp.net 'HTTP/1.1 500 Server Error'
. can anyone help? First, is this ASP.NET or ASP Classic, there is a difference and ASP.NET wouldn't normally use the IWAM account.  The answer to your issue is usually this: http://support.microsoft.com/kb/276407 JeffPlease: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue. this is ASP.Net, trying to create projects in VS 2003.  I recieve that error. PLEASE HELP VS is uesless to me unless I get this issue fixed!! Hi, It seems that there are two versions of ASP.NET to ...

HTTP/1.1 500 Internal Server Error???
hi! when i tried to open an existed project file,it said "HTTP/1.1 500 Internal Server Error" how to resolve it??? i am anxious you are saying project file, are you using Visual Studio? can you please post the code from file you are getting error? thanksfeed the creative machine...

http/1.1 500 Internal Server Error
Hi, I am getting the following error when I try to open/create an existing/new project (web appln) in VS.NET. It reads: " The web server reported the following error when attempting to create or open the web project located at the following URL:http://localhost/Test/WebApplication1. HTTP/1.1 500 Internal Server Error " Can any one please help me to get rid of this. Thanks n have a nice day ! Raj. ...

HTTP/1.1 500 Internal Server Error
After scouring forums, I'm still totally baffled about what causes the HTTP/1.1 500 Internal Server Error: "The Web server reported the following error when attempting to create or open the Web project located at the following URL: 'http://localhost/DotNetNuke'. I've tried the following without success: iisreset /stop net user ASPNET /delete aspnet_regiis -i iisreset /start And I've given ASPNET full control over the virtual directory. Plus I've reinstalled XP Pro (!), IIS and the DNN 2.1.2 zip. Nothing works. Could the 500.htm error be a clue? What exactly i...

HTTP/1.1 500 Internal Server Error
Hi I am unable to run any .net web application. IIS is running locally and it gives following error: Server Application Unavailable The web application you are attempting to access on this web server is currently unavailable.  Please hit the "Refresh" button in your web browser to retry your request. Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur MS VS.Net 2003 also unalbe to open any application and gives...

http/1.1 500 internal server error
Hi, i have the next problem: When i try to create a new web application in Visual Studio.Net 2003 i have the next error: "http/1.1 500 internal server error" I have Windows Server 2003. I have deleted the aspnet count and execute aspnet_regiis -i but the problem still. Can anybody help me. Thanls...

HTTP/1.1 500 Internal Server Error #2
Hi all, whenever iam submitting a form, iam changing the values of the button controls, the values may be numeric,hexadecimal ,empty or null . after sending the modified one to server iam getting this HTTP/1.1 500 Internal Server Error how can we avoid this error. also give me a solution how can we block the user to change values of controls during form submit or postback- Suria Prakash,Software DeveloperD'zine Garage Pvt. LtdChennai,TN,India. The first thing you need to do is to get the real error message.  Go into IE -> Tools -> Internet Options -> Advanced, a...

HTTP/1.1 500 Internal Server Error #3
What I did: gave all permissions to virtual folder into IIS and to aspnet user into sql server I also verified that there are 2 versions of Framework installed: v1.0.3705 and v1.1.4322, so I read and run too: aspnet_regiis -i for v1 but error still remains thanks for any help Ivan Thank you friends, I've solved trouble just restarting WS after doing described above :)...

Help! HTTP/1.1 500 Internal Server Error
Hi, I am getting the following error when I try to open/create an existing/new project (web appln) in VS.NET. It reads: " The web server reported the following error when attempting to create or open the web project located at the following URL:http://localhost/Test/WebApplication1. HTTP/1.1 500 Internal Server Error " Can any one please help me to get rid of this. Thanks n have a nice day ! Hi, I had the same problem. Try in your browser http://localhost/ - you should be redirected to http://localhost/localstart.asp. If this displays an error too, ma...

HTTP/1.1 500 internal server error #2
I keep receiving the error "HTTP: 1.1 500 internal server error" message when attempting to create a new project on my company intranet. I have no problems connecting http://localhost and I can connect to the default website, but I receive "Web Acess failed" and the I have to choose "Try opening project with frontpage extensions" for it to work. My intranet is a separate website from the default website running on port 90, so when connecting I am attempting to connect by entering http://servername:90/appname I am running a w2k server with SP4 (IIS 5.) Visual ...

Web resources about - Error HTTP/1.1 500 Internal Server Error with Indy FireDac DataSnap XE7 - embarcadero.delphi.firedac

Empire of Japan (internal politics 1914–1944) - Wikipedia, the free encyclopedia
Since the Meiji period, Japan had been a nominal constitutional monarchy , but the name did not obscure the fact that Japan’s form of government ...

Self-harm in detention centres at epidemic levels, internal documents show
Asylum seekers have swallowed insect repellent, bashed their heads on walls and doused their bodies with boiling water in a culture of self-harm ...

Asylum seekers: Self-harm in detention centres at epidemic levels, internal documents show
A culture of self-harm in Australian detention centres suggests the problem appears to have reached crisis point.

How the 'Hokey Pokey' Makes a Good Internal Branding Process
... in turn, your head, backside and finally your "whole self." Now take the common "Hokey Pokey" as a simple metaphor for building your internal ...

US Attorneys General say Volkswagen has refused to turn over internal documents
The automaker is citing German privacy laws as justification for not cooperating.

Rahm Emanuel: Dangerous Internal Enemy Of Our Country
I've been on Rahm-watch since 2005 and I can't imagine there's any chance he'd resign as mayor of Chicago unless it was part of a plea deal to ...

Bernanke: Don't Worry, China's $28 Trillion Debt is an "Internal Problem"
$28 Trillion "Internal Problem" The blue ribbon award for ridiculous comment of the day goes to Ben Bernanke who dismissed China's $28 trillion ...

Newark Police Department Internal Affairs Head To Be Civilian Lawyer « CBS New York
There are some big changes on the way to the Newark Police Department.

Internal charges for officer in Garner chokehold death
NYPD says supervising sergeant at the scene of Eric Garner's death on Staten Island in July 2014 is charged with failure to supervise

Internal police records point to the identity of the officer who fatally shot Bettie Jones and Quintonio ...
The mother of five and the distraught teenager were shot and killed by police officer Robert Rialmo, according to a Reader analysis of internal ...

Resources last updated: 1/21/2016 4:22:12 PM