Given a wsdl file from my client I used "Add Service Reference" in Visual Studio 2010 to use the service. This imported the service and created endpoint and custom binding in my app.config . My problem is that I cannot get any result from the service.
I cannot determine if it is a binding issue or wsdl file has some problem. I know that SOAP 1.1 was used in service. The only thing I can do is to call a service's method and this is responsible for sending the message to server.
The content type text / xml; charset = utf-8 of the response message does not match the content type of the binding (application / soap + xml; charset = utf-8). If using a custom encoder, be sure that the method IsContentTypeSupported implemented correctly.
The first 373 byte response was:
<faultstring>unable to locate Envelope in namespace http://schemas.xmlsoap.org/soap/envelope/. Root element is "http://www.w3.org/2003/05/soap-envelope" in namespace "Envelope"
</faultstring>
</env:Fault></env:Body></env:Envelope>
I also give you the wsdl file to help me if something is wrong about my binding. I have omitted some parts of it (types, messages & bindings).
The content type text / xml; charset = utf-8 of the response message does not match the content type of the binding (application / soap + xml; charset = utf-8).
Hi nouvaki,
Thanks for your post.
Based on above error message, I think the remote wcf server retur you the content "text / xml", however your client want
a "application / soap + xml" type response message.
# Make sure client and the server endpoint used are in sync with regards to bindings and configuration.
You were right. Client didn't have the proper binding. My server uses SOAP 1.1 and WS-Policy (UsernameToken-Plain Text). So I setted the following binding. But now I have other error returned:
"An unsecured or incorrectly secure fault was received from the other party." And Inner Exception:
"Unknown exception, internal system processing error"
What can I do since I don't have access to web service's server and the only thing I have is the wsdl file? The inner exception isn't very descriptive...
Based on your description, I see you came across the error like below.
"An unsecured error or incorrectly secured fault was received from the other party. See the inner fault exception for the fault code and detail.
System.ServiceModel.FaultException: An error occurred when verifying security for the message"
This is a very obscure fault that WCF services throw. The issue is that WCF is unable to verify the security of the message that was passed to the service.
The server's system time and the client's system time must be within (typically) 10 minutes of each other.
In SOAP UI I get a successful response with my client 's xml file as a request. There, under the respone I saw server's time which is in GMT whereas my computer was in +2 UTC. I changed my computer time zone to GMT, but I am getting the same message. Inside
my code, I have the same Username-Password I put inside the xml request. The xml I use in SOAP is
Finally I got a weird solution to my problem. The proxy client constructor created from the wsdl seems to ingonre app.config settings. So I created the binding & endpoint by code and used their constructor with these as parameters e.g. proxy(binding, remoteAddress).
My code is :
This worked just perfect. I don't understand why app.config ignored. I mark this answer as my solution because it wasn't a time skew or a security problem. Fuxiang Zhang thank you for your time and your advise!
Member
1 Points
11 Posts
Exception to web service,wrong binding or wrong wsdl?
Mar 12, 2014 05:44 AM|nouvaki|LINK
Given a wsdl file from my client I used "Add Service Reference" in Visual Studio 2010 to use the service. This imported the service and created endpoint and custom binding in my app.config . My problem is that I cannot get any result from the service. I cannot determine if it is a binding issue or wsdl file has some problem. I know that SOAP 1.1 was used in service. The only thing I can do is to call a service's method and this is responsible for sending the message to server.
My binding-endpoint is:
The error I get is:
The content type text / xml; charset = utf-8 of the response message does not match the content type of the binding (application / soap + xml; charset = utf-8). If using a custom encoder, be sure that the method IsContentTypeSupported implemented correctly. The first 373 byte response was:
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> <env:Header/> <env:Body><env:Fault>
<faultcode> </faultcode>
<faultstring>unable to locate Envelope in namespace http://schemas.xmlsoap.org/soap/envelope/. Root element is "http://www.w3.org/2003/05/soap-envelope" in namespace "Envelope"
</faultstring>
</env:Fault></env:Body></env:Envelope>
I also give you the wsdl file to help me if something is wrong about my binding. I have omitted some parts of it (types, messages & bindings).
wsdl webservice binding
All-Star
30411 Points
3628 Posts
Re: Exception to web service,wrong binding or wrong wsdl?
Mar 13, 2014 05:27 AM|Fuxiang Zhang - MSFT|LINK
Hi nouvaki,
Thanks for your post.
Based on above error message, I think the remote wcf server retur you the content "text / xml", however your client want
a "application / soap + xml" type response message.
# Make sure client and the server endpoint used are in sync with regards to bindings and configuration.
http://stackoverflow.com/questions/8637652/wcf-charset-utf-8-of-the-response-message-does-not-match-the-content-type-of-the
# Check if you have installed the WCF Activation Feature.
http://social.msdn.microsoft.com/Forums/vstudio/en-US/4b72d695-5790-4615-99cd-4e331d7e864d/wcf-returning-the-content-type-texthtml-of-the-response-message-does-not-match-the-content-type-of?forum=wcf
Hope that helps, thanks.
Best Regards!
wsdl webservice binding
Member
1 Points
11 Posts
Re: Exception to web service,wrong binding or wrong wsdl?
Mar 13, 2014 11:01 AM|nouvaki|LINK
You were right. Client didn't have the proper binding. My server uses SOAP 1.1 and WS-Policy (UsernameToken-Plain Text). So I setted the following binding. But now I have other error returned:
"An unsecured or incorrectly secure fault was received from the other party." And Inner Exception: "Unknown exception, internal system processing error"
What can I do since I don't have access to web service's server and the only thing I have is the wsdl file? The inner exception isn't very descriptive...
wsdl webservice FaultException binding
All-Star
30411 Points
3628 Posts
Re: Exception to web service,wrong binding or wrong wsdl?
Mar 14, 2014 03:00 AM|Fuxiang Zhang - MSFT|LINK
Hi nouvaki,
Thanks for your back.
Based on your description, I see you came across the error like below.
"An unsecured error or incorrectly secured fault was received from the other party. See the inner fault exception for the fault code and detail.
System.ServiceModel.FaultException: An error occurred when verifying security for the message"
This is a very obscure fault that WCF services throw. The issue is that WCF is unable to verify the security of the message that was passed to the service.
The server's system time and the client's system time must be within (typically) 10 minutes of each other.
Please try below solutions.
http://stackoverflow.com/questions/1484601/wcfan-unsecured-or-incorrectly-fault-error
Hope that helps, thanks.
Best Regards!
wsdl webservice FaultException binding
Member
1 Points
11 Posts
Re: Exception to web service,wrong binding or wrong wsdl?
Mar 14, 2014 07:00 AM|nouvaki|LINK
In SOAP UI I get a successful response with my client 's xml file as a request. There, under the respone I saw server's time which is in GMT whereas my computer was in +2 UTC. I changed my computer time zone to GMT, but I am getting the same message. Inside my code, I have the same Username-Password I put inside the xml request. The xml I use in SOAP is
What else can I do? Should I communicate with web service provider to see why I don't get the right response?
wsdl webservice FaultException binding
All-Star
30411 Points
3628 Posts
Re: Exception to web service,wrong binding or wrong wsdl?
Mar 16, 2014 09:32 PM|Fuxiang Zhang - MSFT|LINK
Hi nouvaki,
Thanks for your back.
If you can connect to the service provider, it is better to get help from them.
Provide your error message and describe what happened when you call their service.
Thanks.
Best Regards!
wsdl webservice FaultException binding
Member
1 Points
11 Posts
Re: Exception to web service,wrong binding or wrong wsdl?
Mar 17, 2014 03:30 AM|nouvaki|LINK
Finally I got a weird solution to my problem. The proxy client constructor created from the wsdl seems to ingonre app.config settings. So I created the binding & endpoint by code and used their constructor with these as parameters e.g. proxy(binding, remoteAddress). My code is :
This worked just perfect. I don't understand why app.config ignored. I mark this answer as my solution because it wasn't a time skew or a security problem. Fuxiang Zhang thank you for your time and your advise!
wsdl webservice FaultException binding