[jboss-user] [jBPM] - Re: Create WID Using Rest API

dme do-not-reply at jboss.com
Fri Mar 16 11:35:04 EDT 2012


dme [https://community.jboss.org/people/dme] created the discussion

"Re: Create WID Using Rest API"

To view the discussion, visit: https://community.jboss.org/message/724370#724370

--------------------------------------------------------------
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/ 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
[https://community.jboss.org/message/724370#724370]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120316/d01da183/attachment.html 


More information about the jboss-user mailing list