473,395 Members | 1,568 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Consuming REST service

I wasn't sure if this belonged in the C# group or not, but here goes. When I
call the service (not one I created - or have any control over) I get this
error:

Unrecognized charSet 'ISO-8859-1' in contentType.

Here is the calling code:

ChannelFactory<IMyInterfacefactory = new
ChannelFactory<IMyInterface>("endpoint");
var proxy = factory.CreateChannel();
var response = proxy.MyFunction(param1);
((IDisposable)proxy).Dispose();

I'm using webHttpBinding. Any ideas? Thanks for any help, I really
appreciate it.

Thanks,
Nick
Aug 13 '08 #1
4 9214
Hello Nick,

It was discussed here http://forums.microsoft.com/MSDN/Sho...70310&SiteID=1
Hope this help you.

Regards,
Andrei Varanovich [C# MVP]
I wasn't sure if this belonged in the C# group or not, but here goes.
When I call the service (not one I created - or have any control over)
I get this error:

Unrecognized charSet 'ISO-8859-1' in contentType.

Here is the calling code:

ChannelFactory<IMyInterfacefactory = new
ChannelFactory<IMyInterface>("endpoint");
var proxy = factory.CreateChannel();
var response = proxy.MyFunction(param1);
((IDisposable)proxy).Dispose();
I'm using webHttpBinding. Any ideas? Thanks for any help, I really
appreciate it.

Thanks,
Nick

Aug 13 '08 #2
Hi Andrei,

Thank you very much for your help. Is there any way to set
WebMessageEncodingBindingElement in the .config file instead of doing it in
code?

I tried using that code, but now I get a new error:

Unable to deserialize XML body with root name 'Binary' and root namespace ''
(for operation 'MyFunction' and contract ('IMyInterface',
'http://tempuri.org/')) using XmlSerializer. Ensure that the type
corresponding to the XML is added to the known types collection of the
service.
Any ideas? I didn't find much when I searched. I don't have a great deal of
experience with all of this, so I really appreciate your help.

Thanks,
Nick
"Andrei Varanovich [C# MVP]" wrote:
Hello Nick,

It was discussed here http://forums.microsoft.com/MSDN/Sho...70310&SiteID=1
Hope this help you.

Regards,
Andrei Varanovich [C# MVP]
I wasn't sure if this belonged in the C# group or not, but here goes.
When I call the service (not one I created - or have any control over)
I get this error:

Unrecognized charSet 'ISO-8859-1' in contentType.

Here is the calling code:

ChannelFactory<IMyInterfacefactory = new
ChannelFactory<IMyInterface>("endpoint");
var proxy = factory.CreateChannel();
var response = proxy.MyFunction(param1);
((IDisposable)proxy).Dispose();
I'm using webHttpBinding. Any ideas? Thanks for any help, I really
appreciate it.

Thanks,
Nick


Aug 13 '08 #3
Hello Nick,

Honestly I didn't played much with this stuff, so can only guess.

Which type you are trying to serialize? I mean what is a return value of
the service method?

Can you please provide a complete stack trace for the exception you got?

Thanks,
Andrei
Hi Andrei,

Thank you very much for your help. Is there any way to set
WebMessageEncodingBindingElement in the .config file instead of doing
it in code?

I tried using that code, but now I get a new error:

Unable to deserialize XML body with root name 'Binary' and root
namespace '' (for operation 'MyFunction' and contract ('IMyInterface',
'http://tempuri.org/')) using XmlSerializer. Ensure that the type
corresponding to the XML is added to the known types collection of the
service.

Any ideas? I didn't find much when I searched. I don't have a great
deal of experience with all of this, so I really appreciate your help.

Thanks,
Nick

Aug 13 '08 #4
Hi Andrei,

Turns out I had an error in my config file when I first started. I haven't
had a chance to finish, but when I get it all figured out I'll let you know.

Thanks for your help, I really appreciate it.

Thanks,
Nick

"Andrei Varanovich [C# MVP]" wrote:
Hello Nick,

Honestly I didn't played much with this stuff, so can only guess.

Which type you are trying to serialize? I mean what is a return value of
the service method?

Can you please provide a complete stack trace for the exception you got?

Thanks,
Andrei
Hi Andrei,

Thank you very much for your help. Is there any way to set
WebMessageEncodingBindingElement in the .config file instead of doing
it in code?

I tried using that code, but now I get a new error:

Unable to deserialize XML body with root name 'Binary' and root
namespace '' (for operation 'MyFunction' and contract ('IMyInterface',
'http://tempuri.org/')) using XmlSerializer. Ensure that the type
corresponding to the XML is added to the known types collection of the
service.

Any ideas? I didn't find much when I searched. I don't have a great
deal of experience with all of this, so I really appreciate your help.

Thanks,
Nick


Aug 14 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Duncan Mole | last post by:
Hi, I have created a control which draws a title bar and provides a drop down menu for a Smart Device Application. It seemed to work fine until I came to add an event handler to act on Paint...
3
by: Matt D | last post by:
I've got two web services that use the same data types and that clients will have to consume. I read the msdn article on sharing types...
6
by: kbs | last post by:
Hi, I'm looking for some good examples that illustrate how to code a web service that exposes a custom collection so that the properties of the collection are accessible on the client without...
0
by: Howard | last post by:
I am having a devil of a time getting WSDL.EXE to consume a WSDL file that describes a web service (known as AXL) on a Cisco phone switch. The WSDL file references four schemas and (I believe) two...
2
by: Glenn Venzke | last post by:
Is there any way to tell what type of application is consuming a web service? I'm writing a web service that returns a string with 2 carriage returns. What I want to do is replace these carriage...
2
by: s | last post by:
'project with web service <webmethod()> _ public function myws(id as integer) 'do db stuff with id and build document Dim xd As New XmlDataDocument...
0
by: plmanikandan | last post by:
I need to develop a application to consume a webservice. For consuming web service i tried a example in Consuming a Web Service in C# in http://www.csharphelp.com.But i am uanble to use that...
3
by: Jeremy Chapman | last post by:
I've writtin a very simple web service in axis which returns an array of classes. I consume it in a .net app. When receiving the response, my .net app generates an error "Cannot assign object...
1
by: =?Utf-8?B?R29yZG9u?= | last post by:
Hi; I can consume a web service from an asp.net application with no problem. The web service connects to a remote server through ODBC and returns a data set to the consuming software. When...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.