Skip to main content

Bing and JAX-WS RI

Posted by jitu on July 28, 2009 at 7:25 PM PDT

Bing and JAX-WS

Too bad, wsimport doesn't work out of the box to consume bing's wsdl. It reports conflicts for SearchRequest and SearchResponse.

You could use an unsupported(and undocumented!) wsimport switch -XautoNameResoultion that resolves the conflicts automatically. .

wsimport -B-XautoNameResolution

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 node="wsdl:definitions/wsdl:types/xsd:schema[@targetNamespace='']/xsd:complexType[@name='SearchRequest']">
        <jaxb:class name="RequestParameters"/>
    <bindings node="wsdl:definitions/wsdl:types/xsd:schema[@targetNamespace='']/xsd:complexType[@name='SearchResponse']">
        <jaxb:class name="ResponseParameters"/>

wsimport -b custom.xml

I couldn't try the search service myself as I need to get AppId!

Related Topics >>