<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/incubator-dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/incubator-dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<p dir="auto">As for dubbo service test, it is convient to use Generic reference.<br>
But for GooglePb test this approach is not work.<br>
We are going to support google protobuf for Generic reference.</p>
<ol dir="auto">
<li>ServiceDefinition should be able to support google protobuf Metadata.</li>
<li>Generic invocation should be able to send json String to GenericFilter.</li>
<li>GenericFilter should be able to parse json String to Google Protobuf Object for the request.</li>
<li>GenericFilter should be able to parse Google Protobuf Object to json String for the response.</li>
</ol>
<p dir="auto">For （1）, PR <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="442146527" data-permission-text="Title is private" data-url="https://github.com/apache/dubbo/issues/4011" data-hovercard-type="pull_request" data-hovercard-url="/apache/dubbo/pull/4011/hovercard" href="https://github.com/apache/dubbo/pull/4011">#4011</a> is going to support that.<br>
For (2), already support by dubbo.<br>
For (3),<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="11402999" data-permission-text="Title is private" data-url="https://github.com/apache/dubbo/issues/4" data-hovercard-type="pull_request" data-hovercard-url="/apache/dubbo/pull/4/hovercard" href="https://github.com/apache/dubbo/pull/4">#4</a>, PR <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="440395099" data-permission-text="Title is private" data-url="https://github.com/apache/dubbo/issues/3975" data-hovercard-type="pull_request" data-hovercard-url="/apache/dubbo/pull/3975/hovercard" href="https://github.com/apache/dubbo/pull/3975">#3975</a> already fixed that.</p>
<p dir="auto">For (1) (PR <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="442146527" data-permission-text="Title is private" data-url="https://github.com/apache/dubbo/issues/4011" data-hovercard-type="pull_request" data-hovercard-url="/apache/dubbo/pull/4011/hovercard" href="https://github.com/apache/dubbo/pull/4011">#4011</a>):</p>
<ol dir="auto">
<li>we change TypeDefinitionBuilder to use SPI to load TypeBuilderList.</li>
<li>extended TypeBuilder in ProtobufTypeBuilder class, while user is able to extend that.</li>
<li>ProtobufTypedBuilder is able to parse google protobuf class to TypeDefinition.</li>
<li>We keep similar logic as TypeDefinitionBuilder,so the TypeDefiniton generated by GooglePb will be equals to which generate by java POJO.</li>
</ol>
<p dir="auto">How to use?</p>
<ol dir="auto">
<li>
<p dir="auto">get google protobuf Metadata from ServiceDefinition.<br>
test client get metaData form metaData reporter.</p>
</li>
<li>
<p dir="auto">parse google protobuf metadata to json string for the user (eg: Dubbo Admin portal).<br>
TypeDefinition -&gt; json String</p>
</li>
<li>
<p dir="auto">send json string with parameter to GenericFilter.</p>
</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="consumer.xml
    &lt;!-- generate proxy for the remote service, then demoService can be used in the same way as the
    local regular interface --&gt;
    &lt;dubbo:reference url =&quot;dubbo://localhost:20880/org.apache.dubbo.demo.protobuf.api.ProtobufDemoService&quot;
                     id=&quot;demoService&quot; check=&quot;false&quot; interface=&quot;org.apache.dubbo.rpc.service.GenericService&quot; generic=&quot;proto&quot;/&gt;"><pre class="notranslate"><code class="notranslate">consumer.xml
    &lt;!-- generate proxy for the remote service, then demoService can be used in the same way as the
    local regular interface --&gt;
    &lt;dubbo:reference url ="dubbo://localhost:20880/org.apache.dubbo.demo.protobuf.api.ProtobufDemoService"
                     id="demoService" check="false" interface="org.apache.dubbo.rpc.service.GenericService" generic="proto"/&gt;
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="   GenericService genericService = context.getBean(&quot;demoService&quot;, GenericService.class);
    String methodName = &quot;sayHello&quot;;
    String[] requestType = new String[]{GooglePBRequestType.class.getName()};
    // TODO this requestStr could generate from serviceMetaData. a new TypeDefinition is create will push next
    String requestStr = &quot;{ \&quot;req\&quot;: \&quot;some Message\&quot; }&quot;;
    Object[] request = new Object[]{requestStr};
    String hello = (String) genericService.$invoke(methodName,requestType,request);"><pre class="notranslate"><code class="notranslate">   GenericService genericService = context.getBean("demoService", GenericService.class);
    String methodName = "sayHello";
    String[] requestType = new String[]{GooglePBRequestType.class.getName()};
    // TODO this requestStr could generate from serviceMetaData. a new TypeDefinition is create will push next
    String requestStr = "{ \"req\": \"some Message\" }";
    Object[] request = new Object[]{requestStr};
    String hello = (String) genericService.$invoke(methodName,requestType,request);
</code></pre></div>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.3</li>
<li>Operating System version: mac os</li>
<li>Java version: jdk8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>telnet ip:port</li>
<li>ls</li>
<li>help found no invoke command</li>
</ol>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/38564000/69211938-b94e3180-0b9a-11ea-8365-9ad0a0ec62c7.png"><img src="https://user-images.githubusercontent.com/38564000/69211938-b94e3180-0b9a-11ea-8365-9ad0a0ec62c7.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">What do you expected from the above steps？</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">What actually happens?</p>
<p dir="auto">If there is an exception, please attach the exception trace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Just put your stack trace here!"><pre class="notranslate"><code class="notranslate">Just put your stack trace here!
</code></pre></div>