PDA

View Full Version : Trying to test an application in WordPress



Mark D Eppley
12-Jun-2017, 04:53 PM
Hello all

I have a customer who has a WordPress site and wanted to test possibly on creating an online application to be embedded. I have created a test application

http://vdf.horizon-is.com/HorizonHumanResourcesOnline190/

I have added the Access-Control items, copy of web.config below

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="http://wordpress-86011-273987.cloudwaysapps.com" />
<add name="Access-Control-Allow-Headers" value="content-type" />
<add name="Access-Control-Allow-Methods" value="GET,POST" />
<add name="Access-Control-Allow-Credentials" value="true" />
</customHeaders>
</httpProtocol>
<handlers>
<clear />
<add name="OPTIONSVerbHandler" path="*" verb="OPTIONS" type="" modules="ProtocolSupportModule" scriptProcessor="" resourceType="Unspecified" requireAccess="None" allowPathInfo="false" preCondition="" responseBufferLimit="4194304" />
<add name="DataFlex 19.0 Web Services 64bit" path="*.wso" verb="GET,POST" type="" modules="IsapiModule" scriptProcessor="C:\Program Files (x86)\DataFlex 19.0\Bin64\waswsvc.dll" resourceType="Unspecified" requireAccess="Script" allowPathInfo="false" preCondition="bitness64" responseBufferLimit="4194304" />
<add name="DataFlex 19.0 Web Services 32bit" path="*.wso" verb="GET,POST" type="" modules="IsapiModule" scriptProcessor="C:\Program Files (x86)\DataFlex 19.0\Bin\waswsvc.dll" resourceType="Unspecified" requireAccess="Script" allowPathInfo="false" preCondition="bitness32" responseBufferLimit="4194304" />
</configuration>


I get an error that the application cannot communicate with the server.

I have a screenshot of the possible problem

11004

Any help would be much appreciated

Thanks
Mark

Mike Peat
13-Jun-2017, 04:39 AM
Mark - I am on customer site today, but I'll try to look at it tomorrow, if that is OK.

Mike

Mike Peat
13-Jun-2017, 08:07 AM
Mark

Just to be clear, that web.config file is from your app's AppHTML directory, right? Because it appears from your little screen-shot that your server is not responding with Access-Control-Allow-Headers: "content-type", but the web.config looks right.

Mike

Mark D Eppley
14-Jun-2017, 08:47 AM
Hi Mike

That is correct. The web.config is in the AppHTML folder on the webapp server. That is what is confusing me, seems like I have everything setup ok. I have attached a screenshot of the actual error in the browser.11010

Thanks
Mark

Mike Peat
14-Jun-2017, 12:12 PM
Mark

Just checking, your URL for the app appears to be on 207.255.7.108, while the address mentioned in your screen-shot (ec2-54-159-58-118.compute-1.amazonaws.com) resolves to 54.159.58.118. Could that be to do with it? What happens if you have the WordPress site try to load from vdf.horizon-is.com instead?

Mike

Mark D Eppley
14-Jun-2017, 09:29 PM
Mike

I tried from vdf.horizon-is.com first, then setup a AWS server thinking it had something to do with my server. But both produced the same results.

Mark

Mike Peat
15-Jun-2017, 02:31 AM
Hmm... baffled! :-(

Mark D Eppley
15-Jun-2017, 08:46 AM
I know, me to. I will let you know if I figure anything out

Mark D Eppley
15-Jun-2017, 10:37 AM
Mike

It is very strange

I added just some other headers to see if the response was there
I added "This-is-a-special-header" and "Access-Control-Allow-Header" Without the "s" and they both are returned. The Access-Control-Allow-Headers does not return.

11011

Mike Peat
16-Jun-2017, 08:07 AM
Mark

I keep coming back and looking at/thinking about this... The CORS mechanism is browser-controlled, so perhaps we should pay close attention to what it said in the screen-shot in your initial post: Request header field Content-Type is not allowed by Access-Control-Allow-Headers. "Content-Type", not "content-type". Now there is no way, IMO, that this should be case sensitive, but... :rolleyes:

Mike

Mark D Eppley
16-Jun-2017, 08:47 AM
Mike

I saw that as well. I tried Content-Type and content-type and Content-type,content-type:)

Quite the mystery
Mark

Mark D Eppley
16-Jun-2017, 09:52 AM
Mike

Well......I deleted the application, reinstalled and BAM - it worked!!!

Thanks for hanging out with me on this one

Mark

Mike Peat
16-Jun-2017, 10:16 AM
Ha, ha, ha, ha! What was it I wonder? Guess we'll never know! :)

And you are welcome, for all that I was no use at all!

Well done - hope it all goes well.

Mike