我正在尝试发布消息(C#console app):
var client = new WeborbClient("http://localhost:57433/weborb.aspx", "MyDestination");
client.Publish("test message");
...并获得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,Dictionary
2 headers) at Weborb.Client.HttpEngine.CreateRequest(V3Message v3Msg) at Weborb.Client.HttpEngine.SendRequest[T](V3Message v3Msg, Responder
1 responder,Boolean isSubscription) at Weborb.Client.Engine.SendRequest [T](V3Message v3Msg,Responder1 responder) at Weborb.Client.WeborbClient.Publish(Object message, Dictionary
2个header,String subtopic,PublishingResponder responder) 在Weborb.Client.WeborbClient.Publish(对象消息,字典`2标题)
从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 );
答案 0 :(得分:2)
解决方案是将weborb.config部署到运行可执行文件的同一文件夹中。