我正在尝试发布消息(c#控制台应用程序):
var client = new WeborbClient("http://localhost:57433/weborb.aspx", "MyDestination");
client.Publish("test message");
…得到NullReferenceException
:
在Weborb.Writer.ObjectWriter。写(Object obj, IProtocolFormatter)在Weborb.Writer.ObjectReferenceWriter。write(Object obj, IProtocolFormatter)在Weborb.Writer.ArrayWriter。写(Object obj, IProtocolFormatter)在Weborb.Writer.ArrayReferenceWriter。write(Object obj, IProtocolFormatter)在Weborb.Writer.MessageWriter。writeObject(Object obj, IProtocolFormatter)在Weborb.Writer.AMFBodyWriter。写(Object obj, IProtocolFormatter)在Weborb.Writer.MessageWriter。writeObject(Object obj, IProtocolFormatter)在Weborb.Util.Cache.Cache。WriteAndSave(Object obj, IProtocolFormatter formatter)在Weborb.Writer.AMFMessageWriter。写(Object obj, IProtocolFormatter)在Weborb.Writer.MessageWriter。writeObject(Object obj, IProtocolFormatter)在Weborb.Util.AMFSerializer。SerializeToBytes(Object obj, Int32 serializationType)在Weborb.Util.AMFSerializer。SerializeToBytes(对象obj)在Weborb.Client.HttpEngine。CreateRequest(V3Message v3Msg,字典
2 headers) at Weborb.Client.HttpEngine.CreateRequest(V3Message v3Msg) at Weborb.Client.HttpEngine.SendRequest[T](V3Message v3Msg, Responder
1 responder, Boolean isSubscription)在Weborb.Client.Engine。SendRequest[T](V3Message v3Msg, Responder1 responder) at Weborb.Client.WeborbClient.Publish(Object message, Dictionary
2 headers, String subtopic, PublishingResponder Responder)在Weborb.Client.WeborbClient。Publish(Object message, Dictionary ' 2 headers)
从Flex应用程序成功发布到同一目的地:
<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 );
解决方案是部署webb。配置到你的可执行文件所在的文件夹