Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I cannot call the web service from a windows mobile 6 application to a website hosted in another server or machine. If i call the service, webexception will occured and when I use:
C#
catch (WebException ex)
{
  // handels the connection error exception anlong with web response error
  string message = ex.Message;
  HttpWebResponse response = (HttpWebResponse)ex.Response;
  if (null != response)
  {
    message = response.StatusDescription;
    response.Close();
  }
  //end
  MessageBox.Show(message, "Error");
}
Cursor.Current = Cursors.Default;

I got the exception like "Cannot process the message because the content type 'application/soap+xml; charset=utf-8; action="urn:iMAAPExternalServices/TestWCF"' was not the expected type 'application/soap+msbin1'." Please give me a immediate solution to develop my application.
Posted
Updated 21-Nov-11 1:33am
v2
Comments
JF2015 21-Nov-11 7:34am    
Edited to add code formatting.

See these solved threads

Security Token Service Error:

Secondly when updating the Security Token Service, in my default install I found that there was no <system.web> tag, and so placing the config after the </system.net> as instructed by Bill, caused the following error when trying to login:

ProtocolException: The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (application/soap+msbin1). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly.

Once I enclosed my <membership> and <rolemanager> tags in a <system.web> </system.web> all was good. Thanks to this thread[^] for that solution.

Ah --- found it. The ServiceModel section in the website's web.config was set to customBinding. Changed it so it matched what the client was sending, and now it works beautifully.

Try remove the binaryEncoding tag. You can only use one type of encoding.

So you need to remove either TextEncoding or the BinaryEncoding element
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900