Announcement Announcement Module
Collapse
No announcement yet.
Using Spring ws 1.0.3 encountering a NAMESPACE problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using Spring ws 1.0.3 encountering a NAMESPACE problem

    Hi,

    I have a webservice created using the spring-ws,
    I use two payloads, sent using soapui and one payload works fine, but when i use another payload i get the following issue,
    any valuable pointers are highly appreciated.

    the following is the stacktrace
    Code:
    Received request [SaajSoapMessage {http://www.hp.com/sms}sendSmsRequest]>
    ERROR:  'NAMESPACE_ERR: An attempt is made to create or change an object in a wa
    y which is incorrect with regard to namespaces.'
    2008-03-14 17:07:33,504 DEBUG [org.springframework.ws.soap.server.SoapMessageDis
    patcher] - <Testing endpoint exception resolver [org.springframework.ws.soap.ser
    ver.endpoint.SimpleSoapExceptionResolver@cbbe88]>
    2008-03-14 17:07:33,514 WARN [org.springframework.ws.soap.server.SoapMessageDisp
    atcher] - <Endpoint invocation resulted in exception - responding with SOAP Faul
    t>
    javax.xml.transform.TransformerException: org.w3c.dom.DOMException: NAMESPACE_ER
    R: An attempt is made to create or change an object in a way which is incorrect
    with regard to namespaces.
            at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transfor
    m(TransformerImpl.java:651)
            at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transfor
    m(TransformerImpl.java:281)
            at org.springframework.ws.server.endpoint.support.PayloadRootUtils.getPa
    yloadRootQName(PayloadRootUtils.java:87)
            at org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpoi
    ntMapping.resolveQName(PayloadRootQNameEndpointMapping.java:57)
            at org.springframework.ws.server.endpoint.mapping.AbstractQNameEndpointM
    apping.getLookupKeyForMessage(AbstractQNameEndpointMapping.java:33)
            at org.springframework.ws.server.endpoint.mapping.AbstractMapBasedEndpoi
    ntMapping.getEndpointInternal(AbstractMapBasedEndpointMapping.java:106)
            at org.springframework.ws.server.endpoint.mapping.AbstractEndpointMappin
    g.getEndpoint(AbstractEndpointMapping.java:83)
            at org.springframework.ws.server.MessageDispatcher.getEndpoint(MessageDi
    spatcher.java:242)
            at org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispa
    tcher.java:195)
            at org.springframework.ws.server.MessageDispatcher.receive(MessageDispat
    cher.java:162)
            at org.springframework.ws.transport.support.WebServiceMessageReceiverObj
    ectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:87)
            at org.springframework.ws.transport.http.WebServiceMessageReceiverHandle
    rAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:57)
            at org.springframework.ws.transport.http.MessageDispatcherServlet.doServ
    ice(MessageDispatcherServlet.java:197)
            at org.springframework.web.servlet.FrameworkServlet.processRequest(Frame
    workServlet.java:476)
            at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServ
    let.java:441)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
            at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run
    (StubSecurityHelper.java:227)
            at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri
    tyHelper.java:125)
            at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
    a:283)
            at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
    a:175)
            at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
    n.run(WebAppServletContext.java:3231)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:321)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
    121)
            at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppS
    ervletContext.java:2002)
            at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC
    ontext.java:1908)
            at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j
    ava:1362)
            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
            at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    Caused by: 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.
            at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.checkNamespac
    eWF(CoreDocumentImpl.java:2388)
            at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.setName(AttrNSImpl.
    java:126)
            at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.<init>(AttrNSImpl.j
    ava:111)
            at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createAttribu
    teNS(CoreDocumentImpl.java:2012)
            at com.sun.org.apache.xerces.internal.dom.ElementImpl.setAttributeNS(Ele
    mentImpl.java:684)
            at com.sun.org.apache.xalan.internal.xsltc.trax.SAX2DOM.startElement(SAX
    2DOM.java:134)
            at com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.closeStart
    Tag(ToXMLSAXHandler.java:205)
            at com.sun.org.apache.xml.internal.serializer.ToSAXHandler.flushPending(
    ToSAXHandler.java:291)
            at com.sun.org.apache.xml.internal.serializer.ToXMLSAXHandler.startEleme
    nt(ToXMLSAXHandler.java:646)
            at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleElement(
    SaajXmlReader.java:140)
            at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleNode(Saa
    jXmlReader.java:123)
            at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleElement(
    SaajXmlReader.java:150)
            at org.springframework.ws.soap.saaj.support.SaajXmlReader.handleNode(Saa
    jXmlReader.java:123)
            at org.springframework.ws.soap.saaj.support.SaajXmlReader.parse(SaajXmlR
    eader.java:115)
            at org.springframework.ws.soap.saaj.support.SaajXmlReader.parse(SaajXmlR
    eader.java:96)
            at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transfor
    mIdentity(TransformerImpl.java:588)
            at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transfor
    m(TransformerImpl.java:642)
            at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transfor
    m(TransformerImpl.java:281)
            at org.springframework.ws.server.endpoint.support.PayloadRootUtils.getPa
    yloadRootQName(PayloadRootUtils.java:87)
            at org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpoi
    ntMapping.resolveQName(PayloadRootQNameEndpointMapping.java:57)
            at org.springframework.ws.server.endpoint.mapping.AbstractQNameEndpointM
    apping.getLookupKeyForMessage(AbstractQNameEndpointMapping.java:33)
            at org.springframework.ws.server.endpoint.mapping.AbstractMapBasedEndpoi
    ntMapping.getEndpointInternal(AbstractMapBasedEndpointMapping.java:106)
            at org.springframework.ws.server.endpoint.mapping.AbstractEndpointMappin
    g.getEndpoint(AbstractEndpointMapping.java:83)
            at org.springframework.ws.server.MessageDispatcher.getEndpoint(MessageDi
    spatcher.java:242)
            at org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispa
    tcher.java:195)
            at org.springframework.ws.server.MessageDispatcher.receive(MessageDispat
    cher.java:162)
            at org.springframework.ws.transport.support.WebServiceMessageReceiverObj
    ectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:87)
            at org.springframework.ws.transport.http.WebServiceMessageReceiverHandle
    rAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:57)
            at org.springframework.ws.transport.http.MessageDispatcherServlet.doServ
    ice(MessageDispatcherServlet.java:197)
            at org.springframework.web.servlet.FrameworkServlet.processRequest(Frame
    workServlet.java:476)
            at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServ
    let.java:441)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
    The following is the payload sent by the client,
    Code:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
       <soapenv:Header/>
       <soapenv:Body>
          <sendSmsRequest xmlns="http://www.hp.com/sms">
             <addresses>auto string</addresses>
             <senderName>auto string</senderName>
             <message>auto string</message>
             <receiptRequest>
                <endpoint>auto string</endpoint>
                <interfaceName>auto string</interfaceName>
                <correlator>auto string</correlator>
             </receiptRequest>
          </sendSmsRequest>
       </soapenv:Body>
    </soapenv:Envelope>
    in the above payload the soap request fails and the service generates and error.

    the below payload works fine,
    Code:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sms="http://www.hp.com/sms">
       <soapenv:Header/>
       <soapenv:Body>
          <sms:sendSmsRequest>
    
             <sms:addresses>1122123211</sms:addresses>
    
             <sms:senderName>test</sms:senderName>
             <sms:message>test</sms:message>
            
          </sms:sendSmsRequest>
       </soapenv:Body>
    </soapenv:Envelope>
    the only difference is the namespace defined at the higher level

  • #2
    When we had this problem it was related to the xalan version on classpath.

    see my comment on thread http://forum.springframework.org/showthread.php?t=48691
    for more information.

    Regards,
    Paul

    Comment

    Working...
    X