Home > SharePoint - TroubleShoothing > The content type text/html; charset=utf-8 of the response message does not match the content type of the binding

The content type text/html; charset=utf-8 of the response message does not match the content type of the binding


Olá! Smile

Cenário:

Desenvolver para SharePoint 2010 usando Visual Studio 2010 é infinitamente melhor e mais produtivo do que desenvolver para SharePoint 2007 usando Visual Studio 2008.

Mas, como a vida dá voltas, me deparo com o cenário vivido por muito tempo. E tempo esse sensacional entendendo a estrutura do SharePoint.

Eis que ao montar um novo ambiente de desenvolvimento para SharePoint 2007, usando o Visual Studio eXtensions for Windows SharePoint Services (VSeWSS) 3.0, me deparo com um erro ao tentar montar um pacote .wsp “Package” ou tentar montar fazer um deploy no servidor.

ERRO:

Error: System.ServiceModel.ProtocolException System.ServiceModel.ProtocolException: The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: ‘<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>IIS 7.0 Detailed Error – 500.0 – Internal Server Error</title> <style type="text/css"> <!– body{margin:0;font-size:.7em;font-family:Verdana,Arial,Helvetica,sans-serif;background:#CBE1EF;} code{margin:0;color:#006600;font-size:1.1em;font-weight:bold;} .config_source code{font-size:.8em;color:#000000;} pre{margin:0;font-size:1.4em;word-wrap:break-word;} ul,ol{margin:10px 0 10px 40px;} ul.first,ol.first{margin-top:5px;} fieldset{padding:0 15px 10px 15px;} .summary-container fieldset{padding-bottom:5px;margin-top:4px;} legend.no-expand-all{padding:2px 15px 4px 10px;margin:0 0 0 -12px;} legend{color:#333333;padding:4px 15px 4px 10px;margin:4px 0 8px -12px;_margin-top:0px; border-top:1px solid #EDEDED;border-left:1px solid #EDEDED;border-right:1px solid #969696; border-bottom:1px solid #969696;background:#E7ECF0;font-weight:bold;f’. —> System.Net.WebException: The remote server returned an error: (500) Internal Server Error. at System.Net.HttpWebRequest.GetResponse().

SOLUÇÃO:

Para resolver o problema precisamos nos certificar que o Windows Communication Foundation HTTP Activation esteja ativado no servidor.

Para isso, vamos aos passos:

Abra o Server Manager > Features > Add Features:

clip_image002

No seletor de features marque a opção HTTP Activation, em .Net Framework Features > WCF Activation:

clip_image004

Clique em Next e Install para instalar a feature. Feito isso, o deploy irá funcionar.

 

—— Generate solution file and setup batch file ——

Creating solution …

Operation completed successfully.

Creating setup batch file …

Operation completed successfully.

—— Packaged successfully to C:\Projects\Sebrae\DoneIT.Sebrae.PortfolioWeb\bin\Debug\DoneIT.Sebrae.PortfolioWeb.wsp ——

========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========

========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========

 

Abraço!

Advertisements
  1. Gabriel Nóvoa
    March 6, 2012 at 14:01

    Bem familiar esse problema…

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: