Jump to content

Different result depending from where the webpage start.


ohrstedtl

Recommended Posts

I have a html page which give me different result depending on from where I start the page. If I start the page by clicking on the file on my local disk in Finder ( I use an iMac computer) then I will get response with data from the webservices I want to use. But if I start the html page from my domainserver, I will NOT get any data from the webservices. The html page do not start to contact the webservices at load time, I need to click i button "get exchanges"to start the process. The adress to the page on my domain is : http://diadoker.se/omvandla/soap.html. Attached is the html file itself.
I don't understand why it do not work from the server as it is the same code that is executed to access the the webservices.

soap.html

Link to comment
Share on other sites

I'm getting the same error from my computer as from your page. The reqest is returning 500 Internal Server Error and that's a problem on the other end of the line. No changes in your code would fix it.

Link to comment
Share on other sites

Hello again!

I have been thinking how you could get the result you got, as I send you the same file I get data to when using it from my local computer. I downloaded the file I uploaded to you and tested it. It gives the same result as you, no data. So I compared the two filés and they were equal. Confusing! So I used WireShark to capture the packets from the two filés, and there is a differens between how the packet looks.. I attach the captured packets so If you want to you can see how it look like.

Link to comment
Share on other sites

Hello again, I have looked at the captured packets and find that when I do not get any data, the push flagg is set in TCP, and the payload start with OPTIONS instead of POST for the packets that get data. I am very confused since the files I use for this are identical, but one get data, and the other one not.

Link to comment
Share on other sites

I have summed up my finnigs.

 

Scenario.

I have a file on my local disk, soap.html. When I open the file it will be shown in the web browser, and a button on the webpage allow it to get the exchange rates from the national bank. If I click on the button I will receive data every time into the webpage.

If I open the file within my local web server ( MAMP Pro ), the file again will be shown in the web browser. If I now click the button, no data will be received. If I copy the file to my domain server and open it from there, it will give the same result, no data received.

I sent the file to W3Schools forum for investigation, and the replay was that they did not get any data either. I downloaded my previous uploaded file ( which was a copy from my still working soap.html and called it soapcopy.html ) from W3Schools and opened it on my local disk the same way I did with my original file, and to my surprise it did not work, the same as it was for W3Schools forum.

I made a local copy of the file, and that did not work either. I made a check if the files were equal the original working one, using the command "diff -s soap.html soapcopy.html" and they were equal. Now I took the contents of the downloaded file (soapcopy.html) and created a new file with this content, and called it soapnew.html, opened it from the local disk, and it works, data is received. But if I open this new file ( soapnew.html ) with MAMP Pro ,it do not work, no data. This is the same as for the original file soap.html when it is opened from MAMP Pro.

I used now a packet analyzer ( WireShark ) to see what is sent to the server at the national bank, using the working ( soap.html ) and not working files ( soapcopy.html ), opened from local disk. There I found that every time when the soapcopy.html file was sent there was a flag ( push ) set in the TCP part of the packet, and this flag was not set in the soap.html file packets. The payload on the soapcopy.html files starts with “OPTIONS” while the payload starts with “POST” on the soap.html file packets. When I opened the file, soap.html, from the local web server ( MAMP Pro ), or I opened soap.html from my web domain, the packet have the push flag set and the payload starts with “OPTIONS”. As stated before under these condition I will not receive any data.

I cannot understand why the same code will produce so different packets depending on where the file is opened from.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...