Code for Cloud end-point project


MyBena Class file code


package com.example.myendpoint;

public class MyBean {
private String msg;
public String getMessage() {
return msg;
}
public void setMessage(String str) {
msg=str;
}
}


YourFirstAPI Java file

package com.example.myendpoint;

import com.google.api.server.spi.config.Api;
import com.google.api.server.spi.config.ApiMethod;
import com.google.api.server.spi.config.ApiNamespace;
import javax.inject.Named;

@Api(name = "skeleton-api",
     version = "v1",
     namespace=@ApiNamespace(ownerDomain="greeting.example.com",ownerName="greeting.example.com",packagePath=""))
public class YourFirstAPI {
@ApiMethod(name="hiThere")
public MyBean hiThere(@Named("name") String name) {
MyBean response=new MyBean();
response.setMessage("Hi, "+name);
return response;
}
}

Comments

Popular posts from this blog

Conditional Statement in SML (if else in SML)

Print table in SML-NJ

Getting Started with SML