Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8875781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:03:53+00:00 2026-06-14T19:03:53+00:00

I am creating a Web Service that will handle incoming request properly (I knew,

  • 0

I am creating a Web Service that will handle incoming request properly (I knew, it is a description) I found some sample code which present SOAP WS and looks like:

    @SoapAction("some fine url")
    @ResponsePayload
    public CertResponse  getCert(@RequestPayload Cert param) 
    {...}

It takes Cert object from request and manages it properly. I want to do it in the REST approach and I changed this class to look like:

    @RequestMapping(value="getCert", method = RequestMethod.POST)
    @ResponseBody
    public CertResponse  getCert(@RequestBody Cert param) 
    {...} 

But I have no idea how or even if it is possible to write a client that can send object through HTTP Post.

Can anyone give me a hint how can i send object Cert? Or if i have to stay with @SoapAction what should I do to make it work? I guess removing @Controller is not enough.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T19:03:55+00:00Added an answer on June 14, 2026 at 7:03 pm

    In SOAP approach, there is a well defined way to convert each class object to SOAP formatted XML. Thus, there is no effort.

    If you will use RESTful approach, you have to describe how your Cert or CertResponse objects will be written to/read from the response/request.

    Basically you have three options:

    1. Use JSON or XML or plain String. Convert your Web service descriptor so that the request and response are one of those (JSON, XML, String). Then your getCert method should convert the request to Cert object, prepare your response as CertResponse object and convert it to an appropriate response type.

    2. Leave your getCert method as is. But you need to specify “how Cert objects are read from request” and “how CertResponse objects are written to response” You need to define classes that extend interfaces MessageBodyReader and MessageBodyWriter. In these classes a similar conversion logic should be implemented that converts your objects to/from JSON or XML or String.

      In any of these two options you need to implement two things : A method that converts JSON/XML/String to Cert, a method that converts CertResponse object to JSON/XML/String.

      You can do a text based implementation, which parses/constructs the request/response by text processing and uses String class only. Or you can use some library such as JSON library with JSONObject class, or Java SAX or DOM based XML libraries that come with the Java bundle.

    3. Check out for application frameworks such as Spring. They might provide ways to automatically convert your objects to JSON or XML, reducing the programming effort necessary.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm in the process of creating a web service that uses XML to handle
I am on a project where I will be creating a Web service that
I'm creating a web service in Java that will be consumed by an external
I am going to be creating a web service that will be passing confidential
I am working on creating an XSD for a web service that will take
I'm creating an XSD for common web service types that will be used in
I'm creating a web service that will return XPS documents that are queued by
I am creating a web service that will be consumed by a single client
I am creating an XML web service that passes an array of custom types.
I'm creating a .net app that manages some feeds from various web services. I've

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.