Announcement Announcement Module
Collapse
No announcement yet.
org.w3c.dom.DOMException: NAMESPACE_ERR Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • org.w3c.dom.DOMException: NAMESPACE_ERR

    Hi guys, I have a problem when trying to send messages:
    Code:
    		Element requestElement = new Element("TransferRequest");
    		Namespace ns = Namespace.getNamespace("http://fiktivbank.com/tr/schemas");  
    		requestElement.setNamespace(ns);
    		Document doc = new Document(requestElement);
    		
    		Element transfer = new Element("Transfer");		
    		Element toClearingNo = new Element("ToClearingNo");
    		toClearingNo.setText("1111");
    		transfer.addContent(toClearingNo);
    		Element toAccountNo = new Element("ToAccountNo");
    		toAccountNo.setText("1");
    		transfer.addContent(toAccountNo);
    		Element toAmount = new Element("ToAmount");
    		toAmount.setText("100");
    		transfer.addContent(toAmount);
    		
    		doc.getRootElement().addContent(transfer);
    		
    		JDOMSource requestSource = new JDOMSource(doc);
    		JDOMResult result = new JDOMResult();
    		webServiceTemplate.sendSourceAndReceiveToResult(requestSource, result);
    Gives me:
    Code:
    org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
    	com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.checkNamespaceWF(Unknown Source)
    	com.sun.org.apache.xerces.internal.dom.AttrNSImpl.setName(Unknown Source)
    	com.sun.org.apache.xerces.internal.dom.AttrNSImpl.<init>(Unknown Source)
    	com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createAttributeNS(Unknown Source)
    	com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl.createAttributeNS(Unknown Source)
    	com.sun.org.apache.xerces.internal.dom.ElementImpl.setAttributeNS(Unknown Source)
    	com.sun.xml.internal.messaging.saaj.soap.impl.ElementImpl.setAttributeNS(Unknown Source)
    	com.sun.xml.internal.messaging.saaj.soap.impl.ElementImpl.addAttributeBare(Unknown Source)
    	com.sun.xml.internal.messaging.saaj.soap.impl.ElementImpl.addAttributeBare(Unknown Source)
    	com.sun.xml.internal.messaging.saaj.soap.impl.ElementImpl.replaceElementWithSOAPElement(Unknown Source)
    	com.sun.xml.internal.messaging.saaj.soap.impl.BodyImpl.convertToSoapElement(Unknown Source)
    	com.sun.xml.internal.messaging.saaj.soap.impl.ElementImpl$5.next(Unknown Source)
    	org.springframework.ws.soap.saaj.Saaj13Implementation.getFirstBodyElement(Saaj13Implementation.java:246)
    	org.springframework.ws.soap.saaj.SaajSoapMessage.toString(SaajSoapMessage.java:224)
    	java.lang.String.valueOf(Unknown Source)
    	java.lang.StringBuffer.append(Unknown Source)
    	org.springframework.ws.client.core.WebServiceTemplate.handleFault(WebServiceTemplate.java:667)
    	org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:502)
    	org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:440)
    	org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:395)
    	org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:341)
    	org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:332)
    	org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:322)
    	xjobb.tha.ws.services.TransferService.sendTransfer(TransferService.java:50)
    	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	java.lang.reflect.Method.invoke(Unknown Source)
    	org.apache.el.parser.AstValue.invoke(AstValue.java:152)
    	org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
    	org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:68)
    	javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
    	com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
    	javax.faces.component.UICommand.broadcast(UICommand.java:383)
    	javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
    	javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
    	com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
    	com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
    	com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
    	javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
    	org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:360)
    	org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
    	org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
    	org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:372)
    	org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)
    	org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    	org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:372)
    	org.springframework.security.providers.anonymous.AnonymousProcessingFilter.doFilterHttp(AnonymousProcessingFilter.java:105)
    	org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    	org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:372)
    	org.springframework.security.ui.rememberme.RememberMeProcessingFilter.doFilterHttp(RememberMeProcessingFilter.java:116)
    	org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    	org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:372)
    	org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp(SecurityContextHolderAwareRequestFilter.java:91)
    	org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    	org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:372)
    	org.springframework.security.ui.basicauth.BasicProcessingFilter.doFilterHttp(BasicProcessingFilter.java:172)
    	org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    	org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:372)
    	org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:268)
    	org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    	org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:372)
    	org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:87)
    	org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    	org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:372)
    	org.springframework.security.ui.SessionFixationProtectionFilter.doFilterHttp(SessionFixationProtectionFilter.java:58)
    	org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    	org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:372)
    	org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:237)
    	org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    	org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:372)
    	org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:174)
    	org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:183)
    	org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:138)
    xjobb.tha.ws.services.TransferService.sendTransfer (TransferService.java:50)
    correspones to
    webServiceTemplate.sendSourceAndReceiveToResult(re questSource, result);

    Any thoughs?
    Last edited by zxc12; Apr 28th, 2008, 09:57 AM.
Working...
X