Announcement Announcement Module
Collapse
No announcement yet.
Need help wiring it together Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need help wiring it together

    I'm trying to build a SOAP service that uses one of the spring-supported OXMs but I'm having trouble figuring out how it all wires together (I think I'm about about 80% of the way there):

    Here's my servlet.xml:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <!-- control layer configuration -->
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
        
        <bean id="endpointAdapter" class="org.springframework.ws.server.endpoint.adapter.MarshallingMethodEndpointAdapter">
            <property name="marshaller">
                <ref local="castorMarshaller" />
            </property>
            <property name="unmarshaller">
                <ref local="castorMarshaller" />
            </property>
        </bean>
        
        <!-- not sure if this is what i need -->
        <bean id="endpointMapping" class="org.springframework.ws.server.endpoint.mapping.SimpleMethodEndpointMapping">
            <property name="defaultEndpoint">
                <!-- if this is what i need, i'm not sure what needs to go here -->
            </property>
            <property name="interceptors">
                <list>
                    <ref local="validatingInterceptor" />
                    <ref local="loggingInterceptor" />
                </list>
            </property>
        </bean>
    
        <bean id="validatingInterceptor"
              class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor">
            <description>
                This interceptor validates both incoming and outgoing message contents according to the 'myapp.xsd' XML
                Schema file.
            </description>
            <property name="xsdSchema" ref="schema"/>
            <property name="validateRequest" value="true"/>
            <property name="validateResponse" value="true"/>
        </bean>
    
        <bean id="loggingInterceptor" class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor">
            <description>
                This interceptor logs the message payload.
            </description>
        </bean>
        
        <bean id="castorMarshaller" class="org.springframework.oxm.castor.CastorMarshaller" />
    
        <bean id="myapp" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition">
            <description>
                This bean definition represents a WSDL definition that is generated at runtime. It can be retrieved by
                going to /myapp/soap/MyApp/myapp.wsdl (i.e. the bean name corresponds to the filename).
            </description>
            <property name="schema" ref="schema"/>
            <property name="portTypeName" value="MyApp"/>
            <property name="locationUri" value="http://localhost/myapp/soap/MyApp"/>
        </bean>
    
        <bean id="schema" class="org.springframework.xml.xsd.SimpleXsdSchema">
            <description>
                This bean definition contains the XSD schema.
            </description>
            <property name="xsd" value="/WEB-INF/myapp.xsd"/>
        </bean>
        
        <!-- not sure how this is to be wired into things -->
        <bean id="myService" class="com.name.myapp.service.MyAppService">
             <!-- dao wired in here -->
        </bean>
    </beans>
    If someone could help me tie down these loose ends that would help.
Working...
X