This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = "proto3"; | |
package org.ballerinalang.net.grpc.stockquote; | |
service StockQuoteService { | |
rpc getQuotes(org.ballerinalang.net.grpc.stockquote.Void) returns (org.ballerinalang.net.grpc.stockquote.StockQuotes); | |
rpc addStock(org.ballerinalang.net.grpc.stockquote.StockQuote) returns (org.ballerinalang.net.grpc.stockquote.Void); | |
rpc getQuote(org.ballerinalang.net.grpc.stockquote.StockRequest) returns (org.ballerinalang.net.grpc.stockquote.StockQuote); | |
rpc getNames(org.ballerinalang.net.grpc.stockquote.Void) returns (org.ballerinalang.net.grpc.stockquote.StockNames); | |
} | |
message Void { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.ballerinalang.net.grpc.stockquote; | |
import ballerina.net.grpc; | |
service<grpc> StockQuoteService { | |
resource getQuote (StockRequest req, StockQuote res) { | |
println("Getting stock details for symbol: " + req.name); | |
res.symbol = "IBM"; | |
res.name = "International Business Machines"; | |
res.last = 149.52; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.ballerinalang.net.grpc.helloworld; | |
import ballerina.net.grpc; | |
service<grpc> helloWorld { | |
resource hello (HelloRequest req, HelloResponse res) { | |
println(req.name); | |
res.message = "First Hurray " + req.name; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service<grpc> helloWorld { | |
function sayHello (HelloRequest req) (HelloResponse res) { | |
HelloResponse response = {message:"Hello" + request.getName()}; | |
return response; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String resourcePath = "/esb/abc.xml"; | |
boolean resourceExists = configRegistry.resourceExists(resourcePath); | |
if (resourceExists) { | |
Resource registryResource = configRegistry.get(resourcePath); | |
try { | |
OMElement contentElement = AXIOMUtil.stringToOM( | |
new String((byte[]) registryResource.getContent())); | |
contentElement.addChild(garElement); //edit content | |
registryResource.setContent(contentElement.toString()); | |
configRegistry.put(resourcePath, registryResource); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.wso2.carbon.transport.http.netty.config; | |
import java.util.Collections; | |
import java.util.HashSet; | |
import java.util.Set; | |
import javax.xml.bind.annotation.XmlAccessType; | |
import javax.xml.bind.annotation.XmlAccessorType; | |
import javax.xml.bind.annotation.XmlElement; |
NewerOlder