Bonjour,

J'essaye de migrer mon projet comportant des web services, de NetBeans à Eclipse.

Sous NetBeans c'est assez intuitif comme démarche, je crée un web service client, je renseigne l'URL du WSDL et après j'initialise mon service :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
        Lists service = new Lists();
 
         //on initialise un objet avec les méthodes
         ListsSoap lListsSoap = service.getListsSoap12();
 
        //on créé notre objet de retour à vide
        GetListResponse.GetListResult lGetListResult  = new GetListResponse.GetListResult ();
 
        //on appel la méthode 
        lGetListResult = lListsSoap.getList("Application");
mais quand je fais la même démarche sous Eclipse, je crée un web service client, puis je renseigne l'url du WSDL, ça bloque lorsque je veux initialiser mon service. Il ne le reconnait pas et me souligne Lists(), avec l'erreur
cannot instantiate the type list
Mon code de Lists.java sur NetBeans (le service que je veux initialiser) :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
package testgetlistsharepoint;
 
/**
 * This class was generated by the JAX-WS RI.
 * JAX-WS RI 2.2.6-1b01 
 * Generated source version: 2.2
 * 
 */
@WebServiceClient(name = "Lists", targetNamespace = "http://schemas.microsoft.com/sharepoint/soap/", wsdlLocation = "http://sharepoint.lauma.lan/verse/_vti_bin/Lists.asmx?WSDL")
public class Lists
    extends Service {
 
    private final static URL LISTS_WSDL_LOCATION;
    private final static WebServiceException LISTS_EXCEPTION;
    private final static QName LISTS_QNAME = new QName("http://schemas.microsoft.com/sharepoint/soap/", "Lists");
 
    static {
        URL url = null;
        WebServiceException e = null;
        try {
            url = new URL("http://sharepoint.lauma.lan/_vti_bin/Lists.asmx?WSDL");
        } catch (MalformedURLException ex) {
            e = new WebServiceException(ex);
        }
        LISTS_WSDL_LOCATION = url;
        LISTS_EXCEPTION = e;
    }
 
    public Lists() {
        super(__getWsdlLocation(), LISTS_QNAME);
    }
 
    public Lists(WebServiceFeature... features) {
        super(__getWsdlLocation(), LISTS_QNAME, features);
    }
 
    public Lists(URL wsdlLocation) {
        super(wsdlLocation, LISTS_QNAME);
    }
 
    public Lists(URL wsdlLocation, WebServiceFeature... features) {
        super(wsdlLocation, LISTS_QNAME, features);
    }
 
    public Lists(URL wsdlLocation, QName serviceName) {
        super(wsdlLocation, serviceName);
    }
 
    public Lists(URL wsdlLocation, QName serviceName, WebServiceFeature... features) {
        super(wsdlLocation, serviceName, features);
    }
 
    /**
     * 
     * @return
     *     returns ListsSoap
     */
    @WebEndpoint(name = "ListsSoap")
    public ListsSoap getListsSoap() {
        return super.getPort(new QName("http://schemas.microsoft.com/sharepoint/soap/", "ListsSoap"), ListsSoap.class);
    }
 
    /**
     * 
     * @param features
     *     A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy.  Supported features not in the <code>features</code> parameter will have their default values.
     * @return
     *     returns ListsSoap
     */
    @WebEndpoint(name = "ListsSoap")
    public ListsSoap getListsSoap(WebServiceFeature... features) {
        return super.getPort(new QName("http://schemas.microsoft.com/sharepoint/soap/", "ListsSoap"), ListsSoap.class, features);
    }
 
    /**
     * 
     * @return
     *     returns ListsSoap
     */
    @WebEndpoint(name = "ListsSoap12")
    public ListsSoap getListsSoap12() {
        return super.getPort(new QName("http://schemas.microsoft.com/sharepoint/soap/", "ListsSoap12"), ListsSoap.class);
    }
 
    /**
     * 
     * @param features
     *     A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy.  Supported features not in the <code>features</code> parameter will have their default values.
     * @return
     *     returns ListsSoap
     */
    @WebEndpoint(name = "ListsSoap12")
    public ListsSoap getListsSoap12(WebServiceFeature... features) {
        return super.getPort(new QName("http://schemas.microsoft.com/sharepoint/soap/", "ListsSoap12"), ListsSoap.class, features);
    }
 
    private static URL __getWsdlLocation() {
        if (LISTS_EXCEPTION!= null) {
            throw LISTS_EXCEPTION;
        }
        return LISTS_WSDL_LOCATION;
    }
}
Mon code Lists.java sous Eclipse (le service web que je veux initialiser) :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
package com.microsoft.schemas.sharepoint.soap;
 
public interface Lists extends javax.xml.rpc.Service {
    public java.lang.String getListsSoapAddress();
 
    public com.microsoft.schemas.sharepoint.soap.ListsSoap getListsSoap() throws javax.xml.rpc.ServiceException;
 
    public com.microsoft.schemas.sharepoint.soap.ListsSoap getListsSoap(java.net.URL portAddress) throws javax.xml.rpc.ServiceException;
}
Quelqu'un saurait-il m'indiquer comment résoudre ce problème ?

Merci d'avance pour votre aide.