On Tue, Dec 30, 2008 at 11:46 PM, Nateshan Soundarapandian < nates...@gmail.com> wrote:
> Dear Deepal, > > Thanks for the response. NO, The server side code is not Axis2. However the > server side code returns the soap envelope that conforms to the Schema > defined in the wsdl. > > This problem is related to sequences defined in the xsd. > > > Here is what I defined in the Response schema: > <xs:element name="ContactNumbers" minOccurs="0"> > <xs:complexType> > <xs:sequence> > <xs:element name="ContactNumber" > type="TelephoneInfoType" minOccurs="0" maxOccurs="unbounded"> > <xs:annotation> > <xs:documentation xml:lang="en">Contact > numbers of the hotel property. Examples are telephone and fax > numbers.</xs:documentation> > </xs:annotation> > </xs:element> > </xs:sequence> > </xs:complexType> > > Here is the Response: > <ContactNumbers> > <ContactNumber PhoneNumber="1-305-4469000" PhoneTechType="1" > PhoneUseType="5"/> > <ContactNumber PhoneNumber="1-305-4471189" PhoneTechType="3" > PhoneUseType="5"/> > </ContactNumbers> try with this code String newString = "<ContactNumbers xmlns=\" http://www.opentravel.org/OTA/2003/05\">\n" + "<ContactNumber PhoneNumber=\"1-305-4469000\" PhoneTechType=\"1\" PhoneUseType=\"5\"/>\n" + "<ContactNumber PhoneNumber=\"1-305-4471189\" PhoneTechType=\"3\" PhoneUseType=\"5\"/>\n" + "</ContactNumbers>"; XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(newString.getBytes())); ContactNumbers_type0 result = ContactNumbers_type0.Factory.parse(xmlReader); what is the Axis2 version you use? thanks, Amila. > > > Exception: > org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: > Unexpected subelement ContactNumber > at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430) > at org.opentravel. > www.ota._2003._05.HotelAvailabilityStub.fromOM(HotelAvailabilityStub.java:363)<http://www.ota._2003._05.hotelavailabilitystub.fromom%28hotelavailabilitystub.java:363/> > at org.opentravel. > www.ota._2003._05.HotelAvailabilityStub.HotelAvailabilityOperation(HotelAvailabilityStub.java:191)<http://www.ota._2003._05.hotelavailabilitystub.hotelavailabilityoperation%28hotelavailabilitystub.java:191/> > at > com.ihg.ws.cxf.servlets.HotelAvailability.doGet(HotelAvailability.java:211) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:114) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:91) > at > com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103) > > at > com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:187) > > at > com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:266) > > at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:270) > at com.caucho.server.port.TcpConnection.run(TcpConnection.java:678) > at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:721) > at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:643) > at java.lang.Thread.run(Thread.java:595) > > Please note: Iam not posting all the schema information here as they are > huge. > > > Many Thanks, > nateshan > > > > On Tue, Dec 30, 2008 at 1:08 PM, Deepal Jayasinghe > <dee...@opensource.lk>wrote: > >> How about the server side code? is it also Axis2? >> >> You get this error when you receive a message which is not correct >> according to its WSDL. >> >> Deepal >> > Hi, >> > >> > I am new to Axis2. I am having some trouble with the Axis Client code >> > that was generated using Axis2 Release 1.4.1. However I wanted to try >> > with the nightly builds to see if the problem has been fixed as I see >> > so many bug reports on Axis2/ADB UnExpected Sublement errors. >> > >> > Please advice on where I can download Axis2/Java nightly builds, The >> > Axis2 Website only points to a directory where only Axis2/C Nightly >> > downloads are available. >> > >> > Many Thanks, >> > Nateshan Soundarapandian >> > Amutech Business Solutions Inc >> > Mobile:(813) 579-0326 >> > Fax: (919) 882-1737 >> >> -- >> Thank you! >> >> >> http://blogs.deepal.org >> http://deepal.org >> >> > -- Amila Suriarachchi WSO2 Inc. blog: http://amilachinthaka.blogspot.com/