Announcement Announcement Module
Collapse
No announcement yet.
Spring WS request and return collection of data Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring WS request and return collection of data

    Today is the first day that I started using Spring-WS after using the standard Spring container for almost 3 years now.

    It was very easy to setup the WS, invoking a serverside component.

    I want to create a WS that executes a findAll() operation on my DAO layer, but have some difficulties to achieve marchalling/unmarchalling.

    My current setup is as follows:
    Code:
    <bean id="billingService" class="com.billing.service.BillingServiceImpl">
        <constructor-arg ref="creditNoteDao"/>
        <constructor-arg ref="invoiceDao"/>
    </bean>
    
    <bean id="billingServiceEndpoint" class="com.billing.ws.BillingServiceEndpoint">
        <constructor-arg ref="billingService"/>
    </bean>
    
    <bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
        <property name="mappings">
            <props>
                <prop key="{http://company.com/billing/schemas}BillingHistoryRequest">billingServiceEndpoint</prop>
            </props>
        </property>
        <property name="interceptors">
            <bean class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor"/>
        </property>
    </bean>
    
    <bean id="billing" class="org.springframework.ws.wsdl.wsdl11.DynamicWsdl11Definition">
        <property name="builder">
            <bean class="org.springframework.ws.wsdl.wsdl11.builder.XsdBasedSoap11Wsdl4jDefinitionBuilder">
                <property name="schema" value="/WEB-INF/xsd/bhr.xsd"/>
                <property name="portTypeName" value="BillingHistory"/>
                <property name="locationUri" value="http://localhost:8080/billingService/"/>
                <property name="targetNamespace" value="http://company.com/billing/definitions"/>
            </bean>
        </property>
    </bean>
    The current setup is very similar to the HumanResource example. But what I want to do next is pass some input data (startDate, endDate, customerId) to the WebService and receive a list of billing data in the response.. thus a list of BillingData objects (inherited by Invoices, Creditnotes).

    What is the best way to achieve this? Which marchalling approach should I take??

    Can someone perhaps give me some configuration examples to achieve this?

  • #2
    Nobody, this seems quite trivial to me? Or am I mistaken?

    Comment


    • #3
      The airline sample shows you how to returns list of flights in the MarshallingEndpoint with a JAXB2 marshalling.

      Comment

      Working...
      X