I am wanting to POST some data from Arduino to WebService (written in .NET), intending to save some temperature data to MS SQL Server.
My code in arduino is:
void PostarDados(String dados, String chamador) {
if (client.connect("mysite.com.br",80)) {
client.println(chamador);
client.println(F("Host: mysite.com.br"));
client.println(F("Content-Type: application/x-www-form-urlencoded"));
client.print(F("Content-Length: "));
client.println(dados.length());
client.println();
client.println(dados);
}
if (client.connected()) client.stop();
}
When sending to Serial instead of client, I am obtaining the following text:
POST /webservice.asmx/SetValoresTempUmidade HTTP/1.1
Host: mysite.com.br
Content-Type: application/x-www-form-urlencoded
Content-Length: 39
Chave=1&Temperatura=23.30&Umidade=42.20
I have enabled HTTP POST in web.config to make HTTP POST possible (I can successfully invoke webservice from browser):
<location path="Webservice.asmx">
<system.web>
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
</system.web>
</location>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="Content-Type" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
I have also set ScriptMethod to my webservice functions:
<WebMethod()> <ScriptMethod(ResponseFormat:=ResponseFormat.Json, UseHttpGet:=True)>
Public Sub SetValoresTempUmidade(Chave As Integer, ByVal Temperatura As Double, ByVal Umidade As Double)
Dim ctx As New DataClassesDataContext
Try
Dim A As New TBL_DADO
A.CHAVE_INICIO = Chave
A.DATA = Now
A.TEMPERATURA = Temperatura
A.UMIDADE = Umidade
ctx.TBL_DADOs.InsertOnSubmit(A)
ctx.SubmitChanges()
Catch ex As Exception
End Try
End Sub
Finally, I am trying to get some response from server using the following code (not receiving anything):
while (client.connected()) {
while (client.available()) {
buffer[counter++] = client.read();
}
}
Explained that, I have two questions:
What am I doing wrong?
How could I debug this?
Using
byte server[] = {XX, XX, XX, XX}; //IP
if (client.connect(server,80)) {
instead of
if (client.connect("mysite.com.br",80)) {
worked
I was searching for a working HTTP and HTTPS example for my Arduino project [Wemos mini pro] I've created a project and I would like it to share hoping that it will help others. Also I used others example for the completion so the credit is theirs and not mine.
Regards,
drpacmanhu
https://github.com/drpacmanhu/DVR-image-uploader
Related
Windows Server DataCenter 2019
Python 3.7.6
I have 2 sites configured on IIS.
mysite1 port 9090: Runs using VSCode and entering URL in browser
Runs from VSCode
Enter URL in Browser: ###.###.###.###:9090
mysite2 port 9566: Only runs from VSCode
Runs from VScode.
ERROR 500. Enter URL in Browser: ###.###.###.###:9566
Also from IIS Manager menu option: Browse *:9566
HTTP Error 500.0 - Internal Server Error
C:\inetpub\wwwroot\Flask\mysite2\venv\Scripts\python.exe - The FastCGI process exited unexpectedly
Detailed Error Information:
Module
FastCgiModule
Notification
ExecuteRequestHandler
Handler
Python FastCGI
Error Code
0x00000067
Requested URL
http://localhost:9566/
Physical Path
C:\inetpub\wwwroot\Flask\mysite2
Logon Method
Anonymous
Logon User
Anonymous
The 2 sites are configured with different AppPools
2 web.config files
<configuration>
<system.webServer>
<handlers>
<remove name="FlaskHandler" />
<add name="Python FastCGI" path="*" verb="*" modules="FastCgiModule" scriptProcessor="C:\inetpub\wwwroot\Flask\mysite1\venv\Scripts\python.exe|C:\inetpub\wwwroot\Flask\mysite1\venv\lib\site-packages\wfastcgi.py" resourceType="Unspecified" requireAccess="Script" />
</handlers>
</system.webServer>
<appSettings>
<add key="WSGI_HANDLER" value="app.app" /> <!-- {name_of_file}.{name_of_flask_app}-->
<add key="PYTHONPATH" value="C:\inetpub\wwwroot\Flask\mysite1" />
<add key="WSGI_LOG" value="C:\inetpub\wwwroot\Flask\mysite1\app.log" />
</appSettings>
</configuration>
<configuration>
<system.webServer>
<handlers>
<remove name="FlaskHandler" />
<add name="Python FastCGI" path="*" verb="*" modules="FastCgiModule" scriptProcessor="C:\inetpub\wwwroot\Flask\mysite2\venv\Scripts\python.exe|C:\inetpub\wwwroot\Flask\mysite2\venv\lib\site-packages\wfastcgi.py" resourceType="Unspecified" requireAccess="Script" />
</handlers>
</system.webServer>
<appSettings>
<add key="WSGI_HANDLER" value="app.app" /> <!-- {name_of_file}.{name_of_flask_app}-->
<add key="PYTHONPATH" value="C:\inetpub\wwwroot\Flask\mysite2" />
<add key="WSGI_LOG" value="C:\inetpub\wwwroot\Flask\mysite1\app.log" />
</appSettings>
</configuration>
The same steps were used to create mysite1 and mysite2.
In IIS manager, I stopped mysite1 but mysite2 does not run using entering URL in a browser.
Help is appreciated 1
More Debugging
I turned on Failed Request Tracing
https://learn.microsoft.com/en-us/iis/troubleshoot/using-failed-request-tracing/troubleshooting-failed-requests-using-tracing-in-iis
These are the Error and Warning traced log messags
94. FASTCGI_UNEXPECTED_EXIT
Error
95. SET_RESPONSE_ERROR_DESCRIPTION 22:01:34.515
Warning
ErrorDescription="C:\inetpub\wwwroot\Flask\mysite2\venv\Scripts\python.exe - The FastCGI process exited unexpectedly" 22:01:34.515
96. MODULE_SET_RESPONSE_ERROR_STATUS
Warning
ModuleName="FastCgiModule", Notification="EXECUTE_REQUEST_HANDLER", HttpStatus="500", HttpReason="Internal Server Error", HttpSubStatus="0", ErrorCode="The semaphore cannot be set again.
(0x67)", ConfigExceptionInfo=""
Debug Post: Python flask app on IIS not working on Windows Server 2019
I do not understand what running wfastcgi.py does but both mysite1 and mysite2 behave the same way.
The "working" site, runs and does not end
C:\inetpub\wwwroot\Flask\RESTAPI_mysite1\venv\Scripts\python.exe C:\inetpub\wwwroot\Flask\mysite1\venv\lib\site-packages\wfastcgi.py
The "non-working" site, runs and does not end
C:\inetpub\wwwroot\Flask\RESTAPI_mysite2\venv\Scripts\python.exe C:\inetpub\wwwroot\Flask\mysite2\venv\lib\site-packages\wfastcgi.py
Debug Post: Getting 500 Internal Server Error when setting up Python and Flask with FastCgiModule on Windows
The suggestions did not work for mysite2.
Help is appreciated 2
It is strange about the application pool. Maybe some special settings of site1 app pool are unknow. Even you create a new pool manually, those settings arenot configured in new pool.
Try to use appcmd to copy the site1 pool to new pool.(Stop site1 pool firstly)
Run command line as administrator.
CD C:\Windows\System32\inetsrv
appcmd.exe list apppool "site1 pool name" /config /xml > D:\AppPoolConfig.xml
appcmd.exe add apppool /name:new pool name /in < D:\AppPoolConfig.xml
Then start the new pool in IIS Manager. Make site2 work on it.
I managed to create a web service with self signed SSL through IIS. It's settings at first are set to Client Certificate to none and none required SSL. It is accessible by that time threw web browser and mobile web reference.
Web Browser
Xamarin Web Reference
But when I set the SSL settings to required, it is now forbidden in both. What am I missing in settings for SSL Configuration?
SSL Settings Thru IIS
Web Browser Forbidden Access
Xamarin Web Reference Forbidden Access
WebConfig
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrings>
<add name="constring" providerName="System.Data.SqlClient" connectionString="Data Source = source;Initial Catalog = dbname; User ID = user; Password = pw" />
</connectionStrings>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation targetFramework="4.5" />
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding maxReceivedMessageSize="10485760" name="SecureHttpBinding">
<readerQuotas maxStringContentLength="10485760"></readerQuotas>
<security mode="Transport">
<transport clientCredentialType="None"></transport>
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
</configuration>
To access web service via HTTPS in web browser, I followed this link for creating temporary client certificate but I changed the step #5 to this command
makecert -sk MyKeyName -iv RootCaClientTest.pvk -n "CN=tempClientcert" -ic RootCaClientTest.cer -sr localmachine -ss my -sky exchange -pe
I changed the currentuser to localmachine and signature to exchange so that it will be in personal certificate store. When you access the site again, it will ask for client certificate and you can choose it to proceed.
For the main problem to access the service in visual studio xamarin via web reference (which is forbidden somehow).
I found this link to solve the forbidden problem. You can see the second post of (c)MarkoOkram for the solution.
"I am solved problem by saving web browser .wsdl and .xsd files on file system, change reference in those files to matching files. Than i succesfully add reference in visual studio to that file system .wsdl file." -(c) MarkoOkram
I downloaded the file WSDL and XSDs written in WSDL then retarget the filepath to their respective directories and it's done.
update: I also tried to import singleWSDL and it works without editing for xsd's
Dears,
I have the following web service from client to call:
http://ajec.proxym-it.net/Ajec_sso_api/authenticate.wsdl
When I try to consume it, I got the this error :
The remote server returned an unexpected response: (502) Connection refused.
The inner exception is: {"The remote server returned an error: (502) Bad Gateway."}
Here is my code:
AuthenticateService.AuthenticatePortClient oAuthenticatePortClient = new AuthenticateService.AuthenticatePortClient();
AuthenticateService.authenticateRequest oauthenticateRequest = new AuthenticateService.authenticateRequest();
oauthenticateRequest.serviceId = "MobileTeam";
oauthenticateRequest.serviceKey = "AJEC1";
oauthenticateRequest.userName = "MMelhem";
oauthenticateRequest.password = "P#$$w0rd";
AuthenticateService.authenticateResponse oregisterUserResponse = oAuthenticatePortClient.authenticate(oauthenticateRequest);
and the web.config is:
<configuration>
<system.net>
<defaultProxy>
<proxy usesystemdefault="False" bypassonlocal="False" />
</defaultProxy>
</system.net>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="AuthenticatePortSoap11" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://172.16.0.82:80/Ajec_sso_api/authenticate"
binding="basicHttpBinding" bindingConfiguration="AuthenticatePortSoap11"
contract="AuthenticateService.AuthenticatePort" name="AuthenticatePortSoap11" />
</client>
</system.serviceModel>
</configuration>
What tool did you use to generate your client code (or hand-coded it)?
I used wsimport and I got slightly different code than yours. Since the IP seems to be in local domain (172.16.0.82), I couldn't test it. If you are interested, you could try it.
I used wsimport to generate/compile client class files:
wsimport -keep http://ajec.proxym-it.net/Ajec_sso_api/authenticate.wsdl
Then coded the client like this:
import com.ajec_sso.authenticate.*;
public class TClient {
static AuthenticatePortService service = new AuthenticatePortService();
public static void main(String[] args) {
try {
AuthenticatePort port = service.getAuthenticatePortSoap11();
AuthenticateRequest req = new AuthenticateRequest();
AuthenticateResponse res = new AuthenticateResponse();
req.setServiceId("MobileTeam");
req.setServiceKey("AJEC1");
req.setUserName("MMelhem");
req.setPassword("P#$$w0rd");
res = port.authenticate(req);
} catch(Exception e) {
e.printStackTrace();
}
}
}
Compiled like this (the generated com directory is in current directory).
javac TClient.java
I solved the problem by replace the endpoint address from
http://172.16.0.82:80/Ajec_sso_api/authenticate
to
http://ajec.proxym-it.net/Ajec_sso_api/authenticate
Running ColdFusion 9,0,1,274733 on JRun (J2EE install), Windows Server 2008 R2, Java 1.6.0_22
Has anyone else had a problem getting the default document, index.cfm, to work with ColdFusion? I'm assuming that this is only an issue because of our setup; different web server (IIS) and application server (ColdFusion). I can't imagine we are the only ones running this configuration. Are we?
So here is the issue.
If we request http://mysite.com/index.cfm it works.
If we request http://mysite.com/ it does not work and we get a 404.
I checked the web connector's log file on our IIS server and can see that it is sending the request to our ColdFusion server. The ColdFusion server is sending back the 404 error code but I can't figure out why. We have the default document set on our IIS server for index.cfm. We also have the <welcome-file-list> set to include index.cfm on our application server (web.xml).
From our web connector's log when we do NOT include index.cfm:
2012-11-01 13:37:22 jrISAPI[4544:3600] ***HttpExtensionProc for JRun ISAPI Extension: uri is "/test/"
2012-11-01 13:37:22 jrISAPI[4544:3600] HTTP_HOST: servername
2012-11-01 13:37:22 jrISAPI[4544:3600] filtering /test/ (/test/) HOST=servername
2012-11-01 13:37:22 jrISAPI[4544:3600] filterRequest: no match
2012-11-01 13:37:22 jrISAPI[4544:3600] ExecUrl: request received: URL=/test/
2012-11-01 13:37:22 jrISAPI[4544:3600] ExecUrl Completion: 404, ErrorCode=2, URL=/test/.
From our web connector's log when we do include index.cfm:
2012-11-01 13:49:02 jrISAPI[9936:3600] ***HttpExtensionProc for JRun ISAPI Extension: uri is "/test/index.cfm"
2012-11-01 13:49:02 jrISAPI[9936:3600] HTTP_HOST: servername
2012-11-01 13:49:02 jrISAPI[9936:3600] filtering /test/index.cfm (/test/index.cfm) HOST=servername
2012-11-01 13:49:02 jrISAPI[9936:3600] filterRequest: matched *.cfm
2012-11-01 13:49:02 jrISAPI[9936:3600] ***IISWorkerThreadProc for JRun ISAPI Extension: uri is "/test/index.cfm"
2012-11-01 13:49:02 jrISAPI[9936:3600] ALL_RAW: Connection: Keep-Alive
Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, application (553)
2012-11-01 13:49:02 jrISAPI[9936:3600] Headers and Values:
... and much more ...
We have gotten around this issue by using the URL Rewrite module in IIS to append index.cfm to the URL. It works but my gut keeps telling me that we should not need to do that for such basic functionality.
Is anyone else having this issue? How have you gotten around this?
EDIT adding some more info
Here is my site's web.config file contents from the IIS server:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="JWildCardHandler" path="*" verb="*" modules="IsapiModule" scriptProcessor="D:\JRun4\lib\wsconfig\1\jrun_iis6_wildcard.dll" resourceType="Unspecified" requireAccess="None" />
<add name="hbmxmlHandler" path="*.hbmxml" verb="*" modules="IsapiModule" scriptProcessor="D:\JRun4\lib\wsconfig\jrun_iis6.dll" resourceType="Either" responseBufferLimit="0" />
<add name="cfswfHandler" path="*.cfswf" verb="*" modules="IsapiModule" scriptProcessor="D:\JRun4\lib\wsconfig\jrun_iis6.dll" resourceType="Either" responseBufferLimit="0" />
<add name="cfrHandler" path="*.cfr" verb="*" modules="IsapiModule" scriptProcessor="D:\JRun4\lib\wsconfig\jrun_iis6.dll" resourceType="Either" responseBufferLimit="0" />
<add name="cfcHandler" path="*.cfc" verb="*" modules="IsapiModule" scriptProcessor="D:\JRun4\lib\wsconfig\jrun_iis6.dll" resourceType="Either" responseBufferLimit="0" />
<add name="cfmlHandler" path="*.cfml" verb="*" modules="IsapiModule" scriptProcessor="D:\JRun4\lib\wsconfig\jrun_iis6.dll" resourceType="Either" responseBufferLimit="0" />
<add name="cfmHandler" path="*.cfm" verb="*" modules="IsapiModule" scriptProcessor="D:\JRun4\lib\wsconfig\jrun_iis6.dll" resourceType="Either" responseBufferLimit="0" />
<add name="jwsHandler" path="*.jws" verb="*" modules="IsapiModule" scriptProcessor="D:\JRun4\lib\wsconfig\jrun_iis6.dll" resourceType="Either" responseBufferLimit="0" />
<add name="jspHandler" path="*.jsp" verb="*" modules="IsapiModule" scriptProcessor="D:\JRun4\lib\wsconfig\jrun_iis6.dll" resourceType="Either" responseBufferLimit="0" />
</handlers>
<defaultDocument>
<files>
<add value="index.cfm" />
</files>
</defaultDocument>
<staticContent>
<mimeMap fileExtension=".air" mimeType="application/vnd.adobe.air-application-installer-package zip" />
</staticContent>
</system.webServer>
</configuration>
Here is some of the file contents from the APP server web.xml:
<welcome-file-list id="WelcomeFileList_1034546870672">
<welcome-file>index.cfm</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
</welcome-file-list>
Within IIS Manager try adding a default document of "index.cfm" for your website.
I also posted this question on the Adobe forums and it has gained more traction over there. You can read all of the details here.
It seems like the main issue I was having is that IIS was not passing '/index.cfm' to the web connector once it had determined that ColdFusion had no mapping for '/'. This began working after I created a blank (empty) index.cfm file on the web server. I do not recall having to place the CFM files on the web server when using distributed mode in the past. Can anyone confirm or deny that the CFM files need to reside on both servers for this to work (without using rewrite rules anyway)?
I'm a bit late to the party on this one, but I've been working on a system where I need to switch between CF8 & CF10 on the same dev server pretty frequently so I've been working on a batch file to run wsconfig to save myself some effort and I ran into the same issue. CF working fine but never processing index.cfm for / - as above, all the mappings appeared to be set up correctly.
I found that wsconfig works much more reliably if you add each site my name rather than using "-site 0"
So, for example, to manually remove and reinstall the connectors for two sites running on IIS
set CFUSION_HOME=C:\ColdFusion10\cfusion
%CFUSION_HOME%\runtime\bin\wsconfig -uninstall
net start "ColdFusion 10 Application Server"
%CFUSION_HOME%\runtime\bin\wsconfig -ws IIS -site "Default Web Site"
%CFUSION_HOME%\runtime\bin\wsconfig -ws IIS -site "My Website Name"
I had the same problem after upgrading CF from 2016 to 2018 / 2021. The solution is this: open IIS Manager and go to Handler Mappings. Here, search for cfcHandler, cfmHandler, cfmlHandler entries and right click, edit them and you will probably see something like this: C:\ColdFusion2021\config\wsconfig\1\isapi_redirect.dll
Make sure the path is updated to the current version of the ColdFusion server. In my case it was still trying to access ColdFusion2016 folder even if I updated to 2021.
This solved the problem for me.
I'm attempting to gzip a JSON response from an ASMX web service to be consumed on the client-side by jQuery.
My web.config already has httpCompression set like so: (I'm using IIS 7)
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files"
staticCompressionDisableCpuUsage="90" staticCompressionEnableCpuUsage="60"
dynamicCompressionDisableCpuUsage="80" dynamicCompressionEnableCpuUsage="50">
<dynamicTypes>
<add mimeType="application/javascript" enabled="true"/>
<add mimeType="application/x-javascript" enabled="true"/>
<add mimeType="text/css" enabled="true"/>
<add mimeType="video/x-flv" enabled="true"/>
<add mimeType="application/x-shockwave-flash" enabled="true"/>
<add mimeType="text/javascript" enabled="true"/>
<add mimeType="text/*" enabled="true"/>
<add mimeType="application/json; charset=utf-8" enabled="true"/>
</dynamicTypes>
<staticTypes>
<add mimeType="application/javascript" enabled="true"/>
<add mimeType="application/x-javascript" enabled="true"/>
<add mimeType="text/css" enabled="true"/>
<add mimeType="video/x-flv" enabled="true"/>
<add mimeType="application/x-shockwave-flash" enabled="true"/>
<add mimeType="text/javascript" enabled="true"/>
<add mimeType="text/*" enabled="true"/>
</staticTypes>
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll"/>
</httpCompression>
<urlCompression doDynamicCompression="true" doStaticCompression="true"/>
Through fiddler I can see that normal aspx and other compressions work fine. However, the jQuery ajax request and response work as they should, only nothing gets compressed.
What am I missing?
You can change httpCompression only in applicationHost.config.
See this link
Like you, I tried changing it in web.config first, but it didn't work. It worked only when I added the following lines to C:\Windows\System32\inetsrv\config\applicationHost.config:
<dynamicTypes>
...
<add mimeType="application/json" enabled="true" />
<add mimeType="application/json; charset=utf-8" enabled="true" />
...
</dynamicTypes>
DO USE NOTEPAD to edit applicationHost.config. I've wasted several hours before understood that my changes made in notepad++ (as well as in Visual Studio 2010 editor!!) aren't applied by IIS.
Alternative way to add additional mimeType into dynamicTypes/staticTypes collection is to use appcmd. "C:\Windows\System32\Inetsrv\Appcmd.exe" set config -section:system.webServer/httpCompression /+"dynamicTypes.[mimeType='application/javascript',enabled='True']" /commit:apphost
And again: after these changes made - you'll see them only in notepad. Notepad++ (as well as Visual Studio 2010 editor!!) maintains some kind of f*ing alternate reality/storage for applicationHost.config. It shows you his own version of the file (different from the one you see in notepad) even after the file edited in notepad and reopened in np++/VS.
Eric P's answer is mostly correct... you need to EXACTLY match the Content-Type header sent by IIS in its HTTP Response Headers. For some reason our IIS7 server was responding with:
Content-Type: application/json; q=0.5
I had never ever observed a quality factor in a server response before. How bizarre.
When we added this to the dynamicTypes in the .config file everything started working:
<dynamicTypes>
...
<add mimeType="application/json" enabled="true" />
<add mimeType="application/json; q=0.5" enabled="true" />
<add mimeType="application/json; charset=utf-8" enabled="true" />
<add mimeType="application/json; q=0.5; charset=utf-8" enabled="true" />
...
</dynamicTypes>
Changes in web.config don't work because of the following line in applicationHost.config:
<section name="httpCompression" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
If you replace it by:
<section name="httpCompression" overrideModeDefault="Allow" />
the changes are possible locally.
I think this is more convenient as you are able to configure every service differently and you don't have to edit your applicationHost.config if you must add a new MIME type.
Here is an example how to activate compression in web.config on a single ASMX service located in the service subfolder:
<location path="service/MySpecificWebService.asmx">
<system.webServer>
<httpCompression>
<dynamicTypes>
<add mimeType="application/json" enabled="true" />
<add mimeType="application/json; charset=utf-8" enabled="true" />
</dynamicTypes>
</httpCompression>
<urlCompression doDynamicCompression="true" />
</system.webServer>
</location>
Concerning the actual editing of applicationHost.config, I suspect that it is not a true file in the file system. If you copy that file on your desktop, you will be able to edit it with any text editor, then copy it back to its original folder.
http://forums.iis.net/t/1160210.aspx?missing+applicationhost+config
The config file is supposed to be %windir%\system32\inetsrv\config\applicationhost.config.
(Note that if your application (which is searching for applicationhost.config) is a 32bit app (for example, if you're using a 32bit CMD.EXE), then you won't be able to see the configuration file due to Windows SYSWOW32 redirection)
A bit of explanation regarding the missing applicationhost.config to change overrideModeDefault attribute to Allow. It's due to SYSWOW32 redirection.
Also you may not see the configuration files until you
Open the folder by pasting "%windir%\system32\inetsrv\config\" exactly in the File Explorer location bar, and not your text editor
Right-click and edit the file directly in that folder.
This is because for some reason some 64bit editors still use a faulty file-chooser dialog somehow.