I am trying to publish message (C# console app):
var client = new WeborbClient("http://localhost:57433/weborb.aspx", "MyDestination");
client.Publish("test message");
…and getting NullReferenceException:
at Weborb.Writer.ObjectWriter.write(Object obj, IProtocolFormatter writer)
at Weborb.Writer.ObjectReferenceWriter.write(Object obj, IProtocolFormatter formatter)
at Weborb.Writer.ArrayWriter.write(Object obj, IProtocolFormatter writer)
at Weborb.Writer.ArrayReferenceWriter.write(Object obj, IProtocolFormatter formatter)
at Weborb.Writer.MessageWriter.writeObject(Object obj, IProtocolFormatter formatter)
at Weborb.Writer.AMFBodyWriter.write(Object obj, IProtocolFormatter writer)
at Weborb.Writer.MessageWriter.writeObject(Object obj, IProtocolFormatter formatter)
at Weborb.Util.Cache.Cache.WriteAndSave(Object obj, IProtocolFormatter formatter)
at Weborb.Writer.AMFMessageWriter.write(Object obj, IProtocolFormatter writer)
at Weborb.Writer.MessageWriter.writeObject(Object obj, IProtocolFormatter formatter)
at Weborb.Util.AMFSerializer.SerializeToBytes(Object obj, Int32 serializationType)
at Weborb.Util.AMFSerializer.SerializeToBytes(Object obj)
at Weborb.Client.HttpEngine.CreateRequest(V3Message v3Msg, Dictionary2 headers)1 responder, Boolean isSubscription)
at Weborb.Client.HttpEngine.CreateRequest(V3Message v3Msg)
at Weborb.Client.HttpEngine.SendRequest[T](V3Message v3Msg, Responder
at Weborb.Client.Engine.SendRequest[T](V3Message v3Msg, Responder1 responder)2 headers, String subtopic, PublishingResponder responder)
at Weborb.Client.WeborbClient.Publish(Object message, Dictionary
at Weborb.Client.WeborbClient.Publish(Object message, Dictionary`2 headers)
Publishing to the same destination works successfully from Flex app:
<mx:ChannelSet id="channelSet">
<mx:AMFChannel url="http://localhost:57433/weborb.aspx"/>
</mx:ChannelSet>
<mx:Producer id="producer"
channelSet="{channelSet}"
destination="MyDestination" />
// ...
var message:AsyncMessage = new AsyncMessage( "weborb messaging is cool" );
producer.send( message );
The solution is to deploy weborb.config into the same folder where your executable runs from.