Исключение при генерации исходного кода Java из URL WSDL - PullRequest
0 голосов
/ 01 марта 2011

Я пытаюсь сгенерировать Java-файл из wsdlurl.некоторые из них работают нормально, но у некоторых есть проблема в этом.вот код

    <plugins>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>jaxws-maven-plugin</artifactId>
                    <version>1.12</version>
                    <executions>
                        <execution>
                            <id>ad1</id>
                            <goals>
                                 <goal>wsimport</goal>
                            </goals>
                            <configuration>
                                <wsdlUrls>   
                                    <wsdlUrl>https://adcenterapi.microsoft.com/Api/Advertiser/v7/Reporting/ReportingService.svc?wsdl</wsdlUrl>
                                    <wsdlUrl>https://adcenterapi.microsoft.com/Api/Advertiser/v7/Administration/AdministrationService.svc?wsdl</wsdlUrl>
                                    <wsdlUrl>https://adcenterapi.microsoft.com/Api/Advertiser/v6/NotificationManagement/NotificationManagement.asmx?wsdl</wsdlUrl>
                                    <wsdlUrl>https://adcenterapi.microsoft.com/Api/Advertiser/v7/CampaignManagement/CampaignManagementService.svc?wsdl</wsdlUrl>
                                    <wsdlUrl>https://sharedservices.adcenterapi.microsoft.com/Api/Billing/v7/CustomerBillingService.svc?wsdl</wsdlUrl>
                                    <wsdlUrl>https://sharedservices.adcenterapi.microsoft.com/Api/CustomerManagement/v7/CustomerManagementService.svc?wsdl</wsdlUrl>
                                </wsdlUrls>
                                <target>2.1</target>
                                <xjcArgs>
                                    <xjcArg>-XautoNameResolution</xjcArg>
                                </xjcArgs>
                                <bindingDirectory>src/jaxws/wsdl/adCenter</bindingDirectory>
                                <keep>true</keep>
                                <packageName>com.microsoft.AdCenter.soap</packageName>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
</plugins>

Я делал это и раньше, но у меня нет проблем.Я очень запутался на этот раз.

Можете ли вы, ребята, попытаться сгенерировать исходный код Java с помощью wsdl в файле pom.Поскольку я попробовал в своей системе, я получаю исключения как

[ERROR] Two declarations cause a collision in the ObjectFactory class.
  line 1 of https://adcenterapi.microsoft.com/Api/Advertiser/v7/CampaignManagement/CampaignManagementService.svc?xsd=xsd1

[ERROR] (Related to above error) This is the other declaration.
  line 1 of https://adcenterapi.microsoft.com/Api/Advertiser/v7/CampaignManagement/CampaignManagementService.svc?xsd=xsd1

[ERROR] Two declarations cause a collision in the ObjectFactory class.
  line 1 of https://adcenterapi.microsoft.com/Api/Advertiser/v7/CampaignManagement/CampaignManagementService.svc?xsd=xsd1

[ERROR] (Related to above error) This is the other declaration.
  line 1 of https://adcenterapi.microsoft.com/Api/Advertiser/v7/CampaignManagement/CampaignManagementService.svc?xsd=xsd1

[ERROR] Two declarations cause a collision in the ObjectFactory class.
  line 1 of https://adcenterapi.microsoft.com/Api/Advertiser/v7/CampaignManagement/CampaignManagementService.svc?xsd=xsd1

[ERROR] (Related to above error) This is the other declaration.
  line 1 of https://adcenterapi.microsoft.com/Api/Advertiser/v7/CampaignManagement/CampaignManagementService.svc?xsd=xsd1

[ERROR] Two declarations cause a collision in the ObjectFactory class.
  line 1 of https://adcenterapi.microsoft.com/Api/Advertiser/v7/CampaignManagement/CampaignManagementService.svc?xsd=xsd1

[ERROR] (Related to above error) This is the other declaration.
  line 1 of https://adcenterapi.microsoft.com/Api/Advertiser/v7/CampaignManagement/CampaignManagementService.svc?xsd=xsd1

Любые идеи?

1 Ответ

1 голос
/ 02 марта 2011

Я просто догадываюсь, но похоже, что есть конфликты имен. Вы можете попытаться разбить ваш wsimport на несколько шагов и использовать для каждого из них разные разделы <packageName>.

...