facebook

XFire WS Client, Annotations and changing namespace prefixes

  1. MyEclipse Archived
  2.  > 
  3. Web Services
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #265706 Reply

    optimad
    Participant

    Hi There,

    We are having issues changing the namespace prefix in a SOAP message when using xfire as our client to call a web service.

    Using annotations at package level we should be able to do something like the following:

    @javax.xml.bind.annotation.XmlSchema (
    xmlns = {
    @javax.xml.bind.annotation.XmlNs(prefix=”prd”, namespaceURI=”http://www.example.com/schemas/productSearch/20070108″),
    @javax.xml.bind.annotation.XmlNs(prefix=”common”, namespaceURI=”http://www.example.com/schemas/commonTypes/20070108″)
    }
    )

    In package-info.java and then see prefixes such as “prd” and “common” in the resulting SOAP message. We always get the following:

    <soap:Envelope xmlns:soap=”http://schemas.xmlsoap.org/soap/envelope/&#8221; xmlns:xsd=”http://www.w3.org/2001/XMLSchema&#8221; xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”&gt;
    <soap:Body>
    <ns2:productSearch xmlns:ns3=”http://www.example.com/schemas/commonTypes/20070108&#8243; xmlns:ns2=”http://www.example.com/schemas/productSearch/20070108″&gt;
    <ns2:productSearchText>HEDGEHOG</ns2:productSearchText>
    <ns3:dateRange>
    <ns3:startDate>2007-01-10</ns3:startDate>
    <ns3:endDate>2007-01-20</ns3:endDate>
    </ns3:dateRange>
    </ns2:productSearch>
    </soap:Body>
    </soap:Envelope>

    For some reason our element namespaces are being used correctly to generate the xmlns tags, but the prefixes are the defaults n2, n3, etc… instead of “prd”, “common”, etc… It seems like the package level annotations, in particular the XmlNS annotation is being ignored.

    Does anyone have any tips to try or examples to share? Is this a known issue (we are using 1.2.4)?

    Thank you for your help.

    Daniel (Optimad)

    #265746 Reply

    Riyad Kalla
    Member

    I asked someone from the WS team to have a look at this for you.

    #265993 Reply

    Brian Fernandes
    Moderator

    Daniel,

    Sorry for the delayed response. In your services.xml file for the service bean, the <serviceClass> element should point to your WS implementation class and the <implementationClass> element should be deleted.
    There was a bug in releases of MyEclipse prior to 5.5M1 where incorrect code was generated. Does your services.xml file already follow the above? If not, could you make the change and see if it solves your issue?

    I’ll check if XFire correctly understands those annotations.

    #266039 Reply

    optimad
    Participant

    Hi Brian,

    Thank you for your response on this. I made the changes in my services.xml file but I am still not getting the correct namespaces.

    For the record, we are using the latest version of MyEclipse (5.1.0 GA) and xfire 1.2.4.

    Thanks for your help

    Daniel

    #266814 Reply

    athanikar
    Member

    Did anyone get this issue solved. I am currently getting same issue. Client Stub not getting generated.

    Thanks,

    #266910 Reply

    Daryl Sawyer
    Member

    I’m having the same problems. The jsr 181 annotation from the xfire page doesn’t appear to work.
    I’d sure like to see someone solve this. The default parameter names are horrible. I need something meaningful if I’m going to share this service.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: XFire WS Client, Annotations and changing namespace prefixes

You must be logged in to post in the forum log in