Announcement Announcement Module
Collapse
No announcement yet.
Error making up the response Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error making up the response

    Hi,

    Im having problems with my ws when the response is maked up. The request works fine, it calls to my service, and it founds good data.
    After that, Spring starts to make up the response and I have an exception:

    The exception is:

    2008-04-17 10:33:28,514 DEBUG [org.springframework.ws.server.endpoint.adapter.Gen ericMarshallingMethodEndpointAdapter] Marshalling [javax.xml.bind.JAXBElement@189e60f] to response payload
    2008-04-17 10:33:28,608 DEBUG [org.springframework.ws.soap.server.SoapMessageDisp atcher] Endpoint invocation resulted in exception - responding with Fault
    java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    at java.util.ArrayList.RangeCheck(ArrayList.java:546)
    at java.util.ArrayList.get(ArrayList.java:321)
    at org.jboss.ws.core.soap.NodeImpl.getFirstChild(Node Impl.java:287)
    at org.jboss.ws.core.soap.SOAPContentElement.getFirst Child(SOAPContentElement.java:460)
    at org.apache.xml.serializer.TreeWalker.traverse(Tree Walker.java:145)
    at org.apache.xalan.transformer.TransformerIdentityIm pl.transform(TransformerIdentityImpl.java:389)
    at org.springframework.ws.server.endpoint.AbstractLog gingInterceptor.logMessageSource(AbstractLoggingIn terceptor.java:125)
    at org.springframework.ws.server.endpoint.AbstractLog gingInterceptor.handleResponse(AbstractLoggingInte rceptor.java:104)
    at org.springframework.ws.server.MessageDispatcher.tr iggerHandleResponse(MessageDispatcher.java:342)
    at org.springframework.ws.server.MessageDispatcher.di spatch(MessageDispatcher.java:219)

    I don`t know exactly what is wrong, because I copied the airlines sample.

    Part of my xsd is:

    <xs:element name="GetInfoUsuarioRequest" type="tns:Matricula"/>
    <xs:element name="GetInfoUsuarioResponse" type="tns:Usuario"/>
    <xs:element name="GetInfoGrupoRequest" type="xs:string"/>
    <xs:element name="GetInfoGrupoResponse" type="tns:Grupo"/>
    ...
    <xs:complexType name="Grupo">
    <xs:sequence>
    <xs:element name="dn" type="xs:string"/>
    <xs:element name="nombre" type="xs:string"/>
    <xs:element name="grupos" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="usuarios" type="tns:Matricula" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="Usuario">
    <xs:sequence>
    <xs:element name="matricula" type="xs:string"/>
    <xs:element name="nombre" type="xs:string"/>
    <xs:element name="apellidos" type="xs:string"/>
    <xs:element name="telefono" type="tns:Extension"/>
    <xs:element name="mail" type="xs:string"/>
    <xs:element name="unidad" type="xs:string"/>
    <xs:element name="grupos" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    ...

    Parts of my beans declaration are:

    <bean id="marshallingEndpoint" class="es.cyii.ldap.ws.MarshallingLDAPEndpoint">
    <constructor-arg ref="ldapService"/>
    </bean>
    <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshalle r">
    <description>
    The JAXB 2 Marshaller is used by the endpoints.
    </description>
    <property name="contextPath" value="es.cyii.ldap.schema"/>
    </bean>
    <bean class="org.springframework.ws.server.endpoint.adap ter.PayloadEndpointAdapter">
    </bean>
    <!-- Fin de End Point -->

    <!-- End Point Mapping -->
    <bean class="org.springframework.ws.server.endpoint.mapp ing.PayloadRootAnnotationMethodEndpointMapping">
    <property name="interceptors">
    <list>
    <bean class="org.springframework.ws.server.endpoint.inte rceptor.PayloadLoggingInterceptor"/>
    <bean class="org.springframework.ws.soap.server.endpoint .interceptor.PayloadValidatingInterceptor">
    <property name="schema" value="/WEB-INF/ldap.xsd"/>
    <property name="validateRequest" value="true"/>
    <property name="validateResponse" value="false"/>
    </bean>
    </list>
    </property>
    <property name="order" value="1"/>
    </bean>
    <!-- Fin de End Point Mapping -->

    <!-- End Point Adapters -->
    <bean class="org.springframework.ws.server.endpoint.adap ter.GenericMarshallingMethodEndpointAdapter">
    <description>
    This adapter allows for methods that need and returns marshalled objects. The MarshallingEndpoint
    uses JAXB 2 objects.
    </description>
    <constructor-arg ref="marshaller"/>
    </bean>
    <!-- Fin de EndPoint Adapters -->

    We would appreciate very much any help, because this question is very urgent for us. If you need more information, or something
    is not very well expressed, please, ask me, and I give all the information I have.

    Thank you in advance,

  • #2
    It's in the FAQ.

    Comment

    Working...
    X