Results 1 to 3 of 3

Thread: No adapter for endpoint

Hybrid View

  1. #1
    Join Date
    May 2009
    Posts
    5

    Default No adapter for endpoint

    Hi all,
    i'm working on spring ws and i had this error

    Code:
    No adapter for endpoint [com.hr.service.StubSupressionService@95da38]: Does your endpoint implement a supported interface like MessageHandler or PayloadEndpoint?

    my servlet.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <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="insertionEndpoint" class="com.hr.ws.InsertionEndpoint">
    	<constructor-arg ref="hrService"/>
    </bean>
    <bean id="hrService" class="com.hr.service.StubinsertionService"/>
    <bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
    	<property name="mappings">
    		<props>
    			<prop key="{http://com.hr.ws/schema/insertion}InsertionRequest">insertionEndpoint</prop>
    		</props>
    		</property>
    	<property name="interceptors">
    		<list>
    			<bean
    class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor"></bean>
    </list>
    </property>
    </bean>-->
    
    
    
    
    <bean id="supressionEndpoint" class="com.hr.service.StubSupressionService"/>
    <bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
    	<property name="mappings">
    		<props>
    			 <prop key="{http://com.hr.ws/schema/supression}SupressionUserRequest">supressionEndpoint</prop>	
    			 			 
    		</props>
    		
    		
    		</property>
    	<property name="interceptors">
    		<list>
    		<bean class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor"></bean>
    </list>
    </property>
    </bean>
    
    
    
    
    
    
    <bean id="supression" 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/supression.xsd"/>                                  
          <property name="portTypeName" value="Supression"/>                              
          <property name="locationUri" value="http://localhost:8080/spring-wsTest/supressionService/"/>       
              
        </bean>
      </property>
    </bean>
    
    </beans>

    my xsd is :

    Code:
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:supression="http://com.hr.ws/schema/supression"
    targetNamespace="http://com.hr.ws/schema/supression" elementFormDefault="qualified">
    
    
    
    
    <xs:element name="SupressionUserRequest" type="supression:SupressionUserRequestType"/>
    <xs:element name="SupressionUserResponse" type="supression:SupressionUserResponseType"/>
    <xs:complexType name="SupressionUserRequestType">
    	<xs:sequence>
    		<xs:element name="CIN" type="xs:string"/>
    	
    	</xs:sequence>
    </xs:complexType>
    <xs:complexType name="SupressionUserResponseType">
    	<xs:sequence>
    		<xs:element name="auteur" type="xs:string"/>
    		<xs:element name="texte" type="xs:string"/>
    	</xs:sequence>
    </xs:complexType>
    </xs:schema>
    my endpoint :

    Code:
    package com.hr.ws;
    
    import org.jdom.Element;
    import org.jdom.Namespace;
    import org.jdom.xpath.XPath;
    import org.springframework.ws.server.endpoint.AbstractJDomPayloadEndpoint;
    import com.hr.service.SupressionService;
    
    public class SupressionEndpoint  extends AbstractJDomPayloadEndpoint{
    
    	SupressionService supressionService;
    	public SupressionEndpoint(SupressionService supressionService){
    		this.supressionService = supressionService;
    	}
    	
    	
    	
    	  protected Element invokeInternal(Element request) throws Exception {
    	    	Namespace namespace = Namespace.getNamespace("supression", "http://com.hr.ws/schema/supression");
    
    	    	// Création des requête XPath pour récupérer les informations
    	    	
    	    	 XPath CINExpression=XPath.newInstance("//supression:SupressionRequest/supression:CIN");
    	         CINExpression.addNamespace(namespace);
    	         
    	      // Récupération des informations à partir de la requête
    	         String CIN = CINExpression.valueOf(request);
    	      // Appel au service pour la traduction
    	         
    	         String[] res = supressionService.supprimerUser(CIN);
    	         // Création de la réponse*/
    	         Element root = new Element("SupressionResponse", namespace);
    	         Element auteur = new Element("auteur", namespace);
    	         auteur.setText(res[0]);
    
    	         Element texteTraduit = new Element("texte", namespace);
    	         texteTraduit.setText(res[1]);
    
    	         root.addContent(auteur);
    	         root.addContent(texteTraduit);
    	         
    	         supressionService.supprimerUser(CIN);
    	         return root;
    }
    }
    & the StubSupression Service

    Code:
    package com.hr.service;
    
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    
    public class StubSupressionService implements SupressionService {
    
    
    		  
    	private static final Log logger = LogFactory.getLog(StubSupressionService.class);
    	
    	  public String[] supprimerUser(String CINUSE){
    	  String s[]= new String[2];
    		  ConnectionDriver conn=new ConnectionDriver(); 
    			String P = null;	
    			P ="DELETE  FROM ER00,ER0G,ER0H,ER11,ERDI WHERE CINUSE = 'CINUSE'";
    			conn.executeQuery(P);
    			
    			s[0]= new String("AAAA");
    			s[1]= new String("CCCC");
    			return s;
    
    		  
    	  }
    
    
    }
    Thanks for Help !!
    Last edited by slimak; May 20th, 2009 at 09:35 AM.

  2. #2
    Join Date
    Jan 2006
    Location
    Seattle, Washington
    Posts
    467

    Default

    Without doing a lot of investigation, I would guess that this line:

    Code:
    <bean id="supressionEndpoint" class="com.hr.service.StubSupressionService"/>
    Should instead be something like:
    Code:
    <bean id="supressionService" class="com.hr.service.StubSupressionService"/>
    <bean id="supressionEndpoint" class="com.hr.ws.SupressionEndpoint">
     <constructor-arg ref="supressionService"/>
    </bean>
    The error message was exactly apropos.

    By the way, it's spelled "suppression".

  3. #3
    Join Date
    May 2009
    Posts
    5

    Default

    Thanks for your reply!!

    it works!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •