Announcement Announcement Module
No announcement yet.
Namespace Issue with CXF client calling Spring Web Service Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Namespace Issue with CXF client calling Spring Web Service

    I've run into an issue with my Spring Web Service with one particular external client.

    The problematic client calling the service is using CXF/Jaxb.

    The issue is with multiple namespaces in the soap body. The endpoint cannot handle them when one of them is a defaultns:

    i.e. something like this works fine
    (I had to pull the http from the soapenv and xmlns elements because the forums would not allow them in the post)

    <soapenv:Envelope xmlns:soapenv="h ttp ://">
    <test1:Order xmlns:test1=."h ttp ://"

    but the cxf client is generating a request like this:
    <soapenv:Envelope xmlns:soapenv="http ://">
    <test1:Order xmlns:test1="http ://"
    xmlns="http ://">

    which returns the error/stacktrace below (apologies for the hideously long stracktrace):

    Any suggestions? I'm extending AbstractDom4jPayloadEndpoint, but the same issue occurred using other endpoint types as well.

    14:50:19,174 WARN [SoapMessageDispatcher] Endpoint invocation resulted in exception - responding with SOAP Fault xception: Could not access envelope: Unable to create envelope from given source: ; nested exception is com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source:
    Caused by:
    com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source:
    at eateEnvelope(
    at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1 Impl.createEnvelopeFromSource( :71)
    at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.getEn velope(
    at ion.getEnvelope(
    at etEnvelope(
    at tSoapBody(
    at tPayloadSource(
    at loadRootAnnotationMethodEndpointMapping.getLookupK eyForMessage(PayloadRootAnnotationMethodEndpointMa
    at tractMethodEndpointMapping.getEndpointInternal(Abs
    at tractEndpointMapping.getEndpoint(AbstractEndpointM
    at tEndpoint(
    at spatch(
    at ceive(
    at eMessageReceiverObjectSupport.handleConnection(Web
    at ssageReceiverHandlerAdapter.handle(WebServiceMessa
    at tcherServlet.doService(MessageDispatcherServlet.ja va:197)
    at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(
    at org.springframework.web.servlet.FrameworkServlet.d oPost(
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:710)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
    at ternalDoFilter(
    at Filter(
    at org.apache.catalina.core.StandardWrapperValve.invo ke(
    at org.apache.catalina.core.StandardContextValve.invo ke(
    at org.apache.catalina.core.StandardHostValve.invoke(
    at org.apache.catalina.valves.ErrorReportValve.invoke (
    at org.apache.catalina.core.StandardEngineValve.invok e(
    at org.apache.catalina.connector.CoyoteAdapter.servic e(
    at org.apache.coyote.http11.Http11Processor.process(H
    at org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt
    at Socket(
    at ead.runIt(
    at org.apache.tomcat.util.threads.ThreadPool$ControlR
    Caused by: javax.xml.transform.TransformerException: 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 org.apache.xalan.transformer.TransformerIdentityIm pl.transform(
    at com.sun.xml.messaging.saaj.util.transform.Efficien tStreamingTransformer.transform(EfficientStreaming
    at com.sun.xml.messaging.saaj.s

  • #2
    FYI: I am using maven2 and including xalan 2.7.0 and xerces 2.8.1 in my web-inf/lib.

    This rrror happens under tomcat, jboss, and websphere (and yes, I use the suggested classloader config for websphere due to it using older versions of these jars).