Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jaxb-impl-dev] How to generate desired wsdl with annotations

If this is not the proper place to post this question, please
suggest where to post it.


Using annotations on 2 classes I am trying to generate wsdl content
that looks like this

<xs:complexType name="getRecipientEligibility">
    <xs:sequence>
      <xs:element form="qualified" minOccurs="0" name="UserID" type="xs:string"/>
      <xs:element form="qualified" minOccurs="0" name="ConsumerName" type="xs:string"/>
      <xs:element form="qualified" minOccurs="0" name="RecipientEligibilityRequestInputParams">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="RecipientID" type="xs:string"/>
            <xs:element minOccurs="0" name="eligibilityBeginDt" type="xs:string"/>
            <xs:element minOccurs="0" name="eligibilityEndDt" type="xs:string"/>
            <xs:element minOccurs="0" name="RecipientEligibilityType" type="tns:recipientEligibilityType"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

-- classes ---

@WebService(name="EndpointInterface",
                  targetNamespace="http://localhost/csc-ws",
                  serviceName="RecipientCore")
public class RecipientCoreService {

    @WebMethod(operationName="getRecipientEligibility")
    @WebResult(name="RecipientEligibilityResponse",
               targetNamespace="http://localhost/csc-ws")
    public RecipientEligibilityResponse getRecipientEligibility(
            @WebParam(name="UserID",
                      targetNamespace="http://localhost/csc-ws") String userId,
            @WebParam(name="ConsumerName",
                      targetNamespace="http://localhost/csc-ws") String consumerName,
            @WebParam(name="RecipientEligibilityRequestInputParams",
                            targetNamespace="http://localhost/csc-ws") RecipientEligibilityRequestInputParams inputParams)
    {  .... code in method ...
    }

}


@XmlAccessorType(value=XmlAccessType.FIELD)
@XmlType(propOrder={"recipientID", "eligibilityBeginDt", "eligibilityEndDt", "recipientEligibilityType"})
@XmlRootElement(name = "XXXRecEligReqInputParams")
public class RecipientEligibilityRequestInputParams implements IParams {
    @XmlElement(name="RecipientID", required=true)
    protected String recipientID;
    @XmlElement(required=false)
    protected String eligibilityBeginDt;
    @XmlElement(required=false)
    protected String eligibilityEndDt;
    @XmlElement(name="RecipientEligibilityType", required=false)
    protected RecipientEligibilityType recipientEligibilityType;

    .......... getters and setters for the fields ............
}

What I get is this

  <xs:element name="XXXRecEligReqInputParams" type="tns:recipientEligibilityRequestInputParams"/>
 
  <xs:complexType name="getRecipientEligibility">
    <xs:sequence>
      <xs:element form="qualified" minOccurs="0" name="UserID" type="xs:string"/>
      <xs:element form="qualified" minOccurs="0" name="ConsumerName" type="xs:string"/>
      <xs:element form="qualified" minOccurs="0" name="RecipientEligibilityRequestInputParams"
                      type="tns:recipientEligibilityRequestInputParams"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="recipientEligibilityRequestInputParams">
    <xs:sequence>
      <xs:element name="RecipientID" type="xs:string"/>
      <xs:element minOccurs="0" name="eligibilityBeginDt" type="xs:string"/>
      <xs:element minOccurs="0" name="eligibilityEndDt" type="xs:string"/>
      <xs:element minOccurs="0" name="RecipientEligibilityType" type="tns:recipientEligibilityType"/>
    </xs:sequence>
  </xs:complexType>

Is there any way to provide annotation settings or binding file settings
to generate the desired output?

Back to the top