views:

471

answers:

1

Update: I checked the JBoss log and found the following errors:

2009-10-28 10:21:34,472 ERROR [org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler] (main) JBossWS_ejb.uhandler.pds.hsc.xyzis.com_8603663089732759450.xsd[domain:http://www.w3.org/TR/xml-schema-1]::[key=src-resolve]::Message=src-resolve: Cannot resolve the name 'ns1:MessageHeader' to a(n) 'element declaration' component.
2009-10-28 10:21:34,474 ERROR [org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler] (main) JBossWS_ejb.uhandler.pds.hsc.xyzis.com_8603663089732759450.xsd[domain:http://www.w3.org/TR/xml-schema-1]::[key=src-resolve]::Message=src-resolve: Cannot resolve the name 'ns1:Statuses' to a(n) 'element declaration' component.
2009-10-28 10:21:34,475 ERROR [org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler] (main) JBossWS_ejb.uhandler.pds.hsc.xyzis.com_8603663089732759450.xsd[domain:http://www.w3.org/TR/xml-schema-1]::[key=src-resolve]::Message=src-resolve: Cannot resolve the name 'ns1:Success' to a(n) 'element declaration' component.

My environment is

       JBOSS 5.1, JDK 1.6

I am getting an error "ns1:MessageHeader" must refer to an existing element when I tried to access the webservice, the below is the wsdl generated by EJB3. Can someone please help me to identify the problem, I am a newbie to Webservices and JAXB.

I have the below EJB3 web service.

package com.xyzis.hsc.pds.uhandler.ejb;

import javax.ejb.Stateless;
import javax.jws.WebMethod;
import javax.jws.WebService;

import org.jboss.logging.Logger;

import com.xyzis.hsc.pds.uhandler.endpoint.response.UpdatePersonResponse;

/**
 * Session Bean implementation class PDSResponseEJB
 * WSDL: http://127.0.0.1:8080/pds-uhandler-ear-pds-update-handler-ejb/PDSResponseEJB?wsdl
 */
@Stateless
@WebService(
  endpointInterface="com.xyzis.hsc.pds.uhandler.ejb.UpdatePersonResponseEJBRemote", 
  targetNamespace="http://www.xyz-is.com/hsc/pds/uhandler/pdsresponse"
   )

public class UpdatePersonResponseEJB implements UpdatePersonResponseEJBRemote, UpdatePersonResponseEJBLocal {

    /**
     * Default constructor. 
     */
 Logger logger = Logger.getLogger(UpdatePersonResponseEJB.class);
    public UpdatePersonResponseEJB() {
        // TODO Auto-generated constructor stub

    }

    @WebMethod
 public void push(UpdatePersonResponse response) {
  //TODO send the response to the respective process. 
     logger.info("Received Response");
 }
}

    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://www.xyzps.com/schemas/swift/sxapi" xmlns:ns2="http://ejb.uhandler.pds.hsc.xyzis.com/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.xyz-is.com/hsc/pds/uhandler/pdsresponse" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" name="PDSResponseWebService" targetNamespace="http://ejb.uhandler.pds.hsc.xyzis.com/"&gt;
 <types>
  <xs:schema elementFormDefault="unqualified" targetNamespace="http://www.xyzps.com/schemas/swift/sxapi" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
   <xs:element name="UpdatePersonResponse">
    <xs:complexType>
     <xs:sequence>
      <xs:element name="MessageHeader">
       <xs:complexType>
        <xs:sequence>
         <xs:element name="Type" type="xs:string"/>
         <xs:element name="EventID" type="xs:string"/>
        </xs:sequence>
       </xs:complexType>
      </xs:element>
      <xs:element minOccurs="0" name="Statuses">
       <xs:complexType>
        <xs:sequence>
         <xs:element maxOccurs="unbounded" name="Status">
          <xs:complexType>
           <xs:sequence>
            <xs:element minOccurs="0" name="Errors">
             <xs:complexType>
              <xs:sequence>
               <xs:element maxOccurs="unbounded" name="Error">
                <xs:complexType>
                 <xs:sequence>
                  <xs:element minOccurs="0" name="Cause">
                   <xs:complexType>
                    <xs:sequence/>
                    <xs:attribute name="Code" type="xs:string"/>
                   </xs:complexType>
                  </xs:element>
                  <xs:element name="Message">
                   <xs:complexType>
                    <xs:sequence/>
                    <xs:attribute name="Code" type="xs:string"/>
                   </xs:complexType>
                  </xs:element>
                 </xs:sequence>
                </xs:complexType>
               </xs:element>
              </xs:sequence>
             </xs:complexType>
            </xs:element>
           </xs:sequence>
           <xs:attribute name="SystemCode" type="xs:string"/>
          </xs:complexType>
         </xs:element>
        </xs:sequence>
       </xs:complexType>
      </xs:element>
      <xs:element minOccurs="0" name="Success">
       <xs:complexType>
        <xs:sequence>
         <xs:element name="DataInstanceID" type="xs:string"/>
         <xs:element name="SerialChangeNumber" type="xs:decimal"/>
        </xs:sequence>
       </xs:complexType>
      </xs:element>
     </xs:sequence>
    </xs:complexType>
   </xs:element>
  </xs:schema>
  <xs:schema targetNamespace="http://ejb.uhandler.pds.hsc.xyzis.com/" version="1.0" xmlns:ns1="http://www.xyzps.com/schemas/swift/sxapi" xmlns:tns="http://ejb.uhandler.pds.hsc.xyzis.com/" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
   <xs:import namespace="http://www.xyzps.com/schemas/swift/sxapi"/&gt;
   <xs:element name="push" type="tns:push"/>
   <xs:element name="pushResponse" type="tns:pushResponse"/>
   <xs:complexType name="push">
    <xs:sequence>
     <xs:element minOccurs="0" name="arg0">
      <xs:complexType>
       <xs:sequence>
        <xs:element ref="ns1:MessageHeader"/>
        <xs:element minOccurs="0" ref="ns1:Statuses"/>
        <xs:element minOccurs="0" ref="ns1:Success"/>
       </xs:sequence>
      </xs:complexType>
     </xs:element>
    </xs:sequence>
   </xs:complexType>
   <xs:complexType name="pushResponse">
    <xs:sequence/>
   </xs:complexType>
  </xs:schema>
 </types>
 <message name="UpdatePersonResponseEJBRemote_pushResponse">
  <part name="pushResponse" element="ns2:pushResponse"/>
 </message>
 <message name="UpdatePersonResponseEJBRemote_push">
  <part name="push" element="ns2:push"/>
 </message>
 <portType name="UpdatePersonResponseEJBRemote">
  <operation name="push" parameterOrder="push">
   <input message="ns2:UpdatePersonResponseEJBRemote_push"/>
   <output message="ns2:UpdatePersonResponseEJBRemote_pushResponse"/>
  </operation>
 </portType>
 <binding name="UpdatePersonResponseEJBRemoteBinding" type="ns2:UpdatePersonResponseEJBRemote">
  <soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/&gt;
  <operation name="push">
   <soap12:operation soapAction="" soapActionRequired="true"/>
   <input>
    <soap12:body use="literal"/>
   </input>
   <output>
    <soap12:body use="literal"/>
   </output>
  </operation>
 </binding>
</definitions>

The following is the class generated by JAXB from a xsd file:

//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
// See <a href="java.sun.com/xml/jaxb">java.sun.com/xml/jaxb</a> 
// Any modifications to this file will be lost upon recompilation of the source schema. 
// Generated on: 2009.10.27 at 03:51:48 PM GMT 
//


package com.xyzis.hsc.pds.uhandler.endpoint.response;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;


/**
 * Output values of PersonDetail Update. Alerts Node added (10-07-2003)
 * 
 * <p>Java class for anonymous complex type.
 * 
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType>
 *   &lt;complexContent>
 *     &lt;restriction base="{www.w3.org/2001/XMLSchema}anyType">
 *       &lt;sequence>
 *         &lt;element name="MessageHeader">
 *           &lt;complexType>
 *             &lt;complexContent>
 *               &lt;restriction base="{www.w3.org/2001/XMLSchema}anyType">
 *                 &lt;sequence>
 *                   &lt;element name="Type">
 *                     &lt;simpleType>
 *                       &lt;restriction base="{www.xyzps.com/schemas/swift/sxapi}SxapiString.type">
 *                         &lt;enumeration value="ModifyPatient"/>
 *                       &lt;/restriction>
 *                     &lt;/simpleType>
 *                   &lt;/element>
 *                   &lt;element name="EventID" type="{www.xyzps.com/schemas/swift/sxapi}SxapiString.type"/>
 *                 &lt;/sequence>
 *               &lt;/restriction>
 *             &lt;/complexContent>
 *           &lt;/complexType>
 *         &lt;/element>
 *         &lt;choice>
 *           &lt;element name="Statuses">
 *             &lt;complexType>
 *               &lt;complexContent>
 *                 &lt;restriction base="{www.w3.org/2001/XMLSchema}anyType">
 *                   &lt;sequence>
 *                     &lt;element name="Status" maxOccurs="unbounded">
 *                       &lt;complexType>
 *                         &lt;complexContent>
 *                           &lt;restriction base="{www.w3.org/2001/XMLSchema}anyType">
 *                             &lt;sequence>
 *                               &lt;element name="Errors" minOccurs="0">
 *                                 &lt;complexType>
 *                                   &lt;complexContent>
 *                                     &lt;restriction base="{www.w3.org/2001/XMLSchema}anyType">
 *                                       &lt;sequence>
 *                                         &lt;element name="Error" maxOccurs="unbounded">
 *                                           &lt;complexType>
 *                                             &lt;complexContent>
 *                                               &lt;restriction base="{www.w3.org/2001/XMLSchema}anyType">
 *                                                 &lt;sequence>
 *                                                   &lt;element name="Cause" minOccurs="0">
 *                                                     &lt;complexType>
 *                                                       &lt;complexContent>
 *                                                         &lt;restriction base="{www.w3.org/2001/XMLSchema}anyType">
 *                                                           &lt;attribute name="Code" type="{www.xyzps.com/schemas/swift/sxapi}SxapiString.type" />
 *                                                         &lt;/restriction>
 *                                                       &lt;/complexContent>
 *                                                     &lt;/complexType>
 *                                                   &lt;/element>
 *                                                   &lt;element name="Message">
 *                                                     &lt;complexType>
 *                                                       &lt;complexContent>
 *                                                         &lt;restriction base="{www.w3.org/2001/XMLSchema}anyType">
 *                                                           &lt;attribute name="Code" type="{www.xyzps.com/schemas/swift/sxapi}SxapiString.type" />
 *                                                         &lt;/restriction>
 *                                                       &lt;/complexContent>
 *                                                     &lt;/complexType>
 *                                                   &lt;/element>
 *                                                 &lt;/sequence>
 *                                               &lt;/restriction>
 *                                             &lt;/complexContent>
 *                                           &lt;/complexType>
 *                                         &lt;/element>
 *                                       &lt;/sequence>
 *                                     &lt;/restriction>
 *                                   &lt;/complexContent>
 *                                 &lt;/complexType>
 *                               &lt;/element>
 *                             &lt;/sequence>
 *                             &lt;attribute name="SystemCode" type="{www.xyzps.com/schemas/swift/sxapi}SxapiString.type" />
 *                           &lt;/restriction>
 *                         &lt;/complexContent>
 *                       &lt;/complexType>
 *                     &lt;/element>
 *                   &lt;/sequence>
 *                 &lt;/restriction>
 *               &lt;/complexContent>
 *             &lt;/complexType>
 *           &lt;/element>
 *           &lt;element name="Success">
 *             &lt;complexType>
 *               &lt;complexContent>
 *                 &lt;restriction base="{www.w3.org/2001/XMLSchema}anyType">
 *                   &lt;sequence>
 *                     &lt;element name="DataInstanceID" type="{www.xyzps.com/schemas/swift/sxapi}SxapiDataInstanceIdentifier.type"/>
 *                     &lt;element name="SerialChangeNumber" type="{www.xyzps.com/schemas/swift/sxapi}SxapiSerialChangeNumber.type"/>
 *                   &lt;/sequence>
 *                 &lt;/restriction>
 *               &lt;/complexContent>
 *             &lt;/complexType>
 *           &lt;/element>
 *         &lt;/choice>
 *       &lt;/sequence>
 *     &lt;/restriction>
 *   &lt;/complexContent>
 * &lt;/complexType>
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "messageHeader",
    "statuses",
    "success"
})
@XmlRootElement(name = "UpdatePersonResponse")
public class UpdatePersonResponse {

    @XmlElement(name = "MessageHeader", required = true)
    protected UpdatePersonResponse.MessageHeader messageHeader;
    @XmlElement(name = "Statuses")
    protected UpdatePersonResponse.Statuses statuses;
    @XmlElement(name = "Success")
    protected UpdatePersonResponse.Success success;

    /**
     * Gets the value of the messageHeader property.
     * 
     * @return
     *     possible object is
     *     {@link UpdatePersonResponse.MessageHeader }
     *     
     */
    public UpdatePersonResponse.MessageHeader getMessageHeader() {
        return messageHeader;
    }

    /**
     * Sets the value of the messageHeader property.
     * 
     * @param value
     *     allowed object is
     *     {@link UpdatePersonResponse.MessageHeader }
     *     
     */
    public void setMessageHeader(UpdatePersonResponse.MessageHeader value) {
        this.messageHeader = value;
    }

    /**
     * Gets the value of the statuses property.
     * 
     * @return
     *     possible object is
     *     {@link UpdatePersonResponse.Statuses }
     *     
     */
    public UpdatePersonResponse.Statuses getStatuses() {
        return statuses;
    }

    /**
     * Sets the value of the statuses property.
     * 
     * @param value
     *     allowed object is
     *     {@link UpdatePersonResponse.Statuses }
     *     
     */
    public void setStatuses(UpdatePersonResponse.Statuses value) {
        this.statuses = value;
    }

    /**
     * Gets the value of the success property.
     * 
     * @return
     *     possible object is
     *     {@link UpdatePersonResponse.Success }
     *     
     */
    public UpdatePersonResponse.Success getSuccess() {
        return success;
    }

    /**
     * Sets the value of the success property.
     * 
     * @param value
     *     allowed object is
     *     {@link UpdatePersonResponse.Success }
     *     
     */
    public void setSuccess(UpdatePersonResponse.Success value) {
        this.success = value;
    }


    /**
     * <p>Java class for anonymous complex type.
     * 
     * <p>The following schema fragment specifies the expected content contained within this class.
     * 
     * <pre>
     * &lt;complexType>
     *   &lt;complexContent>
     *     &lt;restriction base="{www.w3.org/2001/XMLSchema}anyType">
     *       &lt;sequence>
     *         &lt;element name="Type">
     *           &lt;simpleType>
     *             &lt;restriction base="{www.xyzps.com/schemas/swift/sxapi}SxapiString.type">
     *               &lt;enumeration value="ModifyPatient"/>
     *             &lt;/restriction>
     *           &lt;/simpleType>
     *         &lt;/element>
     *         &lt;element name="EventID" type="{www.xyzps.com/schemas/swift/sxapi}SxapiString.type"/>
     *       &lt;/sequence>
     *     &lt;/restriction>
     *   &lt;/complexContent>
     * &lt;/complexType>
     * </pre>
     * 
     * 
     */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {
        "type",
        "eventID"
    })
    public static class MessageHeader {

        @XmlElement(name = "Type", required = true)
        protected String type;
        @XmlElement(name = "EventID", required = true)
        protected String eventID;

        /**
         * Gets the value of the type property.
         * 
         * @return
         *     possible object is
         *     {@link String }
         *     
         */
        public String getType() {
            return type;
        }

        /**
         * Sets the value of the type property.
         * 
         * @param value
         *     allowed object is
         *     {@link String }
         *     
         */
        public void setType(String value) {
            this.type = value;
        }

        /**
         * Gets the value of the eventID property.
         * 
         * @return
         *     possible object is
         *     {@link String }
         *     
         */
        public String getEventID() {
            return eventID;
        }

        /**
         * Sets the value of the eventID property.
         * 
         * @param value
         *     allowed object is
         *     {@link String }
         *     
         */
        public void setEventID(String value) {
            this.eventID = value;
        }

    }


    /**
     * <p>Java class for anonymous complex type.
     * 
     * <p>The following schema fragment specifies the expected content contained within this class.
     * 
     * <pre>
     * &lt;complexType>
     *   &lt;complexContent>
     *     &lt;restriction base="{www.w3.org/2001/XMLSchema}anyType">
     *       &lt;sequence>
     *         &lt;element name="Status" maxOccurs="unbounded">
     *           &lt;complexType>
     *             &lt;complexContent>
     *               &lt;restriction base="{www.w3.org/2001/XMLSchema}anyType">
     *                 &lt;sequence>
     *                   &lt;element name="Errors" minOccurs="0">
     *                     &lt;complexType>
     *                       &lt;complexContent>
     *                         &lt;restriction base="{www.w3.org/2001/XMLSchema}anyType">
     *                           &lt;sequence>
     *                             &lt;element name="Error" maxOccurs="unbounded">
     *                               &lt;complexType>
     *                                 &lt;complexContent>
     *                                   &lt;restriction base="{www.w3.org/2001/XMLSchema}anyType">
     *                                     &lt;sequence>
     *                                       &lt;element name="Cause" minOccurs="0">
     *                                         &lt;complexType>
     *                                           &lt;complexContent>
     *                                             &lt;restriction base="{www.w3.org/2001/XMLSchema}anyType">
     *                                               &lt;attribute name="Code" type="{www.xyzps.com/schemas/swift/sxapi}SxapiString.type" />
     *                                             &lt;/restriction>
     *                                           &lt;/complexContent>
     *                                         &lt;/complexType>
     *                                       &lt;/element>
     *                                       &lt;element name="Message">
     *                                         &lt;complexType>
     *                                           &lt;complexContent>
     *                                             &lt;restriction base="{www.w3.org/2001/XMLSchema}anyType">
     *                                               &lt;attribute name="Code" type="{www.xyzps.com/schemas/swift/sxapi}SxapiString.type" />
     *                                             &lt;/restriction>
     *                                           &lt;/complexContent>
     *                                         &lt;/complexType>
     *                                       &lt;/element>
     *                                     &lt;/sequence>
     *                                   &lt;/restriction>
     *                                 &lt;/complexContent>
     *                               &lt;/complexType>
     *                             &lt;/element>
     *                           &lt;/sequence>
     *                         &lt;/restriction>
     *                       &lt;/complexContent>
     *                     &lt;/complexType>
     *                   &lt;/element>
     *                 &lt;/sequence>
     *                 &lt;attribute name="SystemCode" type="{www.xyzps.com/schemas/swift/sxapi}SxapiString.type" />
     *               &lt;/restriction>
     *             &lt;/complexContent>
     *           &lt;/complexType>
     *         &lt;/element>
     *       &lt;/sequence>
     *     &lt;/restriction>
     *   &lt;/complexContent>
     * &lt;/complexType>
     * </pre>
     * 
     * 
     */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {
        "status"
    })
    public static class Statuses {

        @XmlElement(name = "Status", required = true)
        protected List<UpdatePersonResponse.Statuses.Status> status;

        /**
         * Gets the value of the status property.
         * 
         * <p>
         * This accessor method returns a reference to the live list,
         * not a snapshot. Therefore any modification you make to the
         * returned list will be present inside the JAXB object.
         * This is why there is not a <CODE>set</CODE> method for the status property.
         * 
         * <p>
         * For example, to add a new item, do as follows:
         * <pre>
         *    getStatus().add(newItem);
         * </pre>
         * 
         * 
         * <p>
         * Objects of the following type(s) are allowed in the list
         * {@link UpdatePersonResponse.Statuses.Status }
         * 
         * 
         */
        public List<UpdatePersonResponse.Statuses.Status> getStatus() {
            if (status == null) {
                status = new ArrayList<UpdatePersonResponse.Statuses.Status>();
            }
            return this.status;
        }


        /**
         * <p>Java class for anonymous complex type.
         * 
         * <p>The following schema fragment specifies the expected content contained within this class.
         * 
         * <pre>
         * &lt;complexType>
         *   &lt;complexContent>
         *     &lt;restriction base="{www.w3.org/2001/XMLSchema}anyType">
         *       &lt;sequence>
         *         &lt;element name="Errors" minOccurs="0">
         *           &lt;complexType>
         *             &lt;complexContent>
         *               &lt;restriction base="{www.w3.org/2001/XMLSchema}anyType">
         *                 &lt;sequence>
         *                   &lt;element name="Error" maxOccurs="unbounded">
         *                     &lt;complexType>
         *                       &lt;complexContent>
         *                         &lt;restriction base="{www.w3.org/2001/XMLSchema}anyType">
         *                           &lt;sequence>
         *                             &lt;element name="Cause" minOccurs="0">
         *                               &lt;complexType>
         *                                 &lt;complexContent>
         *                                   &lt;restriction base="{www.w3.org/2001/XMLSchema}anyType">
         *                                     &lt;attribute name="Code" type="{www.xyzps.com/schemas/swift/sxapi}SxapiString.type" />
         *                                   &lt;/restriction>
         *                                 &lt;/complexContent>
         *                               &lt;/complexType>
         *                             &lt;/element>
         *                             &lt;element name="Message">
         *                               &lt;complexType>
         *                                 &lt;complexContent>
         *                                   &lt;restriction base="{www.w3.org/2001/XMLSchema}anyType">
         *                                     &lt;attribute name="Code" type="{www.xyzps.com/schemas/swift/sxapi}SxapiString.type" />
         *                                   &lt;/restriction>
         *                                 &lt;/complexContent>
         *                               &lt;/complexType>
         *                             &lt;/element>
         *                           &lt;/sequence>
         *                         &lt;/restriction>
         *                       &lt;/complexContent>
         *                     &lt;/complexType>
         *                   &lt;/element>
         *                 &lt;/sequence>
         *               &lt;/restriction>
         *             &lt;/complexContent>
         *           &lt;/complexType>
         *         &lt;/element>
         *       &lt;/sequence>
         *       &lt;attribute name="SystemCode" type="{www.xyzps.com/schemas/swift/sxapi}SxapiString.type" />
         *     &lt;/restriction>
         *   &lt;/complexContent>
         * &lt;/complexType>
         * </pre>
         * 
         * 
         */
        @XmlAccessorType(XmlAccessType.FIELD)
        @XmlType(name = "", propOrder = {
            "errors"
        })
        public static class Status {

            @XmlElement(name = "Errors")
            protected UpdatePersonResponse.Statuses.Status.Errors errors;
            @XmlAttribute(name = "SystemCode")
            protected String systemCode;

            /**
             * Gets the value of the errors property.
             * 
A: 

Have you finally found a solution to your problem? Got the same one.

PomCompot
Hi, I removed all the generated annotations from the UpdatePersonResponse class and manually added them and it worked fine, sorry didn't had time to go through why and how it happened, I believe it has something to do with the code generation in JAXB.Regards,Venkat
Venkat