Results 1 to 5 of 5

Thread: Does your endpoint implement a supported interface like MessageHandler or PayloadEndp

  1. #1
    Join Date
    Dec 2010
    Posts
    6

    Default 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

  2. #2
    Join Date
    Dec 2010
    Posts
    6

    Default

    got the solution

  3. #3

    Smile 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.

  4. #4

    Default

    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>

  5. #5

    Smile 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
  •