[Mono-bugs] [Bug 689080] New: MessageHeader.GetUntypedHeader throw exception
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Thu Apr 21 09:05:50 EDT 2011
https://bugzilla.novell.com/show_bug.cgi?id=689080
https://bugzilla.novell.com/show_bug.cgi?id=689080#c0
Summary: MessageHeader.GetUntypedHeader throw exception
Classification: Mono
Product: Mono: Class Libraries
Version: 2.10.x
Platform: PC
OS/Version: openSUSE 11.3
Status: NEW
Severity: Critical
Priority: P5 - None
Component: WCF
AssignedTo: atsushi at ximian.com
ReportedBy: cristiano.simionato at cocai.eu
QAContact: mono-bugs at lists.ximian.com
Found By: ---
Blocker: ---
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0) Gecko/20100101
Firefox/4.0
In a simple service like
[ServiceContract]
public interface IMyService
{
[OperationContract]
void Request(System.ServiceModel.Channels.Message msg);
}
if is added a System.ServiceModel.MessageHeader to the
System.ServiceModel.Channels.Message by typed header in this way:
var msg = Message.CreateMessage(MessageVersion.Default,
"http://tempuri.org/IService/Request", "My Body");
var value = "TestHeader1";
var header = new MessageHeader<string>(value);
var h2 = header.GetUntypedHeader("HeaderName", "http://tempuri.org/");
msg.Headers.Add(h2);
when calling the service method Request(msg) in mono is throw an exception,
but if the header is added by:
var h2 = MessageHeader.CreateHeader("HeaderName", "http://tempuri.org/",
value );
without the use of typed header, all goes right.
The exception throw is:
System.ArgumentNullException has been thrown
"Argument cannot be null.
Parameter name: text"
at System.Xml.XmlBinaryDictionaryWriter.WriteString (System.String text)
[0x00006] in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/System.Runtime.Serialization/System.Xml/XmlBinaryDictionaryWriter.cs:719
at System.Xml.XmlDictionaryWriter.WriteAttributeString (System.String
prefix, System.Xml.XmlDictionaryString localName,
System.Xml.XmlDictionaryString namespaceUri, System.String value) [0x00009]
in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/System.Runtime.Serialization/System.Xml/XmlDictionaryWriter.cs:166
at System.ServiceModel.Channels.MessageHeader.WriteHeaderAttributes
(System.Xml.XmlDictionaryWriter writer,
System.ServiceModel.Channels.MessageVersion version) [0x0009a] in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/System.ServiceModel/System.ServiceModel.Channels/MessageHeader.cs:178
at System.ServiceModel.Channels.MessageHeader.OnWriteStartHeader
(System.Xml.XmlDictionaryWriter writer,
System.ServiceModel.Channels.MessageVersion version) [0x00082] in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/System.ServiceModel/System.ServiceModel.Channels/MessageHeader.cs:131
at System.ServiceModel.Channels.MessageHeader.WriteStartHeader
(System.Xml.XmlDictionaryWriter writer,
System.ServiceModel.Channels.MessageVersion version) [0x00000] in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/System.ServiceModel/System.ServiceModel.Channels/MessageHeader.cs:197
at System.ServiceModel.Channels.MessageHeaders.WriteStartHeader (Int32
index, System.Xml.XmlDictionaryWriter writer) [0x0003e] in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/System.ServiceModel/System.ServiceModel.Channels/MessageHeaders.cs:300
at System.ServiceModel.Channels.MessageHeaders.WriteHeader (Int32 index,
System.Xml.XmlDictionaryWriter writer) [0x00016] in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/System.ServiceModel/System.ServiceModel.Channels/MessageHeaders.cs:268
at System.ServiceModel.Channels.Message.OnWriteMessage
(System.Xml.XmlDictionaryWriter writer) [0x00047] in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/System.ServiceModel/System.ServiceModel.Channels/Message.cs:256
at System.ServiceModel.Channels.Message.WriteMessage
(System.Xml.XmlDictionaryWriter writer) [0x00026] in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/System.ServiceModel/System.ServiceModel.Channels/Message.cs:170
at System.ServiceModel.Channels.BinaryMessageEncoder.WriteMessage
(System.ServiceModel.Channels.Message message, System.IO.Stream stream)
[0x0002a] in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/System.ServiceModel/System.ServiceModel.Channels/BinaryMessageEncoder.cs:118
at System.ServiceModel.Channels.TcpBinaryFrameManager.WriteSizedMessage
(System.ServiceModel.Channels.Message message) [0x00093] in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/System.ServiceModel/System.ServiceModel.Channels/TcpBinaryFrameManager.cs:389
at System.ServiceModel.Channels.TcpDuplexSessionChannel.Send
(System.ServiceModel.Channels.Message message, TimeSpan timeout) [0x00076]
in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/System.ServiceModel/System.ServiceModel.Channels/TcpDuplexSessionChannel.cs:150
at System.ServiceModel.MonoInternal.ClientRuntimeChannel.RequestCorrelated
(System.ServiceModel.Channels.Message msg, TimeSpan timeout, IOutputChannel
channel) [0x00006] in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs:587
at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Request
(System.ServiceModel.Channels.Message msg, TimeSpan timeout) [0x00019] in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs:581
at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Request
(System.ServiceModel.Description.OperationDescription od, System.Object[]
parameters) [0x00066] in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs:534
at System.ServiceModel.MonoInternal.ClientRuntimeChannel.DoProcess
(System.Reflection.MethodBase method, System.String operationName,
System.Object[] parameters) [0x00038] in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs:499
at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Process
(System.Reflection.MethodBase method, System.String operationName,
System.Object[] parameters) [0x00000] in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs:479
Reproducible: Always
Steps to Reproduce:
1.
2.
3.
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the mono-bugs
mailing list