I get following error.
where schema looks as below.HTML Code:00:44:51,343 DEBUG [http-8081-1] - SoapMessageDispatcher - Endpoint mapping [org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping@c9537b] maps request to endpoint [com.ats.fts.webservice.SessionEndpoint@2870b7] 00:44:51,343 DEBUG [http-8081-1] - PayloadLoggingInterceptor - Request: <ExternalRequest xmlns="http://abc.com/xyz/schemas"><EFEReqeust><UserName>TEST</UserName><Password>password</Password><MessageId>1012</MessageId><MessageTag>1234</MessageTag><MessageText>13380</MessageText></EFEReqeust></ExternalRequest> 00:44:51,343 DEBUG [http-8081-1] - SoapMessageDispatcher - Testing endpoint adapter [org.springframework.ws.server.endpoint.adapter.MessageEndpointAdapter@2b7bd9] 00:44:51,375 DEBUG [http-8081-1] - SoapMessageDispatcher - Testing endpoint exception resolver [org.springframework.ws.soap.server.endpoint.SimpleSoapExceptionResolver@419e74] 00:44:51,390 WARN [http-8081-1] - SoapMessageDispatcher - Endpoint invocation resulted in exception - responding with SOAP Fault org.springframework.oxm.jaxb.JaxbUnmarshallingFailureException: JAXB unmarshalling exception: unexpected element (uri:"http://abc.com/xyz/schemas", local:"ExternalRequest"). Expected elements are <{}ExternalRequest>; nested exception is javax.xml.bind.UnmarshalException: unexpected element (uri:"http://abc.com/xyz/schemas", local:"ExternalRequest"). Expected elements are <{}ExternalRequest> Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"http://abc.com/xyz/schemas", local:"ExternalRequest"). Expected elements are <{}ExternalRequest> at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:603) at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:244) at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:239) at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:116) at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext$DefaultRootLoader.childElement(UnmarshallingContext.java:1009) at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:446) at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:427) at com.sun.xml.bind.v2.runtime.unmarshaller.ValidatingUnmarshaller.startElement(ValidatingUnmarshaller.java:90) at com.sun.xml.bind.v2.runtime.unmarshaller.InterningXmlVisitor.startElement(InterningXmlVisitor.java:71) at com.sun.xml.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:137)
And I generated classes using xjc. here is how XML request string is being composed from client code.HTML Code:<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cfts="http://abc.com/xyz/schemas" elementFormDefault="qualified" targetNamespace="http://abc.com/xyz/schemas"> <xs:element name="ExternalRequest"> <xs:complexType> <xs:all> <xs:element name="EFEReqeust" type="cfts:EFERequestType"/> </xs:all> </xs:complexType> </xs:element> <xs:complexType name="EFERequestType"> <xs:sequence> <xs:element name="UserName" type="xs:string"/> <xs:element name="Password" type="xs:string"/> <xs:element name="MessageId" type="xs:string"/> <xs:element name="MessageTag" type="xs:string"/> <xs:element name="MessageText" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:schema>
Any idea what is wrong in here?HTML Code:private static final String MESSAGE = "<ExternalRequest xmlns=\"http://abc.com/xyz/schemas\"><EFEReqeust>"+ "<UserName>User</UserName>"+ "<Password>password</Password>"+ "<MessageId>1012</MessageId>"+ "<MessageTag>1234</MessageTag>"+ "<MessageText>13380</MessageText>"+ "</EFEReqeust></ExternalRequest>";
Thanks,


Reply With Quote
