[protobuf] Zero tag number in enum data type

2011-04-18 Thread Canggih
hello, i just wanna share.

In Protobuf developer guide, in the sample proto file, there is a
PhoneType enum data type, consist of MOBILE, HOME, and WORK. MOBILE
use '0' as its tag number, and so on.
Meanwhile, i'm using Protobuf plugin for Netbeans, for my project.
When i was try to compile a proto file, there was an error. The error
was in enum data type. Compiler couldn't compile enum data that had
'0' tag number. Then, when I change to '1', it can run successfully.

Any explanations?

Thanks in advance
Canggih

-- 
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.



[protobuf] Re: Zero tag number in enum data type

2011-04-18 Thread Canggih
Sorry, my mistakes :)
But, when I try to give 0 as the enum value, compiler can't compile
it. Is it a bug from the compiler? (I use protobuf plugin in
neatbeans)

On Apr 19, 12:31 pm, Marc Gravell marc.grav...@gmail.com wrote:
 You mean this?

   enum PhoneType {
     MOBILE = 0;
     HOME = 1;
     WORK = 2;
   }

   message PhoneNumber {
     required string number = 1;
     optional PhoneType type = 2 [default = HOME];

 }

 The zero is not a tag / field-number; it is just an enum value. The 2 on the
 last line I've copied is a tag relating to a *use* of that enum.

 Marc

 On 19 April 2011 06:28, Canggih cangca...@gmail.com wrote:



  hello, i just wanna share.

  In Protobuf developer guide, in the sample proto file, there is a
  PhoneType enum data type, consist of MOBILE, HOME, and WORK. MOBILE
  use '0' as its tag number, and so on.
  Meanwhile, i'm using Protobuf plugin for Netbeans, for my project.
  When i was try to compile a proto file, there was an error. The error
  was in enum data type. Compiler couldn't compile enum data that had
  '0' tag number. Then, when I change to '1', it can run successfully.

  Any explanations?

  Thanks in advance
  Canggih

  --
  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.

 --
 Regards,

 Marc

-- 
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.



[protobuf] Re: Protobuf in JAX-WS

2011-04-01 Thread Canggih
Or, maybe can I handle request and read the callback without using JAX
WS (without java.xml.ws library)?

On Apr 1, 10:04 am, Ben Wright compuware...@gmail.com wrote:
 Unfortunately JAX-WS (Java API for XML Web Services) only works
 directly with XML (anyone feel free to correct me if I'm
 misinformed in this regard as I've never fully explored using JAX-WS
 without XML)

 You have a couple of options though...

 If you want to stick with XML based web services you can go with using
 Base64 encoded protocol buffer message(s) in appropriate XML fields.
 Likewise you can return data this way.  The drawbacks of this are that
 you're essentially throwing away a lot of the good that comes from web
 services being well defined in terms of argument and return data
 types. (Base64 is an encoding scheme for putting binary data in human
 readable data streams such as XML by only using displayable
 characters... encoding suffers a 4/3 size penalty as it takes four 6-
 bit chars to encode three 8-bit bytes)

 If you're more flexible you can implement a non-XML based web service
 using a RESTful model, or thin HTTP requests, to post and get protocol
 buffers directly as raw bytes.  There are also some remoting
 services built on top of protocol buffers that act much like web
 services.  I have not used any of them so I'll leave it to someone
 more versed in those to speak to them.

 If you want more info you can ask more questions or do a search on
 RESTful web services (and yes JAX-WS supports RESTful but still
 using XML...)

 Best of luck,
 Ben Wright

 On Mar 31, 10:38 pm, Canggih PW cangca...@gmail.com wrote:







  hi,

  Sorry, i'm new in Java.

  Currently, i make a web service using python (for server) and java (for 
  client).
  Client-Server can updates data synchronously, i'm using long polling 
  method. All
  i know about how to implement those thing is using JAX WS, to send request 
  and
  read the callback response. But, JAX WS using XML. How can i using protobuf 
  in
  JAX-WS, or there are any other library in java that can do it?

  Thanks in advance
  Canggih

-- 
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.



[protobuf] Re: Protobuf in JAX-WS

2011-04-01 Thread Canggih
thanks.
Actually, i'm using Restful web services. But, i'm confuse, how to use
it for long polling method. I have search it, but the result is using
JAX WS to handle the request and get callback response.
is there a way to do it in pure protobuf? Maybe using another library?

Thanks in advance
Canggih

On Apr 1, 10:04 am, Ben Wright compuware...@gmail.com wrote:
 Unfortunately JAX-WS (Java API for XML Web Services) only works
 directly with XML (anyone feel free to correct me if I'm
 misinformed in this regard as I've never fully explored using JAX-WS
 without XML)

 You have a couple of options though...

 If you want to stick with XML based web services you can go with using
 Base64 encoded protocol buffer message(s) in appropriate XML fields.
 Likewise you can return data this way.  The drawbacks of this are that
 you're essentially throwing away a lot of the good that comes from web
 services being well defined in terms of argument and return data
 types. (Base64 is an encoding scheme for putting binary data in human
 readable data streams such as XML by only using displayable
 characters... encoding suffers a 4/3 size penalty as it takes four 6-
 bit chars to encode three 8-bit bytes)

 If you're more flexible you can implement a non-XML based web service
 using a RESTful model, or thin HTTP requests, to post and get protocol
 buffers directly as raw bytes.  There are also some remoting
 services built on top of protocol buffers that act much like web
 services.  I have not used any of them so I'll leave it to someone
 more versed in those to speak to them.

 If you want more info you can ask more questions or do a search on
 RESTful web services (and yes JAX-WS supports RESTful but still
 using XML...)

 Best of luck,
 Ben Wright

 On Mar 31, 10:38 pm, Canggih PW cangca...@gmail.com wrote:







  hi,

  Sorry, i'm new in Java.

  Currently, i make a web service using python (for server) and java (for 
  client).
  Client-Server can updates data synchronously, i'm using long polling 
  method. All
  i know about how to implement those thing is using JAX WS, to send request 
  and
  read the callback response. But, JAX WS using XML. How can i using protobuf 
  in
  JAX-WS, or there are any other library in java that can do it?

  Thanks in advance
  Canggih

-- 
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.



[protobuf] Protobuf in JAX-WS

2011-03-31 Thread Canggih PW
hi, 

Sorry, i'm new in Java.

Currently, i make a web service using python (for server) and java (for 
client). 
Client-Server can updates data synchronously, i'm using long polling method. 
All 
i know about how to implement those thing is using JAX WS, to send request and 
read the callback response. But, JAX WS using XML. How can i using protobuf in 
JAX-WS, or there are any other library in java that can do it?

Thanks in advance
Canggih

-- 
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.