fantiq commented on issue #15447:
URL: https://github.com/apache/dubbo/issues/15447#issuecomment-2966757582

   > With attachement below, and I also find another problem which I am not 
sure. when in proto files, package is provided, It is working to access 
org.apache.dubbo.sample.proto.Simple/sayHello via http post. but if we donot 
have this line(eg. package org.apache.dubbo.sample.proto;) I found neither way 
will work.
   > 
   > curl --header "Content-Type: application/json" --data '{"name":"Dubbo"}' 
org.apache.dubbo.sample.proto.Simple/sayHello {"message":"Invoker not 
found","status":"404"} curl --header "Content-Type: application/json" --data 
'{"name":"Dubbo"}' Simple/sayHello {"message":"Invoker not 
found","status":"404"}
   > 
   > 
[dubbo-provider_no_proto_package.zip](https://github.com/user-attachments/files/20698790/dubbo-provider_no_proto_package.zip)
   > 
   > `syntax = "proto3";
   > 
   > option java_multiple_files = true; option java_package = 
"org.apache.dubbo.sample.proto"; **### _//package 
org.apache.dubbo.sample.proto;_** option java_outer_classname = 
"HelloWorldProto";
   > 
   > ...
   > 
   > Please correct me if this is not a problem.
   
   It depends on your implementation method.
   
   if the service class extends `*ImplBase`, the corresponding relationship 
between rest `path` and proto `package` is as follows:
   
   Assume that there is the following proto file
   
   ```
   option java_package = "foo.bar";
   service GreeterService {
       rpc run(xx) returns (xx);
   }
   ```
   
   package|http path
   --|--
   package pkg; | /pkg.GreeterService/foo.bar.GreeterService/run
   package foo.bar; | /foo.bar.GreeterService/run
   N/A | /GreeterService/foo.bar.GreeterService/run
   
   if the service class implements interface, the http path is interface name, 
there is `/foo.bar.GreeterService/run`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to