Bing and JAX-WS RI
You could use an unsupported(and undocumented!) wsimport switch -XautoNameResoultion that resolves the conflicts automatically. .
wsimport -B-XautoNameResolution http://api.search.live.net/search.wsdl
See it creates SearchRequest, SearchRequest2, SearchResponse, SearchResponse2 during the resolution
The standard solution is to use a customization file to resolve the conflicts and give some meaningful names. The following custom.xml file provides exactly the same(considering RequestParameters, ResponseParameters are good names !!)
<bindings
xmlns="http://java.sun.com/xml/ns/jaxws"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb">
<bindings node="wsdl:definitions/wsdl:types/xsd:schema[@targetNamespace='http://schemas.microsoft.com/LiveSearch/2008/03/Search']/xsd:complexType[@name='SearchRequest']">
<jaxb:class name="RequestParameters"/>
</bindings>
<bindings node="wsdl:definitions/wsdl:types/xsd:schema[@targetNamespace='http://schemas.microsoft.com/LiveSearch/2008/03/Search']/xsd:complexType[@name='SearchResponse']">
<jaxb:class name="ResponseParameters"/>
</bindings>
</bindings>
wsimport -b custom.xml http://api.search.live.net/search.wsdl
I couldn't try the search service myself as I need to get AppId!
- Login or register to post comments
- Printer-friendly version
- jitu's blog
- 3518 reads





