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 "wang (JIRA)" <ax...@ws.apache.org> on 2007/12/10 08:19:44 UTC

[jira] Commented: (AXIS-2095) Items in an array seems to have the wrong name compared to what the WSDL says.

    [ https://issues.apache.org/jira/browse/AXIS-2095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12549945 ] 

wang commented on AXIS-2095:
----------------------------

Now I have the same issue in Axis 1.2.
My exception is here:
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode: 
 faultString: Invalid element in SybaseBugs.course_uac - item
 faultActor: 
 faultNode: 
 faultDetail: 
	{http://xml.apache.org/axis/}hostname:JZWANG-DESKTOP

Invalid element in SybaseBugs.course_uac - item
	at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:221)
	at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:128)
	at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
	at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
	at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:714)
	at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
	at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
	at org.apache.axis.client.Call.invokeEngine(Call.java:2771)
	at org.apache.axis.client.Call.invoke(Call.java:2754)
	at org.apache.axis.client.Call.invoke(Call.java:2430)
	at org.apache.axis.client.Call.invoke(Call.java:2353)
	at org.apache.axis.client.Call.invoke(Call.java:1810)
	at client.CourseDataService_BindingStub.test(CourseDataService_BindingStub.java:217)
	at client.CourseDataServiceServiceTestClient.main(CourseDataServiceServiceTestClient.java:24)



And surprising me is that when I debug in axis I found  typeDesc and propDesc were both null. Why?
My wsdl is here.
-------------------------
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://SybaseBugs" xmlns:tns3="http://CORBA.omg.org" xmlns:impl="http://SybaseBugs" xmlns:intf="http://SybaseBugs" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns2="http://CTS" xmlns:tns1="http://MJD" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<!--WSDL created by Apache Axis version: 1.2
Built on Nov 30, 2006 (01:32:55 CST)-->
 <wsdl:types>
  <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://SybaseBugs" elementFormDefault="qualified">
   <import namespace="http://MJD"/>
   <import namespace="http://CTS"/>
   <import namespace="http://CORBA.omg.org"/>
   <element name="test">
    <complexType>
     <sequence>
      <element name="in0" type="impl:course"/>
     </sequence>
    </complexType>
   </element>
   <complexType name="course_uac">
    <sequence>
     <element name="s_value" nillable="true" type="xsd:string"/>
     <element name="d_value" nillable="true" type="tns1:Date"/>
    </sequence>
   </complexType>
   <complexType name="ArrayOfcourse_uac">
    <sequence>
     <element name="item" type="impl:course_uac" minOccurs="0" maxOccurs="unbounded"/>
    </sequence>
   </complexType>
   <complexType name="course">
    <sequence>
     <element name="lstr_uac_course" nillable="true" type="impl:ArrayOfcourse_uac"/>
    </sequence>
   </complexType>
   <element name="testResponse">
    <complexType>
     <sequence>
      <element name="testReturn" type="impl:course"/>
     </sequence>
    </complexType>
   </element>
   <element name="fault" type="tns2:PBUserException"/>
   <element name="test1">
    <complexType>
     <sequence>
      <element name="in0" type="impl:course_uac"/>
     </sequence>
    </complexType>
   </element>
   <element name="test1Response">
    <complexType>
     <sequence>
      <element name="test1Return" type="impl:course_uac"/>
     </sequence>
    </complexType>
   </element>
  </schema>
  <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://MJD" elementFormDefault="qualified">
   <import namespace="http://SybaseBugs"/>
   <import namespace="http://CTS"/>
   <import namespace="http://CORBA.omg.org"/>
   <complexType name="Date">
    <sequence>
     <element name="dateValue" type="xsd:double"/>
    </sequence>
   </complexType>
  </schema>
  <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://CORBA.omg.org" elementFormDefault="qualified">
   <import namespace="http://SybaseBugs"/>
   <import namespace="http://MJD"/>
   <import namespace="http://CTS"/>
   <complexType abstract="true" name="UserException">
    <sequence/>
   </complexType>
  </schema>
  <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://CTS" elementFormDefault="qualified">
   <import namespace="http://SybaseBugs"/>
   <import namespace="http://MJD"/>
   <import namespace="http://CORBA.omg.org"/>
   <complexType name="PBUserException">
    <complexContent>
     <extension base="tns3:UserException">
      <sequence>
       <element name="message" nillable="true" type="xsd:string"/>
      </sequence>
     </extension>
    </complexContent>
   </complexType>
  </schema>
 </wsdl:types>

   <wsdl:message name="test1Request">

      <wsdl:part name="parameters" element="impl:test1"/>

   </wsdl:message>

   <wsdl:message name="testRequest">

      <wsdl:part name="parameters" element="impl:test"/>

   </wsdl:message>

   <wsdl:message name="PBUserException">

      <wsdl:part name="fault" element="impl:fault"/>

   </wsdl:message>

   <wsdl:message name="testResponse">

      <wsdl:part name="parameters" element="impl:testResponse"/>

   </wsdl:message>

   <wsdl:message name="test1Response">

      <wsdl:part name="parameters" element="impl:test1Response"/>

   </wsdl:message>

   <wsdl:portType name="CourseDataService">

      <wsdl:operation name="test">

         <wsdl:input name="testRequest" message="impl:testRequest"/>

         <wsdl:output name="testResponse" message="impl:testResponse"/>

         <wsdl:fault name="PBUserException" message="impl:PBUserException"/>

      </wsdl:operation>

      <wsdl:operation name="test1">

         <wsdl:input name="test1Request" message="impl:test1Request"/>

         <wsdl:output name="test1Response" message="impl:test1Response"/>

         <wsdl:fault name="PBUserException" message="impl:PBUserException"/>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="CourseDataService" type="impl:CourseDataService">

      <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

      <wsdl:operation name="test">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="testRequest">

            <wsdlsoap:body use="literal"/>

         </wsdl:input>

         <wsdl:output name="testResponse">

            <wsdlsoap:body use="literal"/>

         </wsdl:output>

         <wsdl:fault name="PBUserException">

            <wsdlsoap:fault name="PBUserException" use="literal"/>

         </wsdl:fault>

      </wsdl:operation>

      <wsdl:operation name="test1">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="test1Request">

            <wsdlsoap:body use="literal"/>

         </wsdl:input>

         <wsdl:output name="test1Response">

            <wsdlsoap:body use="literal"/>

         </wsdl:output>

         <wsdl:fault name="PBUserException">

            <wsdlsoap:fault name="PBUserException" use="literal"/>

         </wsdl:fault>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="CourseDataServiceService">

      <wsdl:port name="SybaseBugs_CourseDataService" binding="impl:CourseDataService">

         <wsdlsoap:address location="http://JZWANG-DESKTOP:8080/ws/services/SybaseBugs_CourseDataService"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>
-------------------------

> Items in an array seems to have the wrong name compared to what the WSDL says.
> ------------------------------------------------------------------------------
>
>                 Key: AXIS-2095
>                 URL: https://issues.apache.org/jira/browse/AXIS-2095
>             Project: Axis
>          Issue Type: Bug
>    Affects Versions: 1.2.1
>            Reporter: Ted Sanne
>
> My WSDL describes an array (this is only a small fragment of the complete WSDL):
> <complexType name="PropertyValueDTO">
> 	<sequence>
> <element name="URI" type="xsd:boolean"/>
> <element name="dateTime" type="xsd:boolean"/>
> <element name="hasHistory" type="xsd:boolean"/>
> <element name="id" nillable="true" type="xsd:string"/>
> <element name="label" nillable="true" type="xsd:string"/>
> <element name="source" nillable="true" type="xsd:string"/>
> <element name="timestamp" nillable="true" type="xsd:dateTime"/>
> <element name="unit" nillable="true" type="xsd:string"/>
> <element name="updated" nillable="true" type="xsd:dateTime"/>
> <element name="value" nillable="true" type="xsd:string"/>
> </sequence>
> </complexType>
> <complexType name="ArrayOfPropertyValueDTO">
>         <sequence>
>              <element maxOccurs="unbounded" minOccurs="0" name="item" type="impl:PropertyValueDTO"/>
>         </sequence>
> </complexType>
> <complexType abstract="true" name="TraceableDetailsDTO">
>   <sequence>
>    <element name="hasExternalLinks" type="xsd:boolean"/>
>    <element name="label" nillable="true" type="xsd:string"/>
>    <element name="properties" nillable="true" type="impl:ArrayOfPropertyValueDTO"/>
>    </sequence>
> </complexType>
> When calling the webservice the return looks like this:
> <properties>
>    <properties>
>    ...
>    </properties>
> <properties>
> and the client throws the following:
> org.xml.sax.SAXException: Invalid element in com.tracetracker.enterprise.twa.ArrayOfPropertyValueDTO - properties
> 	at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:258)
> 	at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
> 	at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
> 	at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
>         ...
> It seems the client expects a structure like this:
> <properties>
>    <item>
>    ...
>    </item>
> <properties>
> Having a go at debugging the ArraySerializer I can see in my debugger that both itemQName and componentQName is null, so elementName is never changed from "properties" to "item":
> // For the maxOccurs case, each item is named with the QName
> // we got in the arguments.  For normal array case, we write an element with
> // that QName, and then serialize each item as <item>
> QName elementName = name;
> Attributes serializeAttr = attributes;
> if (!maxOccursUsage) {
>       serializeAttr = null;  // since we are putting them here
>       context.startElement(name, attributes);
>       if (itemQName != null)
>              elementName = itemQName;
>       else if(componentQName != null)
>               elementName = componentQName;
> } 
> Can anyone tell me what has gone wrong here?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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