Tunnel localhost to the internet

Posted on by Kim


Use ngrok

How to use ngrok:

Download and install ngrok. If you have npm installed, you can use: npm install -g ngrok Otherwise you can download it from the ngrok website

From the command line, run ngrok http $PORT replacing $PORT with the port you want.

Parse JSON with Java

Posted on by Kim

Using cxf to parse JSON

ChangeService changeService = JAXRSClientFactory.create(propertiesInterface.getServerUrl(),
        ChangeService.class, Collections.singletonList(new JacksonJaxbJsonProvider()),
        propertiesInterface.getUserName(), propertiesInterface.getPassword(), null);
Where ChangeService is
@Path("/change_request")
@Produces(MediaType.APPLICATION_JSON)
public interface ChangeService {

    @GET    public Changes getChangesByAssignedTo(
            @QueryParam("sysparm_query") String userSysId);
And maven dependency

    org.apache.cxf
    cxf-rt-rs-client
    ${cxf.version}
    provided


    org.codehaus.jackson
    jackson-jaxrs
    ${jackson.version}
    provided


    org.codehaus.jackson
    jackson-xc
    ${jackson.version}
    test

Build project automatically

Posted on by Kim