2015-02-10 1 views
1

Я хочу подключиться к Salesforce с помощью Java. Однако, когда я пытаюсь разобрать partner.wsdl с помощью wsimport я получаю следующие ошибки:Ошибки при разборе Salesforce Partner WSDL с использованием wsimport

parsing WSDL... 
[WARNING] src-resolve: Cannot resolve the name 'tns:ID' to a(n) 'type definition' component. 
    line 29 of file:/C:/Users/Rajasekhar/Desktop/partner.wsdl#types?schema1 
[ERROR] A class/interface with the same name "com.sforce.soap.partner.DescribeGlobalTheme" is already in use. Use a class customization to resolve this conflict. 
    line 1830 of file:/C:/Users/Rajasekhar/Desktop/partner.wsdl 
[ERROR] (Relevant to above error) another "DescribeGlobalTheme" is generated from here. 
    line 759 of file:/C:/Users/Rajasekhar/Desktop/partner.wsdl 
[ERROR] A class/interface with the same name "com.sforce.soap.partner.DescribeApprovalLayout" is already in use. Use a class customization to resolve this conflict. 
    line 2005 of file:/C:/Users/Rajasekhar/Desktop/partner.wsdl 
[ERROR] (Relevant to above error) another "DescribeApprovalLayout" is generated from here. 
    line 1094 of file:/C:/Users/Rajasekhar/Desktop/partner.wsdl 
[ERROR] A class/interface with the same name "com.sforce.soap.partner.DescribeLayout" is already in use. Use a class customization to resolve this conflict. 
    line 1954 of file:/C:/Users/Rajasekhar/Desktop/partner.wsdl 
[ERROR] (Relevant to above error) another "DescribeLayout" is generated from here. 
    line 1112 of file:/C:/Users/Rajasekhar/Desktop/partner.wsdl 
[ERROR] Two declarations cause a collision in the ObjectFactory class. 
    line 1830 of file:/C:/Users/Rajasekhar/Desktop/partner.wsdl 
[ERROR] (Related to above error) This is the other declaration. 
    line 759 of file:/C:/Users/Rajasekhar/Desktop/partner.wsdl 
[ERROR] Two declarations cause a collision in the ObjectFactory class. 
    line 2005 of file:/C:/Users/Rajasekhar/Desktop/partner.wsdl 
[ERROR] (Related to above error) This is the other declaration. 
    line 1094 of file:/C:/Users/Rajasekhar/Desktop/partner.wsdl 
[ERROR] Two declarations cause a collision in the ObjectFactory class. 
    line 1954 of file:/C:/Users/Rajasekhar/Desktop/partner.wsdl 
[ERROR] (Related to above error) This is the other declaration. 
    line 1112 of file:/C:/Users/Rajasekhar/Desktop/partner.wsdl 

Этот WSDL был создан из самой Salesforce. Как я должен генерировать классы, необходимые для его использования?

ответ

0

Проблемы вызваны WSDL, используя повторяющиеся имена, которые отличаются только в корпусе:

<complexType name="DescribeGlobalTheme"> 
<element name="describeGlobalTheme"> 

Это наиболее легко решается путем запуска с соответствующим расширением JAXB:

wsimport -extension -B-XautoNameResolution ... 

Затем это будет правильно генерировать два отдельных класса:

@XmlType(name = "DescribeGlobalTheme", propOrder = { "global", "theme" }) 
public class DescribeGlobalTheme { 
@XmlRootElement(name = "describeGlobalTheme") 
public class DescribeGlobalTheme2 { 

В качестве альтернативы используйте вместо этого Force.com Web Services Connector.

 Смежные вопросы

  • Нет связанных вопросов^_^