You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "fang yao (Commented) (JIRA)" <ji...@apache.org> on 2011/11/23 12:29:40 UTC

[jira] [Commented] (AXIS2-4191) Axis2 Generated Client: UnExpected SubElement error while processing Response.

    [ https://issues.apache.org/jira/browse/AXIS2-4191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13155814#comment-13155814 ] 

fang yao commented on AXIS2-4191:
---------------------------------

could you sure the bug is fixed?
i can see the problem in 1.6.0
and i can not find how to resolve 

I need help

regards
                
> Axis2 Generated Client: UnExpected SubElement error while processing Response.
> ------------------------------------------------------------------------------
>
>                 Key: AXIS2-4191
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4191
>             Project: Axis2
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.4.1
>         Environment: Windows Vista
>            Reporter: Nateshan Soundarapandian
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Critical
>         Attachments: FS_OTA_HotelAvailRQ.xsd, FS_OTA_HotelAvailRS.xsd, HotelAvailability.wsdl
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Axis generated client is throwing an Unexpected subelement Exception while processing the response from the Web Service. The Response Schema Seems to be well defined. Please advice.
>  
> 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)
> 	at org.opentravel.www.ota._2003._05.HotelAvailabilityStub.HotelAvailabilityOperation(HotelAvailabilityStub.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)
> Generated Code (Where I believe the problem is): 
> 					while (!loopDone1) {
> 						// We should be at the end element, but make sure
> 						while (!reader.isEndElement())
> 							reader.next();
> 						// Step out of this element
> 						reader.next();
> 						// Step to next element event.
> 						while (!reader.isStartElement()
> 								&& !reader.isEndElement())
> 							reader.next();
> 						if (reader.isEndElement()) {
> 							// two continuous end elements means we are exiting
> 							// the xml structure
> 							loopDone1 = true;
> 						} else {
> 							if (new javax.xml.namespace.QName(
> 									"http://www.opentravel.org/OTA/2003/05",
> 									"ContactNumber").equals(reader.getName())) {
> 								list1
> 										.add(org.opentravel.www.ota._2003._05.TelephoneInfoType.Factory
> 												.parse(reader));
> 							} else {
> 								loopDone1 = true;
> 							}
> 						}
> 					}
> Response xml Schema Where the element ContactNumbers are defined (I will upload the complete schemas as well):
> <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>
> 			</xs:element>
> Response XML Segment:
> <ContactNumbers>
> <ContactNumber PhoneNumber="1-305-4469000" PhoneTechType="1" PhoneUseType="5"/>
> <ContactNumber PhoneNumber="1-305-4471189" PhoneTechType="3" PhoneUseType="5"/>
> </ContactNumbers>
> The first ContactNumber element is being processed fine, But the exception is thrown in the second element.
> Please Note: I will only email the complete response xml if you need it. I cannot attach it to the issue.
> Wsdl2Java Command used to generate the client:
> wsdl2java.bat -uri C:\HotelAvailability_.wsdl -o C:\AxisClient p com.ihg.ws -d adb -s -t -u -sn HotelAvailability -pn HotelAvailabilitySOAP -Ew false -ns2p 
> Many Thanks for your time and attention,
> Nateshan

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org