c# - Incompatible Type when using web service -
c# - Incompatible Type when using web service -
i have utilize web service returns string result, gets string parameters too, things have done this: 1- have added service reference project. 2- have created instance of service class 3- have phone call want function within class instance
here code:
myservicens.pscowsdlporttypeclient mys= new myservicens.pscowsdlporttypeclient(); string res; res =mys.srvreq("11320000", "21310000", "13901009", "1", "3");
but problem when phone call mys.srvreq error below:
the content type text/xml; charset=iso-8859-1 of response message not match content type of binding (text/xml; charset=utf-8). if using custom encoder, sure iscontenttypesupported method implemented properly. first 572 bytes of response were: ?xml version="1.0" encoding="iso-8859-1"?soap-env:envelope soap-env:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap-
as understand it, problem wfc not supporting iso-88859-1 encoding. default wfc encoder supports utf-8 , utf-16 encoding.
you can create suitable custom encoder per msdn: http://msdn.microsoft.com/en-us/library/ms751486.aspx
and/or modify useful illustration http://eclectrics.com/software/2009/09/getting-the-current-weather-conditions/
c# wcf web-services soap xml-parsing
Comments
Post a Comment