Results 1 to 4 of 4
  1. #1
    petal is offline Member
    Join Date
    Aug 2013
    Posts
    6
    Rep Power
    0

    Default What is the cause of this error?

    Hi friends,
    i'm new to RESTful services, i want to make a client for some services,i have the curl command and want to write them in java using jersey, you can see the curl commands and my java codes follow,please tell me how can i correct my codes:
    the first one:
    curl command:
    Java Code:
    curl -i -X POST --data "sessionKey=eec8ff46-aaf9-485f-a7b5-452c1d7197d0&path=/contenthubfeedtest&recursive=true" http://dev.iks-project.eu:8081/cmsadapter/contenthubfeed
    my java code:(the first parameter in post method is the endpoint,second the data that should be posted and the last is the accept media type)
    Java Code:
    public static void submitContentItem(String sessionKey){
            
            String url="http://dev.iks-project.eu:8081/cmsadapter/contenthubfeed?sessionKey="+sessionKey;
            ClientResponse response=post(url, sessionKey, "application/rdf+xml");
            
        }
    and the second one:
    curl command:
    Java Code:
    curl -i -X POST -d "sessionKey=eec8ff46-aaf9-485f-a7b5-452c1d7197d0&baseURI=http://www.apache.org/stanbol/cms&store=true" http://dev.iks-project.eu:8081/cmsadapter/map/cms
    my java code for it:
    Java Code:
    public static void mapRepositoryToRDF(String sessionKey){
            
            String url="http://dev.iks-project.eu:8081/cmsadapter/map/cms";
            ClientResponse response=StanbolClient.post(url, sessionKey, "application/rdf+xml");
        }

  2. #2
    wsaryada is offline Senior Member
    Join Date
    Jun 2007
    Location
    Bali, Indonesia
    Posts
    757
    Rep Power
    7

    Default Re: What is the cause of this error?

    I didn't see any information about the error in your post?

  3. #3
    petal is offline Member
    Join Date
    Aug 2013
    Posts
    6
    Rep Power
    0

    Default Re: What is the cause of this error?

    Quote Originally Posted by wsaryada View Post
    I didn't see any information about the error in your post?
    no excuse me, my title was incorrect , i just want to know how should i convert those curl commands to java code?

  4. #4
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    8

    Default Re: What is the cause of this error?

    Okay? So what does not work about what you've posted?

    What Rest client are you using (try Jersey, maybe)? Have you read its manual yet? Have you looked at its examples yet?

Similar Threads

  1. Replies: 8
    Last Post: 11-22-2012, 07:16 AM
  2. Replies: 3
    Last Post: 05-08-2012, 05:26 PM
  3. Replies: 1
    Last Post: 12-05-2009, 07:28 AM
  4. Replies: 1
    Last Post: 10-26-2009, 04:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •