Announcement Announcement Module
Collapse
No announcement yet.
EndPoint Exception Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • EndPoint Exception

    Hello

    i've implemented an endpoint class, but it always throws an exception when i try to "println" the incoming soap message.

    throws exception right here "System.out.println(element.getTextContent()); "

    i think that incoming message is OK because i'm using a "payloadvalidator" for incoming and outgoing messages.

    can anybody help me?? thanks!!

    this is my endpoint code:

    Code:
    package org.dslforum.cwmp_1_1;
    
    import org.springframework.ws.server.endpoint.AbstractDomPayloadEndpoint;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    
    public class GetRPCMethods extends AbstractDomPayloadEndpoint{
    
        private String responseText;
        
    	@Override
    	protected Element invokeInternal(Element element, Document document)throws Exception {
    		
    		
    	System.out.println("Recibido!!!! mostrando salida: \n");
    		
    	try{
    		System.out.println(element.getNamespaceURI());
    		System.out.println(element.getTextContent());
            	
    	}catch (Exception ex){
    		System.err.println("Excepcion!!!");
    	}
    
            System.out.println("Construyendo respuesta: \n");
            
            Element responseElement = document.createElement("GetRPCMethodsResponse");
            System.out.println(responseElement.toString());
            
            return responseElement;
    	}
    
    }

    and my spring-ws-servlet.xml

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <!-- Archivo de definicion de Beans -->
    <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">
    
    	
    	<!-- Definicion de los Endpoint -->
    	<!-- Ordenados alfabeticamente (peticion y respuesta) -->
    	<bean id="GetRPCMethods" class="org.dslforum.cwmp_1_1.GetRPCMethods"/>
    	<bean id="GetRPCMethodsResponse" class="org.dslforum.cwmp_1_1.GetRPCMethodsResponse"/>
    
    
    	
    	<!-- Mapeo de los Endpoint -->
    	<bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
    		<property name="mappings">
    			<props> 
    				
    				<!-- PETICIONES -->
    				<prop key="{urn:dslforum-org:cwmp-1-1}GetRPCMethods">GetRPCMethods</prop>
    				
    				<!-- RESPUESTAS -->
    				<prop key="{urn:dslforum-org:cwmp-1-1}GetRPCMethodsResponse">GetRPCMethodsResponse</prop>
    
    			</props>
    		</property>
    
    		<!-- Definicion de los Interceptores -->
    		<!-- En este caso se intercepta para Logging y para validacion de entrada y salida -->
    		<property name="interceptors">
    			<list>
    				<bean id="loggingInterceptor" class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor"/>
    				<bean id="validatingInterceptor" class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor">
    					<property name="schema" value="/WEB-INF/schema.xsd"/>
    					<property name="validateRequest" value="true"/>
    					<property name="validateResponse" value="true"/>
    				</bean>
    			</list>
    		</property>
    	</bean>
    
    	
    	<!-- Definicion de WSDL-->
        <bean id="ServidorACS" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition">
            <property name="schema" ref="schema"/>
            <property name="portTypeName" value="ServidorACS"/>
            <property name="locationUri" value="http://localhost:8080/ServidorACS"/>
        </bean>
    
    	<!-- Definicion del Esquema de datos XSD -->
        <bean id="schema" class="org.springframework.xml.xsd.SimpleXsdSchema">
            <property name="xsd" value="/WEB-INF/schema.xsd"/>
        </bean>
    
    </beans>

    second question is.... where i can see "response construction" sample??

    thanks again!!
Working...
X