- This topic has 5 replies, 5 voices, and was last updated 17 years, 8 months ago by Daryl Sawyer.
-
AuthorPosts
-
optimadParticipantHi 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/” xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”>
<soap:Body>
<ns2:productSearch xmlns:ns3=”http://www.example.com/schemas/commonTypes/20070108″ xmlns:ns2=”http://www.example.com/schemas/productSearch/20070108″>
<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)
Riyad KallaMemberI asked someone from the WS team to have a look at this for you.
Brian FernandesModeratorDaniel,
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.
optimadParticipantHi 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
athanikarMemberDid anyone get this issue solved. I am currently getting same issue. Client Stub not getting generated.
Thanks,
Daryl SawyerMemberI’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. -
AuthorPosts