-
Dec 14th, 2010, 08:49 AM
#1
Does your endpoint implement a supported interface like MessageHandler or PayloadEndp
getting this error (Does your endpoint implement a supported interface like MessageHandler or PayloadEndpoint) while accessing webservice
Original XSD
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.usfood.com/searchPerson/schema" xmlns:tns="http://www.usfood.com/searchPerson/schema"
elementFormDefault="qualified" xmlns:Qperson="http://www.usfood.com/searchPerson/schema">
<xs:element name="searchPersonRequest" type="Qperson: searchPersonRequesType">
</xs:element>
<xs:element name="searchPersonResponse" type="Qperson: searchPersonResponseType">
<xs:annotation>
<xs:documentation>Comment describing your root element
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="searchPersonRequesType">
<xs:sequence>
<xs:element name="person" type="Qperson: person" />
<xs:element name="userName" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="searchPersonResponseType">
<xs:sequence>
<xs:element name="personList" type="Qperson: person"
minOccurs="1" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="person">
<xs:sequence>
<xs:element name="perAddress" type="xs:string" />
<xs:element name="perEmail" type="xs:string" />
<xs:element name="perID" type="xs:string" />
<xs:element name="perName" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:schema>
@EndPoint
@PayloadRoot(localPart = "searchPersonRequest", namespace = "http://www.usfood.com/searchPerson/schema")
public SearchPersonResponseType searchPerson(SearchPersonRequesType empRequest) {
SearchPersonResponseType perResponse = JAXB_OBJECT_PERSON_FACTORY
.createSearchPersonResponseType();
List<Person> persons = new ArrayList<Person>();
Person person = new Person();
person.setPerAddress("per address");
person.setPerEmail("per email");
person.setPerID("per id");
person.setPerName("per name");
persons.add(person);
perResponse.getPersonList().addAll(persons);
return perResponse;
}
If i modify my above xsd which is given below
Modified XSD
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.usfood.com/searchPerson/schema" xmlns:tns="http://www.usfood.com/searchPerson/schema"
elementFormDefault="qualified" xmlns:Qperson="http://www.usfood.com/searchPerson/schema">
<xs:element name="searchPersonRequest" >
<xs:complexType >
<xs:sequence>
<xs:element name="person" type="Qperson: person" />
<xs:element name="userName" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="searchPersonResponse" >
<xs:complexType >
<xs:sequence>
<xs:element name="personList" type="Qperson: person"
minOccurs="1" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="person">
<xs:sequence>
<xs:element name="perAddress" type="xs:string" />
<xs:element name="perEmail" type="xs:string" />
<xs:element name="perID" type="xs:string" />
<xs:element name="perName" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:schema>
@EndPoint
@PayloadRoot(localPart = "searchPersonRequest", namespace = "http://www.usfood.com/searchPerson/schema")
public SearchPersonResponse searchPerson(SearchPersonRequest empRequest) {
SearchPersonResponse perResponse = JAXB_OBJECT_PERSON_FACTORY
.createSearchPersonResponse();
List<Person> persons = new ArrayList<Person>();
Person person = new Person();
person.setPerAddress("per address");
person.setPerEmail("per email");
person.setPerID("per id");
person.setPerName("per name");
persons.add(person);
perResponse.getPersonList().addAll(persons);
return perResponse;
}
then it works fine for me
But i have to stick to my original xsd
what need to be done to work with original xsd ?
please help me
Last edited by mannu4ll; Dec 14th, 2010 at 10:24 PM.
Reason: added more information
-
Dec 15th, 2010, 03:36 AM
#2
got the solution
-
May 12th, 2011, 02:30 AM
#3
Does your endpoint implement a supported interface like MessageHandler or PayloadEndp
It is XSD related issue, you need to correct your XSD. Generally when you are playing with JAXB, this problem will occur , you must need to define request and response correctly.
-
May 12th, 2011, 02:36 AM
#4
This issue is resolved. For example if your input request element is 'InsertPremiumRequest' so need to define like
<xs:element name="InsertRequest">
<xs:annotation>
<xs:documentation>Root element for Record Insert Request</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="GeneralDetails" type="tns:GenralDetailsType"></xs:element>
<xs:element name="FullDetails" type="tns:FullDetailsType"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
---------------
Previously i was defined this as mention below:- so when i am creating JAXB beans it always create two elements for this, which element (InsertRequest or InsertRequestType) need to refer in endpoint, this was the issue.
<element name="InsertRequest" type="tns:InsertRequestType"></element>
<complexType name="InsertRequestType">
<sequence>
<element name="GeneralDetails" type="tns:GenralDetailsType"></element>
<element name="FullDetails" type="tns:FullDetailsType"></element>
</sequence>
</complexType>
-
May 12th, 2011, 02:37 AM
#5
Does your endpoint implement a supported interface like MessageHandle
This issue is resolved. For example if your input request element is 'InsertRequest' so need to define like
<xs:element name="InsertRequest">
<xs:annotation>
<xs:documentation>Root element for Record Insert Request</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="GeneralDetails" type="tns:GenralDetailsType"></xs:element>
<xs:element name="FullDetails" type="tns:FullDetailsType"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
---------------
Previously i was defined this as mention below:- so when i am creating JAXB beans it always create two elements for this, which element (InsertRequest or InsertRequestType) need to refer in endpoint, this was the issue.
<element name="InsertRequest" type="tns:InsertRequestType"></element>
<complexType name="InsertRequestType">
<sequence>
<element name="GeneralDetails" type="tns:GenralDetailsType"></element>
<element name="FullDetails" type="tns:FullDetailsType"></element>
</sequence>
</complexType>
Last edited by vjain143; May 12th, 2011 at 02:40 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules