Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-2941

Response wrapper bean generation does not respect the @WebResult annotation

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.2.11
    • Tooling
    • None

    Description

      The namespace value of @XmlElement should be "hello/name" and name value should be "name" in the wrapp bean HelloStringResponse.java which is genererated from the following SEI:
      public class WebResultService {
      @WebMethod(operationName="helloString", action="urn:HelloString")
      @WebResult(name="name", partName="name", targetNamespace="hello/name")
      public String hello(int age)

      { return "Hello " + age + " to Web Service"; }

      }

      java2ws tool does not respect the @WebResult annotation to get the namesapce and value to generate the @XmlElement in the wrapper bean :

      @XmlRootElement(name = "helloStringResponse", namespace = "http://cxf2936.fortest.tools.cxf.apache.org/")
      @XmlAccessorType(XmlAccessType.FIELD)
      @XmlType(name = "helloStringResponse", namespace = "http://cxf2936.fortest.tools.cxf.apache.org/")

      public class HelloResponse {

      @XmlElement(name = "return")
      private java.lang.String name;

      public java.lang.String getName()

      { return this.name; }

      public void setName(java.lang.String newName)

      { this.name = newName; }

      }

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            ema Jim Ma
            ema Jim Ma
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment