The communication object cannot be used because it is in the faulted state

Mar 7, 2013 at 7:51 AM
Hi,

After pressing connect I get the following error "The communication object. System.ServiceModel.Channels.ServiceChannel, cannot be used because it is in the faulted state.

The service URL test is successful in the connection manager and I do have a working model with the right permissions.

Kind regards,

M
Coordinator
Mar 10, 2013 at 7:33 AM
Edited Mar 10, 2013 at 7:40 AM
Hi M
are you using the latest beta version (2012) ? (are you on SQL2008R2 or on SQL2012 ?)
Mar 11, 2013 at 8:20 AM
Hi,

I downloaded the 21 Feb 2013 release. The error happens when running the build on ..\bin\Debug. For some reason I cannot debug or build the project in Visual Studio, looks as if the start up object is set incorrectly.

Kind regards,

M
Mar 11, 2013 at 8:28 AM
Hi,

I downloaded the 21 Feb 2013 release. The error happens when running the build on ..\bin\Debug. For some reason I cannot debug or build the project in Visual Studio, looks as if the start up object is set incorrectly.

Kind regards,

M
Coordinator
Mar 12, 2013 at 6:15 PM
Hi M
did you try to run the app as administrator ?
Mar 13, 2013 at 8:28 AM
Hi,

It does not make a difference. Whether I've run it as administrator or not, I always end up with the same error.

Kind regards,

M
Coordinator
May 13, 2013 at 5:38 PM
Hi M
I've uploaded a new build
Could you try to go in Connection manager and test your MDS url please ?
May 14, 2013 at 8:40 AM
Edited May 14, 2013 at 8:41 AM
Hi Xavier,

Still throws the same error. It throws an unhandled exception on the following line of code of the MDSWrapper class (MDSWrapper.cs) of the GetMetadata method.

Metadata metadata2 = client.MetadataGet(new International(), ResultOptions, SearchCriteria, out or)

The full exception is:

System.ServiceModel.ProtocolException occurred
HResult=-2146233087
Message=Content Type application/soap+xml; charset=utf-8 was not supported by service http://localhost:8888/Service/Service.svc. The client and service bindings may be mismatched.
Source=mscorlib
StackTrace:
Server stack trace: 
   at System.ServiceModel.Security.IssuanceTokenProviderBase`1.DoNegotiation(TimeSpan timeout)
   at System.ServiceModel.Security.SspiNegotiationTokenProvider.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Security.CommunicationObjectSecurityTokenProvider.Open(TimeSpan timeout)
   at System.ServiceModel.Security.SymmetricSecurityProtocol.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.SecurityChannelFactory`1.ClientSecurityChannel`1.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.DoOperation(SecuritySessionOperation operation, EndpointAddress target, Uri via, SecurityToken currentToken, TimeSpan timeout)
   at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.GetTokenCore(TimeSpan timeout)
   at System.IdentityModel.Selectors.SecurityTokenProvider.GetToken(TimeSpan timeout)
   at System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecuritySessionChannel.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
   at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Common.ServiceReference1.IService.MetadataGet(MetadataGetRequest request)
   at Common.ServiceReference1.ServiceClient.Common.ServiceReference1.IService.MetadataGet(MetadataGetRequest request) in C:\MdsManager2012\MdsManager2012\Common\Service References\ServiceReference1\Reference.cs:line 23516
   at Common.ServiceReference1.ServiceClient.MetadataGet(International International, MetadataResultOptions ResultOptions, MetadataSearchCriteria SearchCriteria, OperationResult& OperationResult) in C:\MdsManager2012\MdsManager2012\Common\Service References\ServiceReference1\Reference.cs:line 23524
   at Common.MDSWrapper.GetMetaData(ServiceClient client, International intl, OperationResult& or, Identifier ModelId, Identifier VersionId, Identifier EntityId, MDAction mdAction) in C:\MdsManager2012\MdsManager2012\Common\MDSWrapper.cs:line 527
InnerException: System.Net.WebException
   HResult=-2146233079
   Message=The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'application/soap+msbin1'..
   Source=System
   StackTrace:
        at System.Net.HttpWebRequest.GetResponse()
        at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
   InnerException: 
Kind regards,

M
Coordinator
May 14, 2013 at 10:16 AM
Hi M
I saw a similar problem on stackoverflow
Which kind of binding did you use ?
did you try to access http://localhost:8888/Service/Service.svc from your browser ? what does it display ?
could youalso please check the answer on http://stackoverflow.com/questions/5243929/wcf-service-client-the-content-type-text-html-charset-utf-8-of-the-response-me
thank you
Xavier
May 14, 2013 at 10:40 AM
Hi,

The URL works fine through the browser, either directly or using the Test button on the Connection Manager.

This is the bindings section from my local config file:

<bindings>
<wsHttpBinding>
<binding name="mdsWsHttpBinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxDepth="2147483647" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647"/>
<!--Non-SSL implementations.-->

<security mode="Message">
<message clientCredentialType="Windows" />

</security>
<!--SSL implementations-->
<!--<security mode="Transport">-->
<!--<message clientCredentialType="Windows" />-->
<!--</security>-->
</binding>
</wsHttpBinding>
<basicHttpBinding>
<binding name="mdsBasicHttpBinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxDepth="2147483647"
maxNameTableCharCount="2147483647" maxStringContentLength="2147483647" />
<!-- Non-SSL implementations.-->
<security mode="TransportCredentialOnly" >
<transport clientCredentialType="Windows"/>
</security>
<!-- SSL implementations -->
<!--<security mode="Transport">-->
<!--<transport clientCredentialType="Windows" />-->
<!--</security>-->
</binding>
</basicHttpBinding>
<customBinding>
<binding name="mdsWsHttpCustomBinding" openTimeout="00:50:00" receiveTimeout="00:50:00" sendTimeout="00:50:00">
<security >
<localClientSettings maxClockSkew="6:00:00" />
<localServiceSettings maxClockSkew="6:00:00" />
<secureConversationBootstrap>
<localClientSettings maxClockSkew="6:00:00" />
<localServiceSettings maxClockSkew="6:00:00" />
</secureConversationBootstrap>
</security>
<binaryMessageEncoding maxSessionSize="2147483647" maxReadPoolSize="2147483647" maxWritePoolSize="2147483647">
<readerQuotas maxDepth="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" maxStringContentLength="2147483647"/>
</binaryMessageEncoding>
<httpTransport maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" />
</binding>
</customBinding>

</bindings>

Kind regards,

Modesto


Coordinator
May 14, 2013 at 1:24 PM
Edited May 14, 2013 at 1:26 PM
Hi Modesto
I was able to reproduce the issue :
in mdsManager2012: click on ConnectionManager
then for binding type : instead of "WSHttpBinding" I 've selected "BasicHttpBinding" then save/update then close connectionmanager settings window
then click on connect :
--> error : (in french) Le serveur distant a retourné une erreur : (415) Cannot process the message because the content type 'text/xml; charset=utf-8' was not the expected type 'application/soap+xml; charset=utf-8'.."}
so ,
in ConnectionManager, what is your binding type : is it "WSHttpBinding" ?
Image
if not, could you try with WSHttpBinding please ?
(select "WSHttpBinding" then save/update then close connectionmanager settings window)
May 15, 2013 at 7:50 AM
Hi Xavier,


I am really scratching my head with this.

Inline image 1

Inline image 2

Kind regards,

Modesto


Developer
May 23, 2013 at 8:09 PM
movega wrote:
Hi Xavier, It is WSHttpBinding but gives the same problem with BasicHttpBinding. Just came across a couple of other links: http://stackoverflow.com/questions/8250251/wcf-content-type-text-xml-charset-utf-8-was-not-supported-by-service and http://stackoverflow.com/questions/15559056/content-type-application-soapxml-charset-utf-8-was-not-supported-by-service. I am really scratching my head with this. Kind regards, Modesto
Hello Modesto,

I working on the project as well. I have checked-in a new version of the code.
Please let me know if you are still facing the issue.
May 24, 2013 at 8:47 AM
I have tested this build on a machine different from the one I used to report the problem and it works fine. I will text on the machine where I first encountered the problem on Tuesday.

Thanks for your help;

Modesto