Results 1 to 3 of 3

Thread: Handling xmlns="" in Soap Envelope

  1. #1
    Join Date
    Jan 2008
    Posts
    13

    Default Handling xmlns="" in Soap Envelope

    Hi All,

    I am writing a web service interface and my user are sending me xmlns="" all over the place. They claim it is valid and is the way TIBCO works. This sucks for me because I get an exception that it is not valid from JDOM. Here is a snippet of what they are sending me:

    <SOAP-ENV:Envelope xmlns=""
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Header xmlns=""

    Does anyone have any suggestions on how to handle this in Spring WS?

    Thanks,
    Hisham

  2. #2
    Join Date
    Apr 2005
    Location
    Finland
    Posts
    314

    Default

    What's the Exception? I got my tests working with "empty namespaces" with Spring WS 1.0.3.

    I had some issues which were fixed by updating the Xerces and Xalan dependencies to versions: Xerces 2.8.1 and Xalan 2.7.0.
    if a trainstation is where the train stops, what's a workstation...

  3. #3
    Join Date
    Jan 2008
    Posts
    13

    Default namespace "" not valid

    The exception I got was:

    Code:
    org.jdom.IllegalNameException: The name "" is not legal for JDOM/XML namespaces: Namespace URIs must be non-null and non-empty Strings.
    at org.jdom.Namespace.getNamespace(Namespace.java:164 )
    at org.jdom.input.SAXHandler.startPrefixMapping(SAXHa ndler.java:471)
    at org.xml.sax.helpers.XMLFilterImpl.startPrefixMappi ng(Unknown Source)
    at org.jdom.transform.JDOMResult$DocumentBuilder.star tPrefixMapping(JDOMResult.java:529)
    at com.sun.org.apache.xml.internal.serializer.ToXMLSA XHandler.startPrefixMapping(Unknown Source)
    at com.sun.org.apache.xml.internal.serializer.ToXMLSA XHandler.namespaceAfterStartElement(Unknown Source)
    at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2T O.parse(Unknown Source)
    at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2T O.parse(Unknown Source)
    at com.sun.org.apache.xalan.internal.xsltc.trax.Trans formerImpl.transformIdentity(Unknown Source)
    at com.sun.org.apache.xalan.internal.xsltc.trax.Trans formerImpl.transform(Unknown Source)
    at com.sun.org.apache.xalan.internal.xsltc.trax.Trans formerImpl.transform(Unknown Source)
    at org.springframework.xml.transform.TransformerObjec tSupport.transform(TransformerObjectSupport.java:7 2)
    at org.springframework.ws.server.endpoint.AbstractJDo mPayloadEndpoint.invoke(AbstractJDomPayloadEndpoin t.java:44)
    at org.springframework.ws.server.endpoint.adapter.Pay loadEndpointAdapter.invoke(PayloadEndpointAdapter. java:48)
    at org.springframework.ws.server.MessageDispatcher.di spatch(MessageDispatcher.java:216)
    at org.springframework.ws.server.MessageDispatcher.re ceive(MessageDispatcher.java:163)
    at org.springframework.ws.transport.support.WebServic eMessageReceiverObjectSupport.handleConnection(Web ServiceMessageReceiverObjectSupport.java:87)
    at org.springframework.ws.transport.http.WebServiceMe ssageReceiverHandlerAdapter.handle(WebServiceMessa geReceiverHandlerAdapter.java:57)
    at org.springframework.ws.transport.http.MessageDispa tcherServlet.doService(MessageDispatcherServlet.ja va:197)
    at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:476)
    at org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:441)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:710)

    My pom.xml file is all over the place. There is no good example and the Maven repositories are not always correct. I wish there was a pom.xml file that I could get that actually worked without having to mess around with it. The reason I say that is because I am not sure if there is a clash of the jar files. I don't have xalan or xerces specifically in my pom file and I don't see it anywhere. Do you have it in your pom? Could you share your pom file with me?

    Anyway, I fixed the issue by changing me endpoint to extend AbstractDomPayloadEndpoint instead of the AbstractJDomPayloadEndpoint. I had to change my code to use the standard DOM libraries instead of JDOM.

    Thanks for your reply
    Hisham

Posting Permissions

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