I am new to spring web services and after writing a sample program for a factorial service I am left with some doubts. I think this is how spring web-services work:
Application run on server and generates a request --> Request goes to dispatcher servlet as defined in web.xml --> dispatcher servlet looks for [servlet-name]-servlet.xml --> dispatcher servlet then looks for payloadroot which finds the right endpoint --> the xml request goes to the end point --> response is generated by the endpoint
Now my doubts are:
- How does the request that comes to the endpoint comes in XML form? I know XSD helps to create xml but when does it do that?
- In this whole process when is wsdl constructed?
Following are the bean definitions i.e. : [servlet-name]-servlet.xml
file:
<beans ...>
<bean id="findFactorialService" class="springws.findFactorial.FindFactorialServiceImpl"/>
<bean id="findFactorialServiceEndpoint" class="springws.findFactorial.endpoint.FindFactorialServiceEndpoint">
<property name="findFactorialService" ref="findFactorialService" />
</bean>
<bean id="payloadMapping" class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
<property name="defaultEndpoint" ref="findFactorialServiceEndpoint" />
</bean>
<bean id="findFactorialSchema" class="org.springframework.xml.xsd.SimpleXsdSchema">
<property name="xsd" value="/WEB-INF/findFactorialService.xsd" />
</bean>
<bean id="findFactorial" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition">
<property name="schema" ref="findFactorialSchema" />
<property name="portTypeName" value="hello" />
<property name="locationUri" value="http://localhost:7070/find-factorial-using-contractfirst/services" />
</bean>
</beans>