Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Ignore Child Type Warning

  1. #11
    Join Date
    Jun 2009
    Location
    León, Spain
    Posts
    24

    Default

    I've changed my endpoint code again, now there is no warnings at Eclipse but i get a fault response when i try to generate a message response.

    this is my java code:

    Code:
    package endpoints; 
     
    import org.jdom.Element;
     
    public class GetRPCMethods extends endpointBase{ 
    
    	@Override 
    	protected Element invokeInternal(Element element) throws Exception { 
    
    		Element rootElement = new Element("GetRPCMethodsResponse",urn);
    		Element listado = new Element("MethodList",urn);
    		//listado.setAttribute("arrayType", "xsd:string[3]", soapenc);
    		
    		Element metodo = new Element("string");
    		metodo.setText("Inform");
    		listado.addContent("\n ");
    		listado.addContent(metodo);
    		
    		Element metodo2 = new Element("string");
    		metodo2.setText("GetRPCMethods");
    		listado.addContent("\n ");
    		listado.addContent(metodo2);
    		
    		Element metodo3 = new Element("string");
    		metodo3.setText("TransferComplete");
    		listado.addContent("\n ");
    		listado.addContent(metodo3);
    		
    		rootElement.addContent("\n ");
    		rootElement.addContent(listado);
    		
    	        log(rootElement);
    		return rootElement;
    	} 
    }
    i've tried with and without the something.addContent("\n "); no differences between them
    same for the something.setAttributes() all time i get faults
    Code:
    package endpoints; 
     
    import java.io.IOException;
    
    import org.jdom.Document;
    import org.jdom.Element;
    import org.jdom.Namespace;
    import org.jdom.output.XMLOutputter;
    import org.springframework.ws.server.endpoint.AbstractJDomPayloadEndpoint;
     
    public abstract class endpointBase extends AbstractJDomPayloadEndpoint{ 
         
        protected final Namespace soapenc = Namespace.getNamespace("soap-enc", "http://schemas.xmlsoap.org/soap/encoding/");
        protected final Namespace soapenv = Namespace.getNamespace("soap-env", "http://schemas.xmlsoap.org/soap/envelope/");
        protected final Namespace urn = Namespace.getNamespace("urn", "urn:dslforum-org:cwmp-1-1");
        protected final Namespace xsd = Namespace.getNamespace("xsd","http://www.w3.org/2001/XMLSchema");
    
    	protected void log (Element rootElement){
    	
    		Document doc = new Document(rootElement);
    	    try {
    	      XMLOutputter serializer = new XMLOutputter();
    	      serializer.output(doc, System.out);
    	    }
    	    catch (IOException e) {
    	      System.err.println(e);
    	    }	
    	} 
    }
    and this is the fault i get
    Code:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
       <env:Header/>
       <env:Body>
          <env:Fault>
             <faultcode xmlns:valueNS="http://schemas.xmlsoap.org/soap/envelope/">valueNS:Server</faultcode>
             <faultstring xml:lang="en">org.jdom.JDOMException: Exception in startElement: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.</faultstring>
          </env:Fault>
       </env:Body>
    </env:Envelope>
    something wrong??? i think that java code is OK, can be a JAR library link error???
    i've linked: "jdom-1.0.jar" "spring-context-sources.jar" "spring-webmvc.2.5.6.jar" "spring-webmvc-sources.jar" "spring-ws-1.5.6-all.jar" "spring-ws-1.5.6-sources.jar"

    any idea can help, thanks!!
    Last edited by neotherack; Jun 21st, 2009 at 06:31 PM.

  2. #12
    Join Date
    Jun 2009
    Location
    León, Spain
    Posts
    24

    Default

    i've worked about last 3 days but i cannot solve this issue

    can anybody help me?

  3. #13
    Join Date
    Jun 2009
    Location
    León, Spain
    Posts
    24

    Cool Solved!!!!

    solution:

    add this code to spring-ws-servlet.xml
    Code:
    	<bean id="messageFactory"
    		class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory">
    		<property name="payloadCaching" value="false" />
    	</bean>
    add the "axiom.jar" library to my lib folder

    SAHAGUN Rules!

Posting Permissions

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