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/">
<types>
<xs:schema elementFormDefault="unqualified" targetNamespace="http://www.xyzps.com/schemas/swift/sxapi" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<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">
<xs:import namespace="http://www.xyzps.com/schemas/swift/sxapi"/>
<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"/>
<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>
* <complexType>
* <complexContent>
* <restriction base="{www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="MessageHeader">
* <complexType>
* <complexContent>
* <restriction base="{www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Type">
* <simpleType>
* <restriction base="{www.xyzps.com/schemas/swift/sxapi}SxapiString.type">
* <enumeration value="ModifyPatient"/>
* </restriction>
* </simpleType>
* </element>
* <element name="EventID" type="{www.xyzps.com/schemas/swift/sxapi}SxapiString.type"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* <choice>
* <element name="Statuses">
* <complexType>
* <complexContent>
* <restriction base="{www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Status" maxOccurs="unbounded">
* <complexType>
* <complexContent>
* <restriction base="{www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Errors" minOccurs="0">
* <complexType>
* <complexContent>
* <restriction base="{www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Error" maxOccurs="unbounded">
* <complexType>
* <complexContent>
* <restriction base="{www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Cause" minOccurs="0">
* <complexType>
* <complexContent>
* <restriction base="{www.w3.org/2001/XMLSchema}anyType">
* <attribute name="Code" type="{www.xyzps.com/schemas/swift/sxapi}SxapiString.type" />
* </restriction>
* </complexContent>
* </complexType>
* </element>
* <element name="Message">
* <complexType>
* <complexContent>
* <restriction base="{www.w3.org/2001/XMLSchema}anyType">
* <attribute name="Code" type="{www.xyzps.com/schemas/swift/sxapi}SxapiString.type" />
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* <attribute name="SystemCode" type="{www.xyzps.com/schemas/swift/sxapi}SxapiString.type" />
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* <element name="Success">
* <complexType>
* <complexContent>
* <restriction base="{www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="DataInstanceID" type="{www.xyzps.com/schemas/swift/sxapi}SxapiDataInstanceIdentifier.type"/>
* <element name="SerialChangeNumber" type="{www.xyzps.com/schemas/swift/sxapi}SxapiSerialChangeNumber.type"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </choice>
* </sequence>
* </restriction>
* </complexContent>
* </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>
* <complexType>
* <complexContent>
* <restriction base="{www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Type">
* <simpleType>
* <restriction base="{www.xyzps.com/schemas/swift/sxapi}SxapiString.type">
* <enumeration value="ModifyPatient"/>
* </restriction>
* </simpleType>
* </element>
* <element name="EventID" type="{www.xyzps.com/schemas/swift/sxapi}SxapiString.type"/>
* </sequence>
* </restriction>
* </complexContent>
* </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>
* <complexType>
* <complexContent>
* <restriction base="{www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Status" maxOccurs="unbounded">
* <complexType>
* <complexContent>
* <restriction base="{www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Errors" minOccurs="0">
* <complexType>
* <complexContent>
* <restriction base="{www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Error" maxOccurs="unbounded">
* <complexType>
* <complexContent>
* <restriction base="{www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Cause" minOccurs="0">
* <complexType>
* <complexContent>
* <restriction base="{www.w3.org/2001/XMLSchema}anyType">
* <attribute name="Code" type="{www.xyzps.com/schemas/swift/sxapi}SxapiString.type" />
* </restriction>
* </complexContent>
* </complexType>
* </element>
* <element name="Message">
* <complexType>
* <complexContent>
* <restriction base="{www.w3.org/2001/XMLSchema}anyType">
* <attribute name="Code" type="{www.xyzps.com/schemas/swift/sxapi}SxapiString.type" />
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* <attribute name="SystemCode" type="{www.xyzps.com/schemas/swift/sxapi}SxapiString.type" />
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* </restriction>
* </complexContent>
* </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>
* <complexType>
* <complexContent>
* <restriction base="{www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Errors" minOccurs="0">
* <complexType>
* <complexContent>
* <restriction base="{www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Error" maxOccurs="unbounded">
* <complexType>
* <complexContent>
* <restriction base="{www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Cause" minOccurs="0">
* <complexType>
* <complexContent>
* <restriction base="{www.w3.org/2001/XMLSchema}anyType">
* <attribute name="Code" type="{www.xyzps.com/schemas/swift/sxapi}SxapiString.type" />
* </restriction>
* </complexContent>
* </complexType>
* </element>
* <element name="Message">
* <complexType>
* <complexContent>
* <restriction base="{www.w3.org/2001/XMLSchema}anyType">
* <attribute name="Code" type="{www.xyzps.com/schemas/swift/sxapi}SxapiString.type" />
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* <attribute name="SystemCode" type="{www.xyzps.com/schemas/swift/sxapi}SxapiString.type" />
* </restriction>
* </complexContent>
* </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.
*