开发者

Access web service::schema issue

I have Spring Web Service based on tutorial example. That configured in this way

@Endpoint
public class HolidayEndpoint {

@PayloadRoot(namespace = NAMESPACE_URI, localPart = "HolidayRequest")
public void  handleHolidayRequest(@RequestPayload Element holidayRequest) throws Exception {...}

web.xml

<servlet>
    <servlet-name>spring-ws</servlet-name>
    <servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class>
    <init-param>
        <param-name>transformWsdlLocations</param-name>
        <param-value>true</param-value>
    </init-param>
</servlet>
<servlet-mapping>
    <servlet-name>spring-ws</servlet-name>
    <url-pattern>/ws/*</url-pattern>
</servlet-mapping>

spring config

    <sws:annotation-driven/>

    <sws:dynamic-wsdl id="holiday" portTypeName="HumanResource" locationUri="/holidayService/"
                      targetNamespace="http://mycompany.com/hr/definitions">
        <sws:xsd location="/WEB-INF/somexsd.xsd"/>
    </sws:dynamic-wsdl>

How I should access it?

I've tried to post at http://localhost:8080/ws/holidayService/holiday but server returned 404 and wrote in log

at starting

DEBUG [org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping] - Looking for endpoints i开发者_运维技巧n application context: WebApplicationContext for namespace 'spring-ws-servlet': startup date [Fri Mar 11 18:41:42 EET 2011]; root of context hierarchy
DEBUG [org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping] - Mapped [{http://mycompany.com/hr/schemas}HolidayRequest] onto endpoint [public void com.mycompany.hr.ws.HolidayEndpoint.handleHolidayRequest(org.jdom.Element) throws java.lang.Exception]
DEBUG [org.springframework.ws.soap.server.endpoint.mapping.SoapActionAnnotationMethodEndpointMapping] - Looking for endpoints in application context: WebApplicationContext for namespace 'spring-ws-servlet': startup date [Fri Mar 11 18:41:42 EET 2011]; root of context hierarchy
DEBUG [org.springframework.ws.wsdl.wsdl11.provider.InliningXsdSchemaTypesProvider] - Inlining SimpleXsdSchema{http://mycompany.com/hr/schemas}
DEBUG [org.springframework.ws.wsdl.wsdl11.provider.DefaultMessagesProvider] - Looking for elements in schema with target namespace [http://mycompany.com/hr/schemas]
DEBUG [org.springframework.ws.wsdl.wsdl11.provider.DefaultMessagesProvider] - Creating message [{http://mycompany.com/hr/definitions}HolidayRequest]
DEBUG [org.springframework.ws.wsdl.wsdl11.provider.SuffixBasedPortTypesProvider] - Creating port type [{http://mycompany.com/hr/definitions}HumanResource]
DEBUG [org.springframework.ws.wsdl.wsdl11.provider.SuffixBasedPortTypesProvider] - Adding operation [Holiday] to port type [{http://mycompany.com/hr/definitions}HumanResource]
DEBUG [org.springframework.ws.wsdl.wsdl11.provider.Soap11Provider] - Creating binding [{http://mycompany.com/hr/definitions}HumanResourceSoap11]
DEBUG [org.springframework.ws.wsdl.wsdl11.provider.Soap11Provider] - Creating service [{http://mycompany.com/hr/definitions}HumanResourceService]
DEBUG [org.springframework.ws.wsdl.wsdl11.provider.Soap11Provider] - Adding port [HumanResourceSoap11] to service [{http://mycompany.com/hr/definitions}HumanResourceService]
DEBUG [org.springframework.ws.transport.http.MessageDispatcherServlet] - Published WebApplicationContext of servlet 'spring-ws' as ServletContext attribute with name [org.springframework.web.servlet.FrameworkServlet.CONTEXT.spring-ws]
INFO [org.springframework.ws.soap.saaj.SaajSoapMessageFactory] - Creating SAAJ 1.3 MessageFactory with SOAP 1.1 Protocol
DEBUG [org.springframework.ws.soap.saaj.SaajSoapMessageFactory] - Using MessageFactory class [com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl]
DEBUG [org.springframework.ws.transport.http.MessageDispatcherServlet] - No WebServiceMessageFactory found in servlet 'spring-ws': using default
DEBUG [org.springframework.ws.soap.server.SoapMessageDispatcher] - No EndpointExceptionResolvers found, using defaults
DEBUG [org.springframework.ws.transport.http.MessageDispatcherServlet] - No MessageDispatcher found in servlet 'spring-ws': using default
DEBUG [org.springframework.ws.transport.http.MessageDispatcherServlet] - Published [org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition@6fc41e49] as holiday.wsdl
DEBUG [org.springframework.ws.transport.http.MessageDispatcherServlet] - Published [SimpleXsdSchema{http://mycompany.com/hr/schemas}] as org.springframework.xml.xsd.SimpleXsdSchema#0.xsd

per request

DEBUG [org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter] - Accepting incoming [org.springframework.ws.transport.http.HttpServletConnection@3bd85e85] at [http://localhost:8080/ws/holidayService/holiday]
DEBUG [org.springframework.ws.server.MessageTracing.received] - Received request [SaajSoapMessage HolidayRequest]
DEBUG [org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping] - Looking up endpoint for [HolidayRequest]
DEBUG [org.springframework.ws.soap.server.SoapMessageDispatcher] - Endpoint mapping [org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping@2081ca25] has no mapping for request
DEBUG [org.springframework.ws.soap.server.endpoint.mapping.SoapActionAnnotationMethodEndpointMapping] - Looking up endpoint for []
DEBUG [org.springframework.ws.soap.server.SoapMessageDispatcher] - Endpoint mapping [org.springframework.ws.soap.server.endpoint.mapping.SoapActionAnnotationMethodEndpointMapping@3ad8326d] has no mapping for request
WARN [org.springframework.ws.server.EndpointNotFound] - No endpoint mapping found for [SaajSoapMessage HolidayRequest]
DEBUG [org.springframework.ws.transport.http.MessageDispatcherServlet] - Successfully completed request

If you need some additional info let me know, please.

UPD It worked without scheme/namespace stuff.


Have you http://localhost:8080/ws/holidayService/ instead of /HumanService/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜