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:
i've tried with and without the something.addContent("\n "); no differences between themCode: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; } }
same for the something.setAttributes() all time i get faults
and this is the fault i getCode: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); } } }
something wrong??? i think that java code is OK, can be a JAR library link error???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>
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!!



Reply With Quote