(WCF) .svc call returning the wrong mime type (works locally, not in production) - wcf

So I've been developing an app on my dev box for a while and it's time to put it in production. My Service has a method which returns Xml.
This all works locally but when I copy the files over to the web server and try to connect to my WCS using a browser I get this message:
The content type text/html of the response message does not match the content type of the binding (text/xml; charset=utf-8).
Why does it work locally? Has my hosting provider setup something wrong? Have I messed up some config or other? Thanks in advance.

Has the production environment been properly set up?
If not, run ServiceModelReg.exe to register WCF http modules / mappings etc.
http://msdn.microsoft.com/en-us/library/ms732012.aspx
--larsw

Related

javascript was blocked due to MIME type mismatch Domino 10.0.4

After upgrading our domino server to V10.0.4 the traditional web application fails to load the scripts on page with error MIME type (text/HTML) is not executable.. Is there any notes.ini I need to include or change any server configuration
I assume that the JS files are stored in the Resources - Files section of the nsf.
Try setting the MIME type manually on each file by adding "application/javascript" as Mime Type on the Web Properties tab:
Use this NOTES.INI setting on your servers
HTTP_DISABLE_X_CONTENT_TYPE_OPTIONS_NOSNIFF=1
That came from HCL support March 2021.
Also try:
HTTPAdditionalRespHeader01=X-Content-Type-Options: sniff
Was having Javascript errors after upgrading from Domino R9.0.1FP8 to R11.0.1FP3
I applied this setting, restarted the HTTP task and everything worked again.
Browser in use was IE11
https://support.hcltechsw.com/csm?id=kb_article&sysparm_article=KB0077199&sys_kb_id=731074a71b6f8414c48197d58d4bcb2c

GeoDesic Buffers sample code does not work in my local IIS Server

I am new to use ArcGis Api for javascript, I am using JS Api 3.20.
I have been trying for 3 days but it does not work.
I have taken code from the following link
Geometry Engine - Geodesic buffers | ArcGIS API for JavaScript 3.20
I paste this in My Html file create in VS website for .Net , and setup a local server for my page using IIS server
I also downloaded proxy from GitHub resource-proxy/DotNet at master · Esri/resource-proxy · GitHub
setup it in same application in IIS
Downloaded excel file added in my application from https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_week.csv
but still I am getting the following error in console using developer mode when set Proxy URL to this
config.defaults.io.proxyUrl = "/192.168.8.188/Proxy/proxy.ashx";
GET http://192.168.8.188:1555/192.168.8.188/Proxy/proxy.ashx?http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_week.csv 404 (Not Found)
and when I set proxy url to this
config.defaults.io.proxyUrl = "/Proxy/";
then the following error occurs in console
GET http://192.168.8.188:1555/Proxy/?http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_week.csv 403 (Forbidden)
Could you please help me out. I would be thankful in advance.
I Resolved My Issue thanks.
Basically I didn't enable IIS 4.5 web features so I read readme file of proxy which resolved my issue.
Here is what I read from ReadMe file located in DotNet folder of Proxy
Troubleshooting: If you get an error message 404.3, it's possible that ASP.NET have not been set up. On Windows 8, go to "Turn Windows features on or off" -> "Internet Information Services" -> "World Wide Web Services" -> "Application Development Features" -> "ASP.NET 4.5".
First off, try setting the proxyUrl value to this:
config.defaults.io.proxyUrl = "/proxy/proxy.ashx";
That may resolve the issue.
EDIT (based on clarification that IIS is in fact running on port 1555):
You might want to confirm that you can access the proxy at all, by entering the proxy url directly in your browser (with no arguments), eg:
http://192.168.8.188:1555/Proxy/proxy.ashx
If this resolves correctly, you should get an error response in JSON format like this:
{error: {code: 400,message:"This proxy does not support empty
parameters."}}
That at least would confirm that the proxy is accessible and functioning properly on your system.

HTTP Error 404.0 - Not Found when accesing SVC service

I have REST service application which is hosted in an IIS 8 in a Windows 8 PC. When I request the service I am getting an error as follows ... HTTP Error 404.0 - Not Found.
Here is the detailed error message.
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
Most likely causes:
•The directory or file specified does not exist on the Web server.
•The URL contains a typographical error.
•A custom filter or module, such as URLScan, restricts access to the file.
Things you can try:
•Create the content on the Web server.
•Review the browser URL.
•Create a tracing rule to track failed requests for this HTTP status code and see which module is calling SetStatus. For more information about creating a tracing rule for failed requests, click here.
Detailed Error Information:
Module IIS Web Core
Notification MapRequestHandler
Handler StaticFile
Error Code 0x80070002
Requested URL http://IP.com/Wining/RService.svc/general
Physical Path C:\inetpub\wwwroot\Wining\RService.svc\general
Logon Method Anonymous
Logon User Anonymous
Any help on this would be greatly appreciated.
There are myriads of possible causes. In general, the target resource at given URL is not found, so it may be simply missing, misconfigured, not started, etc. First - check the server logs, they usually contain more detailed information about the issue.
Also, please doublecheck that the service really is up and running. Connect to the www server and check it via localhost not ip.com.
I'm not an expert, but judging from the snippet you provided, it seems to be WCF service, the Handler: StaticFile seems very odd. It seems like the IIS misinterpretes your request as a StaticFile (a resource read from the disks and just passed-through without any further processing) which for me seems perfectly wrong.
You may have not installed the service properly, or have url mappings and/or handlers messed up, or you may even have NET/ASP framework not properly installed.. What have you installed first? .Net or IIS?
check similar questios, there are many.. for example:
WCF on IIS8; *.svc handler mapping doesn't work
HTTP 404 when accessing .svc file in IIS
I had to enable HTTP Activation in .NET Framework 4.5 Advanced Services > WCF Services (running on WIndows 2012) and after an IISReset it worked fine.

WCF message: protocol in To element changes

I have a WCF service to consume in .NET. As per requirement the Action element in the header has to be "http://abc" and the To element has to be "ws://xyz" in order for the service to recognize and respond to the request. The soapAction of the operation is however blank in WSDL and it can't be changed.
My service configuration built programmatically is this:
text message encoding binding with Soap11 envelope version and WSAddressing10 addressing version
no security biding
http transport binding
The setup I found achieving this requirement is "ws://xyz" as the endpoint URL and Request.Headers.Action set to "http://abc" in BeforeSendRequest using a message inspector added using an endpoint behaviour attached to the endpoint. Then I also attach a ClientViaBehavior with the URL of "http://abc".
On my development machine this causes as required
<a:Action>http://abc</a:Action>
<a:To>ws://xyz</a:To>
However on the test server it generates
<a:Action>http://abc</a:Action>
<a:To>http://xyz</a:To>
I don't know exact configuration of the server but I believe it is Windows server as is my development box. Does the same code generates different messages on two different machines or how else would I achieve this? I should also say it worked fine for several weeks and stopped last Monday.
I have found the following later:
The test server has .NET 4.5 on it as well as another machine I tried it on (also failed). The dev machine where it works fine has just .NET 4.0 on it which would suggest it could have something to do with it. However I have no evidence it is caused by .NET 4.5 as it was installed several weeks before the problem appeared. Moreover there have been no Windows updates since it stopped to work!
I've also tried to set the To element in my ClientMessageInspector implementation but the protocol still gets flipped to http.
I think the BeforeSendRequest is not called due miss configration of your service bindings. Check if you have added the the extention configuration to you service endpoints you want to have the behavior.

Deploying wcf with silverlight application?

I am trying to deploy a Silverlight application on a remote server. I've copied over the files within App.Web which includes the .svc file. I created a virtual directory within IIS 6.0 and am able to successfully host the silverlight portion.
BUT... now I am getting an error:
The type 'ServiceGateway', provided as the Service attribute value in the ServiceHost directive could not be found.
I've tried restarting IIS, verified that the ISAPI mapping for .svc extension is showing in IIS.
It seems to me that the service is not getting started.
Thoughts?
Missing a type sounds like it either wasn't compiled properly or the reference doesn't exist on the server. What version of .NET is installed on the server? It should be at least 3.0.
It looks like the service isn't getting started because you're missing the ServiceGateway type. You may be missing the entire assembly it's meant to be in.