IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Services Web Java Discussion :

Le client Java ne peut invoquer des WS ASP.NET dès que j'utilise plusieurs WSDL ensemble. WSDL fautifs?


Sujet :

Services Web Java

  1. #1
    Membre éclairé

    Profil pro
    Inscrit en
    Janvier 2007
    Messages
    605
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2007
    Messages : 605
    Points : 670
    Points
    670
    Par défaut Le client Java ne peut invoquer des WS ASP.NET dès que j'utilise plusieurs WSDL ensemble. WSDL fautifs?
    Bonjour,

    Je souhaite invoquer en Java des web-services créés par une société qui a développé ses services en ASP.NET.

    J'utilise Java 6.0,
    le plugin Maven org.codehaus.mojo:jaxws-maven-plugin:1.12
    et JAXWS com.sun.xml.ws:jaxws-rt:2.1.7
    qui produisent via wsimport des stubs marqués ainsi:
    * JAX-WS RI 2.1.7-b01-
    * Generated source version: 2.1

    Lorsque j'invoque chaque web-service individuellement,
    c'est à dire que je me limite à importer languages_test.wsdl, par exemple (les WSDL sont en pièce jointe, renommés en xml pour pouvoir être présentés sur le forum), l'exécution est correcte.

    Et il en va de même pour les pays, fournisseurs, etc.

    Mais dès que j'essaie de mettre au point mon batch final, qui doit balayer les pays pour y trouver des fournisseurs et prendre des descriptions de leurs produits dans différentes langues, il semble qu'il y ait des conflits.

    wsimport importe languages_test.wsdl, products_test.wsdl, countries_test.wdsl, authentification_test.wdsl et countrysuppliermembers.wsdl ensemble.

    Les invocations qui réussissaient auparavant échouent alors, pour des raisons qui varient selon les expérimentations que je fais.
    Une méthode languages.Get(token, 1); peut me répondre qu'elle a reçu le paramètre zéro,
    Ou bien me répondre qu'elle ne connait pas [www.onlineidd.com/ws/v1/]Language ou renvoyer un objet de classe ElementNSImpl valant [anyType: null], ce qui doit signifier à peut près la même chose.
    Il existe d'autres manifestations du problème.

    Je peux introduire d'autres WSDL pour compléter ceux que j'ai:
    j'en ai une douzaine, d'autre précisant la structure des DateRange, ProductVariant ou autres déclarations que vous pouvez voir dans les WSDL en pièce jointe. Mais si je les introduits à WSImport, rien ne fonctionnera plus du tout, à l'exécution.

    Je suspecte que les WSDL que l'on m'a remis ne sont pas exploitables ensemble, mais je ne suis pas sûr de moi.
    Selon mon interprétation, ils proposent tous - excepté authentification_test.wsdl - des méthodes Get, AddUpdate, GetList,
    ces méthodes sont toutes associées au même namespace et ont les mêmes actions.

    Quand je regarde le fichier java généré par products_test.wsdl: ProductSoap.java, par exemple, je lis ceci:

    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
    /**
     * This class was generated by the JAX-WS RI.
     * JAX-WS RI 2.1.7-b01-
     * Generated source version: 2.1
     * 
     */
    @WebService(name = "ProductsSoap", targetNamespace = "http://www.onlineidd.com/ws/v1")
    @XmlSeeAlso({
        ObjectFactory.class
    })
    public interface ProductsSoap {
     
     
        /**
         * 
         * @param product
         * @param token
         * @return
         *     returns com.onlineidd.ws.v1.OperationResult
         */
        @WebMethod(operationName = "AddUpdate", action = "http://www.onlineidd.com/ws/v1/AddUpdate")
        @WebResult(name = "AddUpdateResult", targetNamespace = "http://www.onlineidd.com/ws/v1")
        @RequestWrapper(localName = "AddUpdate", targetNamespace = "http://www.onlineidd.com/ws/v1", className = "com.onlineidd.ws.v1.AddUpdate")
        @ResponseWrapper(localName = "AddUpdateResponse", targetNamespace = "http://www.onlineidd.com/ws/v1", className = "com.onlineidd.ws.v1.AddUpdateResponse")
        public OperationResult addUpdate(
            @WebParam(name = "token", targetNamespace = "http://www.onlineidd.com/ws/v1")
            String token,
            @WebParam(name = "product", targetNamespace = "http://www.onlineidd.com/ws/v1")
            Product product);
     
        /**
         * 
         * @param id
         * @param token
         * @return
         *     returns com.onlineidd.ws.v1.OperationResult
         */
        @WebMethod(operationName = "Get", action = "http://www.onlineidd.com/ws/v1/Get")
        @WebResult(name = "GetResult", targetNamespace = "http://www.onlineidd.com/ws/v1")
        @RequestWrapper(localName = "Get", targetNamespace = "http://www.onlineidd.com/ws/v1", className = "com.onlineidd.ws.v1.Get")
        @ResponseWrapper(localName = "GetResponse", targetNamespace = "http://www.onlineidd.com/ws/v1", className = "com.onlineidd.ws.v1.GetResponse")
        public OperationResult get(
            @WebParam(name = "token", targetNamespace = "http://www.onlineidd.com/ws/v1")
            String token,
            @WebParam(name = "id", targetNamespace = "http://www.onlineidd.com/ws/v1")
            int id);
     
        /**
         * 
         * @param token
         * @param countryID
         * @param memberID
         * @return
         *     returns com.onlineidd.ws.v1.OperationResult
         */
        @WebMethod(operationName = "GetListByCountryIDAndMemberID", action = "http://www.onlineidd.com/ws/v1/GetListByCountryIDAndMemberID")
        @WebResult(name = "GetListByCountryIDAndMemberIDResult", targetNamespace = "http://www.onlineidd.com/ws/v1")
        @RequestWrapper(localName = "GetListByCountryIDAndMemberID", targetNamespace = "http://www.onlineidd.com/ws/v1", className = "com.onlineidd.ws.v1.GetListByCountryIDAndMemberID")
        @ResponseWrapper(localName = "GetListByCountryIDAndMemberIDResponse", targetNamespace = "http://www.onlineidd.com/ws/v1", className = "com.onlineidd.ws.v1.GetListByCountryIDAndMemberIDResponse")
        public OperationResult getListByCountryIDAndMemberID(
            @WebParam(name = "token", targetNamespace = "http://www.onlineidd.com/ws/v1")
            String token,
            @WebParam(name = "countryID", targetNamespace = "http://www.onlineidd.com/ws/v1")
            int countryID,
            @WebParam(name = "memberID", targetNamespace = "http://www.onlineidd.com/ws/v1")
            int memberID);
     
        /**
         * 
         * @param token
         * @param productFilter
         * @return
         *     returns com.onlineidd.ws.v1.OperationResult
         */
        @WebMethod(operationName = "GetListByFilter", action = "http://www.onlineidd.com/ws/v1/GetListByFilter")
        @WebResult(name = "GetListByFilterResult", targetNamespace = "http://www.onlineidd.com/ws/v1")
        @RequestWrapper(localName = "GetListByFilter", targetNamespace = "http://www.onlineidd.com/ws/v1", className = "com.onlineidd.ws.v1.GetListByFilter")
        @ResponseWrapper(localName = "GetListByFilterResponse", targetNamespace = "http://www.onlineidd.com/ws/v1", className = "com.onlineidd.ws.v1.GetListByFilterResponse")
        public OperationResult getListByFilter(
            @WebParam(name = "token", targetNamespace = "http://www.onlineidd.com/ws/v1")
            String token,
            @WebParam(name = "productFilter", targetNamespace = "http://www.onlineidd.com/ws/v1")
            ProductFilter productFilter);
     
        /**
         * 
         * @param id
         * @param token
         * @return
         *     returns com.onlineidd.ws.v1.OperationResult
         */
        @WebMethod(operationName = "Remove", action = "http://www.onlineidd.com/ws/v1/Remove")
        @WebResult(name = "RemoveResult", targetNamespace = "http://www.onlineidd.com/ws/v1")
        @RequestWrapper(localName = "Remove", targetNamespace = "http://www.onlineidd.com/ws/v1", className = "com.onlineidd.ws.v1.Remove")
        @ResponseWrapper(localName = "RemoveResponse", targetNamespace = "http://www.onlineidd.com/ws/v1", className = "com.onlineidd.ws.v1.RemoveResponse")
        public OperationResult remove(
            @WebParam(name = "token", targetNamespace = "http://www.onlineidd.com/ws/v1")
            String token,
            @WebParam(name = "id", targetNamespace = "http://www.onlineidd.com/ws/v1")
            int id);
    }
    Et pour languages_test.wsdl: LanguageSOAP.java, j'ai ceci:
    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
     
    package com.onlineidd.ws.v1;
     
    import javax.jws.WebMethod;
    import javax.jws.WebParam;
    import javax.jws.WebResult;
    import javax.jws.WebService;
    import javax.xml.bind.annotation.XmlSeeAlso;
    import javax.xml.ws.RequestWrapper;
    import javax.xml.ws.ResponseWrapper;
     
     
    /**
     * This class was generated by the JAX-WS RI.
     * JAX-WS RI 2.1.7-b01-
     * Generated source version: 2.1
     * 
     */
    @WebService(name = "LanguagesSoap", targetNamespace = "http://www.onlineidd.com/ws/v1")
    @XmlSeeAlso({
        ObjectFactory.class
    })
    public interface LanguagesSoap {
     
     
        /**
         * 
         * @param id
         * @param token
         * @return
         *     returns com.onlineidd.ws.v1.OperationResult
         */
        @WebMethod(operationName = "Get", action = "http://www.onlineidd.com/ws/v1/Get")
        @WebResult(name = "GetResult", targetNamespace = "http://www.onlineidd.com/ws/v1")
        @RequestWrapper(localName = "Get", targetNamespace = "http://www.onlineidd.com/ws/v1", className = "com.onlineidd.ws.v1.Get")
        @ResponseWrapper(localName = "GetResponse", targetNamespace = "http://www.onlineidd.com/ws/v1", className = "com.onlineidd.ws.v1.GetResponse")
        public OperationResult get(
            @WebParam(name = "token", targetNamespace = "http://www.onlineidd.com/ws/v1")
            String token,
            @WebParam(name = "id", targetNamespace = "http://www.onlineidd.com/ws/v1")
            int id);
     
        /**
         * 
         * @param token
         * @return
         *     returns com.onlineidd.ws.v1.OperationResult
         */
        @WebMethod(operationName = "GetList", action = "http://www.onlineidd.com/ws/v1/GetList")
        @WebResult(name = "GetListResult", targetNamespace = "http://www.onlineidd.com/ws/v1")
        @RequestWrapper(localName = "GetList", targetNamespace = "http://www.onlineidd.com/ws/v1", className = "com.onlineidd.ws.v1.GetList")
        @ResponseWrapper(localName = "GetListResponse", targetNamespace = "http://www.onlineidd.com/ws/v1", className = "com.onlineidd.ws.v1.GetListResponse")
        public OperationResult getList(
            @WebParam(name = "token", targetNamespace = "http://www.onlineidd.com/ws/v1")
            String token);
     
        /**
         * 
         * @param token
         * @param proxyType
         * @return
         *     returns com.onlineidd.ws.v1.OperationResult
         */
        @WebMethod(operationName = "AddUpdate", action = "http://www.onlineidd.com/ws/v1/AddUpdate")
        @WebResult(name = "AddUpdateResult", targetNamespace = "http://www.onlineidd.com/ws/v1")
        @RequestWrapper(localName = "AddUpdate", targetNamespace = "http://www.onlineidd.com/ws/v1", className = "com.onlineidd.ws.v1.AddUpdate")
        @ResponseWrapper(localName = "AddUpdateResponse", targetNamespace = "http://www.onlineidd.com/ws/v1", className = "com.onlineidd.ws.v1.AddUpdateResponse")
        public OperationResult addUpdate(
            @WebParam(name = "token", targetNamespace = "http://www.onlineidd.com/ws/v1")
            String token,
            @WebParam(name = "proxyType", targetNamespace = "http://www.onlineidd.com/ws/v1")
            Language proxyType);
     
        /**
         * 
         * @param id
         * @param token
         * @return
         *     returns com.onlineidd.ws.v1.OperationResult
         */
        @WebMethod(operationName = "Remove", action = "http://www.onlineidd.com/ws/v1/Remove")
        @WebResult(name = "RemoveResult", targetNamespace = "http://www.onlineidd.com/ws/v1")
        @RequestWrapper(localName = "Remove", targetNamespace = "http://www.onlineidd.com/ws/v1", className = "com.onlineidd.ws.v1.Remove")
        @ResponseWrapper(localName = "RemoveResponse", targetNamespace = "http://www.onlineidd.com/ws/v1", className = "com.onlineidd.ws.v1.RemoveResponse")
        public OperationResult remove(
            @WebParam(name = "token", targetNamespace = "http://www.onlineidd.com/ws/v1")
            String token,
            @WebParam(name = "id", targetNamespace = "http://www.onlineidd.com/ws/v1")
            int id);
    }
    J'ai l'impression que ces deux stubs sont trop proches.
    Comment le serveur distant peut-il distinguer l'invocation de l'un ou de l'autre? Les méthodes Get, GetList et consort me semblent avoir les mêmes signatures: action et namespaces?

    Comme je ne suis pas très à l'aise avec les web-services, je me demande si j'ai raison de trouver ces WSDL fautifs, ou si je m'y suis mal pris dans mes opérations pour utiliser ensemble ces différents services.

    En vous remerciant de vos idées,

    Grunt.
    Fichiers attachés Fichiers attachés

Discussions similaires

  1. Réponses: 3
    Dernier message: 07/10/2014, 07h59
  2. Réponses: 0
    Dernier message: 20/04/2012, 10h36
  3. organiser son code dans des pages ASP.NET
    Par Paul Van Walleghem dans le forum ASP.NET
    Réponses: 2
    Dernier message: 30/05/2008, 15h21
  4. Utlisation d'autres langues sur des pages ASP.NET 2005
    Par nkonito dans le forum ASP.NET
    Réponses: 2
    Dernier message: 18/07/2007, 15h56

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo