Why am I getting a Sending failed Error in AMFPHP/Flex - apache-flex

I am using remote object in flex to call a method in amfphp. I have project setup properly with a services-config.xml in d src, d end point uri pointing to the gateway.php. After testing on my localhost everything works fine but when I copied my files to a remote server repoint the uri in d servies-config and then recompiling the application gives a sending failed error. Can someone help please?

because of an error or warning on server side. php send's back to you that message, and amfphp don't know how cast it to amf format. so the problem is in your server side, that's for sure
one more thing, use zendamf, instead of amfphp, it's done by same developer and you don't need to install entire zend framework, only zendamf lib, it's small and doest the job perfectly :)

download and install charles proxy - helps you debug your application and get the exact error message from the server.

Related

an internal problem in JSON RPC and an https error ,localhost is not found

well,i work in visuel studio 2022 to developpe a website using mvc and asp.net6.0 ,but i have faced 2 main problems ,the first is i dont know how to fix the internal JSON problem,and also the https page is not found when i try to implement the project,keep in mind i use ISS express to do the implementation.
here is the screenshots of the error it giving:
json rpc error
local host error

How to troubleshoot failed API calls to .NET project running over localhost?

I have an API in a .NET project that I'm running with Visual Studio Mac (8.4.3). I run it in release mode, and it opens a browser window with localhost:5000. The browser window says "ok". However, when I try to hit endpoints in that API, it fails very quickly. When I ran this API (ie. same code) from another server and accessed it via proxy, it ran fine. For example, when I ran it on a server whose IP was 162.250.198.98 and proxied into it, I would hit an endpoint like 162.250.198.98:3000/api/user and it would work, but now when I try to run localhost:5000/api/user, either from my app or from Postman, it fails almost instantaneously. When running it in Postman, I tried what it suggested by turning off 'SSL certificate verification' in Settings, but no change.
Can anyone advise me on how to approach troubleshooting this?
Wait, so You are saying that while trying to call API on 162.250.198.98:3000/api/user You are fine but while trying to do the same thing on localhost:5000/api/user You are getting an error? Would it might be possible You have Your API configured to receive calls at 3000? :)?
No, but really - please chech it out, maybe it is that simple, I'm couting on it :).
You can change/check it in Visual Studio: main project > Properties > Debug > App URL.

gapi.auth2.ExternallyVisibleError: Invalid cookiePolicy

I'm trying to add a Google Sign In Authentication system to my app, but I keep getting a strange error that I haven't seen anyone get. I'm using EXACTLY the google example code.
I thought it could be some mistake when loading the api, so I checked the async loading and everything seems to be loading properly, but I keep getting this error in the console:
gapi.auth2.ExternallyVisibleError: Invalid cookiePolicy
I searched everywhere for people with the same problem, but I could not find anything similar.
Any ideas?
EDIT: I tried to create a page with ONLY the code of the tutorial, but the error still occurs.
Well, turns out I was trying to test the API by directly acessing my files locally (index.html). The Google Sign In API only works in a running web server. I started a simple node.js server, ran my app trhough this server, and everthing worked just fine.
As already answered by KoJoVe, you need to run inside a web server. If you are using Python 2.7 you might use python -m SimpleHTTPServer 8000 and then use localhost:8000 on your browser
I've been trying to get a chrome extension to work for a very long time, and I recently decided to click into the error. The reason is because the google platform script checks window.location.protocol (which isn't https for chrome extension) and throws the error 'invalid cookie policy'.
My theory as to why Google won't fix this:
They want to drive people into using paid OAuth2 endpoints
They want to know who received the tokens, if possible (via certificate authorities)
I was having this problem using react-google-login in a create-react-app, and I found that I was accessing the page with http://[::1]:3000/sign_in instead of localhost.
I think google does not like 127.0.0.1 or ::1 since we expose the IP directly or something
When I change to localhost:3000 and it worked.
This worked in my case with python 3:
open python terminal and write the following code:
from http.server import SimpleHTTPRequestHandler as handler
import socketserver as socket
httpd = socket.TCPServer(("",8000),handler)
httpd.serve_forever()

The page you are requesting cannot be served because of the extension configuration

Well this morning I woke up to see that my site hosted on Windows Azure was producing 50X errors and in general being incredibly slow (up to 60 seconds response time).
Now after looking through the DetailedErrors folder I see that the error received is:
HTTP Error 404.3 - Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
I tried creating a new test website and host it and guess what? I receive the exact same error here as well.
What could be causing this?
I found this for you.
There were more errors related to local machine below these errors.I looked up the net and after some digging figured out the solution to the problem:
Run Visual Studio 2008 Command Prompt as “Administrator”.
Navigate to C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation.
Run this command servicemodelreg –i.
for more info

FLEX/amfPHP ActionScript error 2048

Sorry about the mishmash of words in the title, but that's how confused I am. I can't even summarize the error I'm getting in a simple sentence.
This flex/amfphp application works fine on my computer, even though it accesses an Oracle database on another server. However, when I try to access it from another computer, this is the error I get. I'll try and put the most relevant code in. (My browser tell me this is an ActionScript error).
Fault faultString="Send failed"
faultCode="Client.Error.MessageSend"
faultDetail="Channel.Security.Error error Error #2048: Security Area Violation..
Couldn't load data from http://localhost/.../amfphp/gateway.php
As I said before, it works on my machine for some reason. Now, when I try to access this remotely from other machines, it seems that the PHP engine is looking for gateway.php on the localhost of that machine?? Does this mean that PHP is looking for gateway.php on the client's localhost rather than on the server??
Correct me if I'm wrong, and thanks in advance
Your services-config.xml in Flex propably points to http://localhost/.../amfphp/gateway.php
You'll need to change the endpoint in that XML file and recompile the application.
You could also create your ChannelSet at runtime. In that case you don't need the services-config.xml anymore. Take a look at http://raghuonflex.wordpress.com/2008/06/05/endpointatruntime/ for some inspiration...

Resources