Results 1 to 5 of 5

Thread: Namespace Problems...

  1. #1
    Join Date
    Sep 2009
    Posts
    1

    Default 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 ( http://springtips.blogspot.com/2007/...spring-ws.html ) 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.

    foo

    ps: English isn't my mother tongue

  2. #2
    Join Date
    Jun 2009
    Posts
    8

    Default

    Hello,
    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?

    Thanks!
    Dave

  3. #3
    Join Date
    Jun 2009
    Posts
    8

    Default

    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. #4

    Default

    how did you add the Namespace to the XPath expression

  5. #5
    Join Date
    Jun 2009
    Posts
    8

    Default

    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: http://onjava.com/pub/a/onjava/2005/01/12/xpath.html

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

Tags for this Thread

Posting Permissions

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