Announcement Announcement Module
No announcement yet.
Namespace Problems... Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Namespace Problems...

    Hi there

    I'm new to the web service stuff and try to work myself into the Spring Web Services. So i tried to modify a step-by-step tutorial I found ( ) which worked fine. The service runs in an Apache Tomcat and can receive (and responds to) SOAP messages via SoapUI locally as well as remote. I should add that the WSDL is generated dynamically.

    Now I'm required to code a small client which uses generated code form the WSDL (Wsdl2Java) as a basis to access the methods form the webservice. The generation seems to work just fine. I'm able to access my method pretty easily. But when I try to run my client (which uses Axis2 libs) it fails with

    "XPath expression uses unbound namespace prefix"

    I only use one custom namespace which (afaics) is declared right. So my problem is for once that i don't really know how Spring-ws handles namespaces and for the other that i don't really know how Axis2 handles namespaces. I already tried to upgrade some xml-related libraries (namely xalan and xerces) but that didn't do the trick.

    So I'm pretty stuck right now and hoping someone is able to help me out.

    Feel free to ask for details.

    Thank you for you attention.


    ps: English isn't my mother tongue

  • #2
    I'm currently experiencing the same issue. I've written a web service using Spring WS, have one namespace declared in my XML document, have used Axis 1.3 WSDL2Java to create a client, and I'm receiving the "XPath expression uses unbound namespace prefix" error when calling the web service from the Axis client.

    Did you ever find a solution to this issue?



    • #3
      I found my problem. The issue was a fundamental problem with understanding how to set up my XPath parameters and, as such, my Endpoint was expecting a very specific namespace prefix. Once I added the Namespace to the XPath expression the Endpoint worked fine when being called from Apache Axis 1.3.


      • #4
        how did you add the Namespace to the XPath expression


        • #5
          I'm using JDOM here so for other implementations you'd have to do some digging. What I've included below is just intended to give you a quick idea of the syntax and not as a full explanation. For a better overview you might look here:

          String path = <your path>;
          Namespace namespace = Namespace.getNamespace(<prefix>, <uri>);
          XPath path = XPath.newInstance(path);