How to handle DataContracts in NETCF ?
Hi experts, I have a bunch of WCF services which use DataContracts in their interface. We tried using the built-in serializer in NETCF and encountered that it is really bad in performance in deserializing larger pieces of data :( So we went to look into protbuf-net... But I am not sure how I should use it on the NETCF side. Things seem to work fine on the WCF 'server' side (using Serializer.SerializeListProduct(ms, products.ToList());) and the data gets transferred to the NETCF client. But if I then try to do this in the NETCF client: var p = Serializer.DeserializeListProduct(responseStream); I get this exception: --- ProtoBuf.ProtoException was unhandled Message=Mismatched group tags detected in message StackTrace: at ProtoBuf.SerializationContext.EndGroup(Int32 tag) at ProtoBuf.Serializer`1.Deserialize[TCreation](SimpleWrapper instance, SerializationContext context) at ProtoBuf.Serializer`1.DeserializeChecked[TCreation] (SimpleWrapper instance, SerializationContext source) at ProtoBuf.SerializerSimpleProxy`1.Deserialize(List`1 value, SerializationContext source) at ProtoBuf.Serializer.Deserialize[T](SerializationContext source) at ProtoBuf.Serializer.Deserialize[T](Stream source) at NETCFClient.MainForm.getProductsEx_Click(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.ButtonBase.WnProc(WM wm, Int32 wParam, Int32 lParam) at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam) at Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain) at System.Windows.Forms.Application.Run(Form fm) at NETCFClient.Program.Main() --- Well, of course DataContracts do not exist in NETCF so I went along and generated XmlSerializer-compatible types for the NETCF app with the netcfsvcutil.exe tool. And obviously protbuf-net can not handle this now... What should i do? :) Thanks! -Christian --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@googlegroups.com To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/protobuf?hl=en -~--~~~~--~~--~--~---
Re: Platforms supported for C++ gen code
Thanks for information Kenton. :) Regards, Shirish On Fri, Apr 3, 2009 at 10:20 PM, Kenton Varda ken...@google.com wrote: On Fri, Apr 3, 2009 at 2:18 AM, Shirish Kulkarni shirish...@gmail.comwrote: Can I suppose it could be well ported to - say 64-bit AIX - platform as well? I would imagine so. It may even work without modification, especially if you use GCC as the compiler. What charsets does Protocol Buffers support. (Sorry, I was not able to find these information anywhere in the PB documentation) The string type in protocol buffers is UTF-8. You can also use the bytes type to pass arbitrary bytes in which you can use whatever character set you want. On Fri, Apr 3, 2009 at 11:38 AM, Shirish Kulkarni shirish...@gmail.com wrote: Thanks Kenton. On Fri, Apr 3, 2009 at 12:18 AM, Kenton Varda ken...@google.com wrote: Most Unix-like platforms (Linux, Mac OSX, FreeBSD, Solaris, Cygwin, etc.) and Windows (MinGW, MSVC) are supported. libprotobuf does not use many OS-specific features so it's likely to be easy to port to other platforms. However, it is not well-designed for stripped-down embedded systems with limited memory; consider protobuf-c for them. On Wed, Apr 1, 2009 at 11:42 PM, ShirishKul shirish...@gmail.comwrote: I would like to know about the platforms that Protocol Buffers support for C++ generated code. Please let me know. Thanks, Shirish --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@googlegroups.com To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/protobuf?hl=en -~--~~~~--~~--~--~---
Compile error with imported Message
Hi, I have defined a message that imports another message from a different package: File Message1.proto: = import Namespace2/Message3.proto; package Namespace1; message Message1 { ... optional Namespace2.Message3 ImportedField = 5; }//end Message1 File Namespace2/Message3.proto = package Namespace2; message Message3 { required int32 Field1 = 1; optional int32 Field2 = 2; }//end Message3 After compiling with protoc..exe for C++ output, I get the following error when I compile with GCC4: Message1.pb.cc: In function 'void Namespace1::protobuf_BuildDesc_Message1_2eproto()': Message1.pb.cc:55: error: 'protobuf_BuildDesc_Namespace2_2fMessage3_2eproto' is not a member of 'Namespace2' Did I miss something? Is something wrong with the protoc.exe? Any help is appreciated, WBR Günther --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@googlegroups.com To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/protobuf?hl=en -~--~~~~--~~--~--~---
RE: Compile error with imported Message
OK, I have found the problem ... It was how I organized my makefile(s). I tried to step down into each namespace directory and to compile with protoc from a local scope. I need to compile everything (protoc and GCC) relative to the top level namespace directory, that's it. If someone's interested in the details of my top level makefiles organization I can post the solution here. WBR Günther - Weitergeleitete Mail Von: Günther Makulik g.maku...@yahoo.com An: protobuf@googlegroups.com Gesendet: Montag, den 6. April 2009, 22:35:15 Uhr Betreff: Compile error with imported Message Hi, I have defined a message that imports another message from a different package: File Message1.proto: = import Namespace2/Message3.proto; package Namespace1; message Message1 { ... optional Namespace2.Message3 ImportedField = 5; }//end Message1 File Namespace2/Message3.proto = package Namespace2; message Message3 { required int32 Field1 = 1; optional int32 Field2 = 2; }//end Message3 After compiling with protoc.exe for C++ output, I get the following error when I compile with GCC4: Message1.pb.cc: In function 'void Namespace1::protobuf_BuildDesc_Message1_2eproto()': Message1.pb.cc:55: error: 'protobuf_BuildDesc_Namespace2_2fMessage3_2eproto' is not a member of 'Namespace2' Did I miss something? Is something wrong with the protoc.exe? Any help is appreciated, WBR Günther --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@googlegroups.com To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/protobuf?hl=en -~--~~~~--~~--~--~---