Java – spring web service process
I am a novice in learning network services. After writing an example program for a factorial service, I have some doubts I think this is the working principle of spring network service:
Now my suspicion is:
The following is the bean definition: [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>
Solution
>XSD does not generate XML, it is used to validate it People who write customers will also use it to learn how to form their XML to send to your service A "request" is a message sent to your service by some type of client - it usually enters your service through the HTTP protocol (World Wide Web protocol)
This is old, but it follows the same method you are using, even using the same deprecated spring class
Nowadays, many developers avoid using WS - * style web services and adopt rest based web services. These services are very easy to implement using spring web and spring MVC, and there are several simple comments on Java POJO If you like, you can even have spring automatically bind XML payloads to Java objects generated from XSD, so you don't have to actually process XML at any time