JBoss Community

Re: Create WID Using Rest API

created by dme in jBPM - View the full discussion

Thanks for the suggestion. I tried something like below, it gives a HTTP 415 (Media-Type Not found) exception.

 

String widxml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><asset><checkInComment>Test</checkInComment><description>This is a Work Item Definition Configuration File</description><metadata><format>wid</format><title>Sample3</title></metadata><type></type><version>1</version></asset>";

String authorizationHeader = "Basic " + org.apache.cxf.common.util.Base64Utility.encode("guest:".getBytes());

        WebClient client2 = WebClient.create("http://127.0.0.1:8080/");

        client2.header("Authorization", authorizationHeader);

        Response response= client2.path("drools-guvnor/rest/packages").accept("application/atom+xml").post(widxml);

        System.out.println("response = " + response.getStatus());

 

I was planning to first create the WID asset in guvnor, and then upload the WID using the octect-stream post method.

 

Is this what you were suggesting, and if so would you know whats wrong with my implementation? I am using Apache CXF as the WebClient.

 

Thanks.

Reply to this message by going to Community

Start a new discussion in jBPM at Community