Showing posts with label cxf. Show all posts
Showing posts with label cxf. Show all posts

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