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 6054501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:09:36+00:00 2026-05-23T08:09:36+00:00

I am creating some services using JAX-RS that need to take in arbitrarily complex

  • 0

I am creating some services using JAX-RS that need to take in arbitrarily complex objects as arguments, not just primitives like integers and strings. A discussion on the CXF mailing list says to just use a wrapper object as a single parameter in this case.

My concern is how to document the input format to the service? If creating a service that looks something like the following:

@POST
@Produces("application/json")
@Consumes("application/json")
@Path("oneParam")
public ComplexObject2 myServiceMethod(ComplexObject1 obj) {
    Foo f = obj.foo
    Bar b = obj.bar
    ...
}

the auto-generated WADL that CXF produces will only produce the following:

<resource path="/oneParam">
   <method name="POST">
      <request>
            <representation mediaType="application/json"/>
      </request>
      <response>
             <representation mediaType="application/json"/>
       </response>
   </method>
</resource> 

This contains no information on what the request or response actually contains. Sergey on the CXF mailing list said it was possible to link a schema to the representation, but how am I supposed to do that? And how do I create the XSD?

(P.S. Using POST for idempotent resources might not be RESTful, but it’s not important here as we are in essence doing RPC using Json. This is more or less a 1:1 clone of an existing SOAP based api.)

  • 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-05-23T08:09:37+00:00Added an answer on May 23, 2026 at 8:09 am

    It is possible to link an XSD file into a WADL file and then to reference an XML element in the representation for requests and responses. However, as it is XML schema it doesn’t apply to JSON representations.

    To link an XSD into a WADL file, create a grammars element at the top of the file before the main resources element.

    <grammars>
        <include href="myapp.xsd"/>
    </grammars>
    

    Then add a reference to an XML element as follows (using a modified version of your example):

    <resource path="/oneParam">
       <method name="POST">
          <request>
                <representation mediaType="application/xml" element="myapp:oneParamRequest" />
          </request>
          <response>
                 <representation mediaType="application/xml" element="myapp:oneParamResponse" />
           </response>
       </method>
    </resource>
    

    The prefix myapp is defined in the XSD and can be used in the WADL file as well.

    I don’t know to to configure CXF to do this automatically. My experience with Jersey is similar and we use the generated WADL as a starting point for hand-editing later.

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

Sidebar

Related Questions

I'm creating some web services using JAX-WS and the java SE build-in server. Every
I'm just getting into creating some WCF services, but I have a requirement to
I have some web services and I am creating a web client using ws-import.
We are creating some WCF services that will initially be consumed by .NET clients
I am creating some web services which I would like to secure using a
I am new to MySQL. I am creating some web services using MySQL but
I am creating some build scripts that interact with Perforce and I would like
I'm creating some text boxes on my form programmatically which I need to reference
I am considering creating some JSP-tags that will always give the same output. For
I'm creating some big files (DB exports) with Java and I need to put

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.