Announcement Announcement Module
Collapse
No announcement yet.
Annotation based endpoint problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Annotation based endpoint problem

    Hi:

    Im new using Spring-WS. Ive create a simple service and deploy it to the server. Well, when I try to consume this service from another application (console application with Netbeans) I got an error.

    Here is the error.

    Code:
    Jul 3, 2008 3:10:21 PM org.springframework.ws.server.MessageDispatcher processEndpointException
    WARNING: Endpoint invocation resulted in exception - responding with SOAP Fault
    java.lang.IllegalStateException: No adapter for endpoint [public springws.Person springws.ServiceEndpoint.getPersonData(java.lang.String)]: Does your endpoint implement a supported interface like MessageHandler or PayloadEndpoint?
    	at org.springframework.ws.server.MessageDispatcher.getEndpointAdapter(MessageDispatcher.java:273)
    	at org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:214)
    	at org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:162)
    	at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:87)
    	at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:57)
    	at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:197)
    	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
    	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:441)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
    	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
    	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
    	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
    	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
    	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
    	at java.lang.Thread.run(Thread.java:619)
    The spring beans config:

    Code:
    <bean id="endpoint" class="springws.ServiceEndpoint" />
        
        <bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping" />
        
        <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
        	<property name="classesToBeBound">
        		<list>
        			<value>springws.Person</value>
        		</list>
        	</property>
        </bean>
        
        <bean class="org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter">
            <constructor-arg ref="marshaller"/>
        </bean>
        
        <bean id="service" 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/service.xsd"/>
                    <property name="portTypeName" value="TestService"/>
                    <property name="locationUri" value="..."/>
                </bean>
            </property>
        </bean>
    The Schema:

    Code:
    	<complexType name="Person">
    		<sequence>
    			<element name="name" type="string"></element>
    			<element name="lastName" type="string"></element>
    		</sequence>
    	</complexType>
    
    	<element name="personRequest" type="string"></element>
    
    	<element name="personResponse" type="tns:Person"></element>
    My endpoint:
    Code:
    Endpoint
    public class ServiceEndpoint {
    	
    	PayloadRoot(localPart="personRequest", namespace="...")
    	public Person getPersonData(String name) {
    		String n = "Pepe";
    		String lastName = "Perez";
    		
    		Person p = new Person(n, lastName);
    		return p;
    	}
    }
    I was removed the Endpoint and PayloadRoot annotations symbol because I got an error saying something like "You are only allowed to post URLs to other sites after you have made 15 posts or more".

    Seeing at the generated wsdl I found that soapAction element is empty.
    <soap:operation soapAction="" />

    Please can someone help me, I appreciate any help.

    regards
    Last edited by jpla2005; Jul 3rd, 2008, 03:48 PM.
Working...
X