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 :

Service Web avec Axis et types complexes.


Sujet :

Services Web Java

  1. #1
    Nouveau membre du Club
    Homme Profil pro
    Administrateur de base de données
    Inscrit en
    Mai 2005
    Messages
    7
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Administrateur de base de données

    Informations forums :
    Inscription : Mai 2005
    Messages : 7
    Par défaut Service Web avec Axis et types complexes.
    Bonjour à tous,

    J'utilises Apache Axis pour réaliser des services web. A l'intérieur d'une classe (du service web), ma méthode retourne un type complexe.

    Je déploie sans problème mon service web sur le serveur, et je génère les fichiers java pour le client avec WSDL2Java. A partir de là, je crée un autre fichier client (qui utilise les fichiers générés) pour invoquer mon service web et récuperer un paramètre. Cela fonctionne très bien lorsque le service web retourne un type simple.
    Des que le type est complexe, cela ne marche pas.

    En faisant une recherche via google, j'ai vu qu'il fallait serialiser mon objet retourné par le service web. Mais je vois pas très bien à quel endroit il faut le faire (sur mon client, lors de l'invocation du service web, ou directement dans le service web (dans le constructeur?)) ?

    Voila, si quelqu'un peut m'aider, ca serait génial.

  2. #2
    Membre Expert
    Avatar de xavlours
    Inscrit en
    Février 2004
    Messages
    1 832
    Détails du profil
    Informations forums :
    Inscription : Février 2004
    Messages : 1 832
    Par défaut
    Bonjour,
    je verrais bien ce sujet sur le forum J2EE, mais bon. Je suis pas expert, mais déjà :
    Citation Envoyé par Skyman37
    Des que le type est complexe, cela ne marche pas.
    C'est-à-dire ? Le client ne compile pas ? Ne se déploie pas ? Ne se charge pas ? N'envoie pas la requête ? Ne reçoit pas la réponse ? Ne comprend pas la réponse ?

    Ben là je crois que j'ai dit tout ce que je savais. A toi de jouer.

    Mon expérience des services web se résume à l'utilisation de wisards Eclipse, mais il me semble que sérialiser tes objets à la main est inutile. Ca doit déjà être fait (surtout que tu as parlé de classes générées automatiquement, il doit y avoir des stubs ou des proxys la dedans, c'est des classes qui s'occupent de la communication).
    "Le bon ni le mauvais ne me feraient de peine si si si je savais que j'en aurais l'étrenne." B.V.
    Non au langage SMS ! Je ne répondrai pas aux questions techniques par MP.
    Eclipse : News, FAQ, Cours, Livres, Blogs.Et moi.

  3. #3
    Nouveau membre du Club
    Homme Profil pro
    Administrateur de base de données
    Inscrit en
    Mai 2005
    Messages
    7
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Administrateur de base de données

    Informations forums :
    Inscription : Mai 2005
    Messages : 7
    Par défaut
    Citation Envoyé par xavlours
    Bonjour,
    je verrais bien ce sujet sur le forum J2EE, mais bon. Je suis pas expert, mais déjà :

    C'est-à-dire ? Le client ne compile pas ? Ne se déploie pas ? Ne se charge pas ? N'envoie pas la requête ? Ne reçoit pas la réponse ? Ne comprend pas la réponse ?

    Ben là je crois que j'ai dit tout ce que je savais. A toi de jouer.

    Mon expérience des services web se résume à l'utilisation de wisards Eclipse, mais il me semble que sérialiser tes objets à la main est inutile. Ca doit déjà être fait (surtout que tu as parlé de classes générées automatiquement, il doit y avoir des stubs ou des proxys la dedans, c'est des classes qui s'occupent de la communication).

    Merci de ta réponse. Alors cela se compile bien (du côté client et serveur). Ca envoie la requête. J'ai vérifié, apparemment les objets sont bien sérialisés par les classes générés (j'avais oublié certaines classes générées).

    Lorsque j'appelle une méthode du service web qui renvoie une chaine de caractères, cela marche comme il faut (je reçois bien une réponse).
    Par contre, lorsque la méthode du serviec web renvoie une structure de données (type complexe), je ne reçois aucune réponse, et j'ai ce message d'erreur :

    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
    Exception in thread "main" AxisFault
     faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
     faultSubcode: 
     faultString: org.xml.sax.SAXParseException: Premature end of file.
     faultActor: 
     faultNode: 
     faultDetail: 
    	{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: Premature end of file.
    	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
    	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:215)
    	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:386)
    	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
    	at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:230)
    	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:798)
    	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
    	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
    	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
    	at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
    	at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
    	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
    	at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
    	at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
    	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
    	at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    	at org.apache.axis.client.Call.invoke(Call.java:2767)
    	at org.apache.axis.client.Call.invoke(Call.java:2443)
    	at org.apache.axis.client.Call.invoke(Call.java:2366)
    	at org.apache.axis.client.Call.invoke(Call.java:1812)
    	at localhost.axis.services.PWFServicesVehiculeImplementation.PWFServicesVehiculeImplementationSoapBindingStub.rechercherVehicules(PWFServicesVehiculeImplementationSoapBindingStub.java:640)
    	at src.PWFServicesVehiculeImplementationClient.main(PWFServicesVehiculeImplementationClient.java:17)
     
    	{http://xml.apache.org/axis/}hostname:ADCNA011
     
    org.xml.sax.SAXParseException: Premature end of file.
    	at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
    	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:701)
    	at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
    	at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
    	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
    	at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    	at org.apache.axis.client.Call.invoke(Call.java:2767)
    	at org.apache.axis.client.Call.invoke(Call.java:2443)
    	at org.apache.axis.client.Call.invoke(Call.java:2366)
    	at org.apache.axis.client.Call.invoke(Call.java:1812)
    	at localhost.axis.services.PWFServicesVehiculeImplementation.PWFServicesVehiculeImplementationSoapBindingStub.rechercherVehicules(PWFServicesVehiculeImplementationSoapBindingStub.java:640)
    	at src.PWFServicesVehiculeImplementationClient.main(PWFServicesVehiculeImplementationClient.java:17)
    Caused by: org.xml.sax.SAXParseException: Premature end of file.
    	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
    	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:215)
    	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:386)
    	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
    	at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:230)
    	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:798)
    	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
    	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
    	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
    	at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
    	at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
    	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
    	... 10 more

  4. #4
    Membre Expert
    Avatar de xavlours
    Inscrit en
    Février 2004
    Messages
    1 832
    Détails du profil
    Informations forums :
    Inscription : Février 2004
    Messages : 1 832
    Par défaut
    Mmm je suis pas sûr d'avoir bien compris si cette erreur a lieu côté serveur ou client ?

    Sinon, si tu m'envoies le .wsdl, je peux te générer des classes de proxy (Eclipse WTP). Il me semble que ça marchait chez moi, et à vue de nez, j'utilise les mêmes librairies.
    "Le bon ni le mauvais ne me feraient de peine si si si je savais que j'en aurais l'étrenne." B.V.
    Non au langage SMS ! Je ne répondrai pas aux questions techniques par MP.
    Eclipse : News, FAQ, Cours, Livres, Blogs.Et moi.

  5. #5
    Membre éprouvé
    Homme Profil pro
    Inscrit en
    Juin 2005
    Messages
    86
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Juin 2005
    Messages : 86
    Par défaut
    ton wsdl tu l'as généré automatiquement ?

    Y'a moyen de voir la classe du type complexe que tu renvoies ?

    Avec le wsdl et ta classe du type complexe, on devrait mieux comprendre

  6. #6
    Nouveau membre du Club
    Homme Profil pro
    Administrateur de base de données
    Inscrit en
    Mai 2005
    Messages
    7
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Administrateur de base de données

    Informations forums :
    Inscription : Mai 2005
    Messages : 7
    Par défaut
    Citation Envoyé par xavlours
    Mmm je suis pas sûr d'avoir bien compris si cette erreur a lieu côté serveur ou client ?

    Sinon, si tu m'envoies le .wsdl, je peux te générer des classes de proxy (Eclipse WTP). Il me semble que ça marchait chez moi, et à vue de nez, j'utilise les mêmes librairies.
    Et bien en utilisant le débugueur, j'ai du mal à voir si cela vient du client ou du serveur en fait. Car c'est à la réception de la réponse par le client que j'ai cette erreur (dont soit le serveur a mal écrit la réponse, soit le client n'arrive pas à la recevoir).

    La génération de classes de proxy permettent de faire quoi en plus en fait ?

  7. #7
    Membre éprouvé
    Homme Profil pro
    Inscrit en
    Juin 2005
    Messages
    86
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Juin 2005
    Messages : 86
    Par défaut
    Si tu as une erreur à la réponse ca vient surement de ton wsdl et de ta classe de ton type complexe.
    Est-ce que quand tu génères ton client la classe de ton type complexe est générée?

  8. #8
    Membre émérite Avatar de g_rare
    Profil pro
    Inscrit en
    Novembre 2005
    Messages
    608
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2005
    Messages : 608
    Par défaut
    De mémoire : il n'y a que les primitifs et classes équivalentes de "java.lang" (plus aussi BigInteger & BigDecimal), et les tableaux de ces types qui soient supportés... sans oublier QNAME.

  9. #9
    Membre Expert
    Avatar de xavlours
    Inscrit en
    Février 2004
    Messages
    1 832
    Détails du profil
    Informations forums :
    Inscription : Février 2004
    Messages : 1 832
    Par défaut
    Citation Envoyé par Skyman37
    La génération de classes de proxy permettent de faire quoi en plus en fait ?
    Ben en gros c'est un assistant qui lit le wsdl et fournit plusieurs classes :
    - des proxys qui s'occupent de la communication : pour chaque opération le proxy offre une méthode du même nom. Il s'occupe de localiser le serveur, créer le message, envoyer, recevoir la réponse récupérer les données et retourner. Donc pour invoquer un service, toi tu te contentes d'appeler une méthode.
    - des classes qui décrivent les infos contenues dans les messages soap (utilisées par le proxy pour créer et récupérer les messages).

    Normalement, tu n'as pas besoin de rentrer là dedans. Tu génères les classes (avec un assistant "créer un client") et tu regardes les interfaces des classes générées. Il doit y en avoir une dont les méthodes correspondent exactement aux opérations du web-service.
    "Le bon ni le mauvais ne me feraient de peine si si si je savais que j'en aurais l'étrenne." B.V.
    Non au langage SMS ! Je ne répondrai pas aux questions techniques par MP.
    Eclipse : News, FAQ, Cours, Livres, Blogs.Et moi.

  10. #10
    Nouveau membre du Club
    Homme Profil pro
    Administrateur de base de données
    Inscrit en
    Mai 2005
    Messages
    7
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Administrateur de base de données

    Informations forums :
    Inscription : Mai 2005
    Messages : 7
    Par défaut
    Citation Envoyé par xblond
    Si tu as une erreur à la réponse ca vient surement de ton wsdl et de ta classe de ton type complexe.
    Est-ce que quand tu génères ton client la classe de ton type complexe est générée?

    Désolé, j'ai zappé ce que tu avais écrit juste avant.

    Oui, mon wsdl a été généré automatiquement par axis. Et oui, quand je génères mon client, la classe de mon type complexe est générée.

    Alors voici une partie de mon wsdl :

    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
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    -
    	<wsdl:definitions targetNamespace="http://localhost:8080/axis/services/PWFServicesVehiculeImplementation">
    -
    	<!--
    WSDL created by Apache Axis version: 1.4
    Built on Apr 22, 2006 (06:55:48 PDT)
    -->
    -
    	<wsdl:types>
    -
    	<schema targetNamespace="http://localhost:8080/axis/services/PWFServicesVehiculeImplementation">
    <import namespace="http://util.java"/>
    <import namespace="http://util.pub.common.ibcs.primasolutions"/>
    <import namespace="http://carunderwriting.objects.pub.und.ibcs.primasolutions"/>
    <import namespace="http://xml.apache.org/xml-soap"/>
    <import namespace="http://core.objects.pub.obm.ibcs.primasolutions"/>
    <import namespace="http://objects.pub.obm.ibcs.prima.pwf.com"/>
    <import namespace="http://objects.pub.sbm.ibcs.primasolutions"/>
    <import namespace="http://root.objects.pub.ref.ibcs.primasolutions"/>
    <import namespace="http://sql.java"/>
    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
    -
    	<complexType name="ArrayOf_xsd_string">
    -
    	<complexContent>
    -
    	<restriction base="soapenc:Array">
    <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/>
    </restriction>
    </complexContent>
    </complexType>
    -
    	<complexType name="ArrayOf_xsd_anyType">
    -
    	<complexContent>
    -
    	<restriction base="soapenc:Array">
    <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:anyType[]"/>
    </restriction>
    </complexContent>
    </complexType>
    -
    	<complexType name="ArrayOf_tns1_PWFPrimaVehicle">
    -
    	<complexContent>
    -
    	<restriction base="soapenc:Array">
    <attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:PWFPrimaVehicle[]"/>
    </restriction>
    </complexContent>
    </complexType>
    </schema>
    +
    	<schema targetNamespace="http://root.objects.pub.ref.ibcs.primasolutions">
    </schema>
    +
    	<schema targetNamespace="http://xml.apache.org/xml-soap">
    </schema>
    +
    	<schema targetNamespace="http://util.pub.common.ibcs.primasolutions">
    </schema>
    +
    	<schema targetNamespace="http://objects.pub.sbm.ibcs.primasolutions">
    </schema>
    -
    	<schema targetNamespace="http://core.objects.pub.obm.ibcs.primasolutions">
    <import namespace="http://util.java"/>
    <import namespace="http://util.pub.common.ibcs.primasolutions"/>
    <import namespace="http://carunderwriting.objects.pub.und.ibcs.primasolutions"/>
    <import namespace="http://xml.apache.org/xml-soap"/>
    <import namespace="http://localhost:8080/axis/services/PWFServicesVehiculeImplementation"/>
    <import namespace="http://objects.pub.obm.ibcs.prima.pwf.com"/>
    <import namespace="http://objects.pub.sbm.ibcs.primasolutions"/>
    <import namespace="http://root.objects.pub.ref.ibcs.primasolutions"/>
    <import namespace="http://sql.java"/>
    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
    -
    	<complexType name="PrimaFinancingMode">
    -
    	<sequence>
    <element name="financingType" nillable="true" type="xsd:string"/>
    <element name="picActivated" type="xsd:boolean"/>
    <element name="pk" nillable="true" type="xsd:string"/>
    </sequence>
    </complexType>
    -
    	<complexType abstract="true" name="PrimaInsurableObject">
    -
    	<complexContent>
    -
    	<extension base="tns3:PrimaSubjectMatter">
    -
    	<sequence>
    <element name="financingMode" nillable="true" type="tns2:PrimaFinancingMode"/>
    </sequence>
    </extension>
    </complexContent>
    </complexType>
    -
    	<complexType abstract="true" name="PrimaVehicle">
    -
    	<complexContent>
    -
    	<extension base="tns2:PrimaInsurableObject">
    -
    	<sequence>
    <element name="bodyWork" nillable="true" type="xsd:string"/>
    <element name="buildYear" type="xsd:int"/>
    <element name="colour" nillable="true" type="xsd:string"/>
    <element name="emptyUseModes" type="xsd:boolean"/>
    <element name="paintType" nillable="true" type="xsd:string"/>
    <element name="serialNumber" nillable="true" type="xsd:string"/>
    <element name="useModes" nillable="true" type="impl:ArrayOf_xsd_anyType"/>
    <element name="value" type="xsd:double"/>
    <element name="valueCurrencyCode" nillable="true" type="xsd:string"/>
    </sequence>
    </extension>
    </complexContent>
    </complexType>
    </schema>
    +
    	<schema targetNamespace="http://carunderwriting.objects.pub.und.ibcs.primasolutions">
    </schema>
    -
    	<schema targetNamespace="http://objects.pub.obm.ibcs.prima.pwf.com">
    <import namespace="http://util.java"/>
    <import namespace="http://util.pub.common.ibcs.primasolutions"/>
    <import namespace="http://carunderwriting.objects.pub.und.ibcs.primasolutions"/>
    <import namespace="http://xml.apache.org/xml-soap"/>
    <import namespace="http://localhost:8080/axis/services/PWFServicesVehiculeImplementation"/>
    <import namespace="http://core.objects.pub.obm.ibcs.primasolutions"/>
    <import namespace="http://objects.pub.sbm.ibcs.primasolutions"/>
    <import namespace="http://root.objects.pub.ref.ibcs.primasolutions"/>
    <import namespace="http://sql.java"/>
    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
    -
    	<complexType name="PWFPrimaVehicle">
    -
    	<complexContent>
    -
    	<extension base="tns2:PrimaVehicle">
    -
    	<sequence>
    <element name="bodyStyle" nillable="true" type="xsd:string"/>
    <element name="brandName" nillable="true" type="xsd:string"/>
    <element name="codeVehicle" nillable="true" type="xsd:string"/>
    <element name="enginePower" nillable="true" type="xsd:string"/>
    <element name="firstBuildYear" nillable="true" type="xsd:string"/>
    <element name="mineType" nillable="true" type="xsd:string"/>
    <element name="model" nillable="true" type="xsd:string"/>
    <element name="parkingPlace" nillable="true" type="tns8:PrimaParkingPlace"/>
    <element name="powerSourceType" nillable="true" type="xsd:string"/>
    <element name="version" nillable="true" type="xsd:string"/>
    </sequence>
    </extension>
    </complexContent>
    </complexType>
    </schema>
    </wsdl:types>
     
    [...]
     
    <wsdl:message name="rechercherVehiculesRequest2">
    <wsdl:part name="in0" type="tns1:PWFPrimaVehicle"/>
    </wsdl:message>
     
    [...]
     
    <wsdl:portType name="PWFServicesVehiculeImplementation">
    -
    	<wsdl:operation name="rechercherVehicules" parameterOrder="in0">
    <wsdl:input message="impl:rechercherVehiculesRequest" name="rechercherVehiculesRequest"/>
    <wsdl:output message="impl:rechercherVehiculesResponse" name="rechercherVehiculesResponse"/>
    </wsdl:operation>
    -
    	<wsdl:operation name="rechercherVehicules">
    <wsdl:input message="impl:rechercherVehiculesRequest1" name="rechercherVehiculesRequest1"/>
    <wsdl:output message="impl:rechercherVehiculesResponse1" name="rechercherVehiculesResponse1"/>
    </wsdl:operation>
    </wsdl:portType>
     
    [...]
     
    <wsdl:binding name="PWFServicesVehiculeImplementationSoapBinding" type="impl:PWFServicesVehiculeImplementation">
    <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
    -
    	<wsdl:operation name="rechercherVehicules">
    <wsdlsoap:operation soapAction=""/>
    -
    	<wsdl:input name="rechercherVehiculesRequest">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" use="encoded"/>
    </wsdl:input>
    -
    	<wsdl:output name="rechercherVehiculesResponse">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/axis/services/PWFServicesVehiculeImplementation" use="encoded"/>
    </wsdl:output>
    </wsdl:operation>
    -
    	<wsdl:operation name="rechercherVehicules">
    <wsdlsoap:operation soapAction=""/>
    -
    	<wsdl:input name="rechercherVehiculesRequest1">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" use="encoded"/>
    </wsdl:input>
    -
    	<wsdl:output name="rechercherVehiculesResponse1">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/axis/services/PWFServicesVehiculeImplementation" use="encoded"/>
    </wsdl:output>
    </wsdl:operation>
    -
    	<wsdl:operation name="rechercherVehicules">
    <wsdlsoap:operation soapAction=""/>
    -
    	<wsdl:input name="rechercherVehiculesRequest2">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace" use="encoded"/>
    </wsdl:input>
    -
    	<wsdl:output name="rechercherVehiculesResponse2">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:8080/axis/services/PWFServicesVehiculeImplementation" use="encoded"/>
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    -
    	<wsdl:service name="PWFServicesVehiculeImplementationService">
    -
    	<wsdl:port binding="impl:PWFServicesVehiculeImplementationSoapBinding" name="PWFServicesVehiculeImplementation">
    <wsdlsoap:address location="http://localhost:8080/axis/services/PWFServicesVehiculeImplementation"/>
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>
    Voila (j'ai enlevé certaines parties pour pas avoir un trop gros fichier).

  11. #11
    Nouveau membre du Club
    Homme Profil pro
    Administrateur de base de données
    Inscrit en
    Mai 2005
    Messages
    7
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Administrateur de base de données

    Informations forums :
    Inscription : Mai 2005
    Messages : 7
    Par défaut
    Et voici la classe générée à partir du WSDL que la méthode du service web retourne :

    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
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    /**
     * PWFPrimaVehicle.java
     *
     * This file was auto-generated from WSDL
     * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
     */
     
    package com.pwf.prima.ibcs.obm.pub.objects;
     
    public class PWFPrimaVehicle  extends primasolutions.ibcs.obm.pub.objects.core.PrimaVehicle  implements java.io.Serializable {
        private java.lang.String bodyStyle;
     
        private java.lang.String brandName;
     
        private java.lang.String codeVehicle;
     
        private java.lang.String enginePower;
     
        private java.lang.String firstBuildYear;
     
        private java.lang.String mineType;
     
        private java.lang.String model;
     
        private primasolutions.ibcs.und.pub.objects.carunderwriting.PrimaParkingPlace parkingPlace;
     
        private java.lang.String powerSourceType;
     
        private java.lang.String version;
     
        public PWFPrimaVehicle() {
        }
     
        public PWFPrimaVehicle(
               boolean picActivated,
               java.lang.Object[] comments,
               primasolutions.ibcs.common.pub.util.PrimaDate creationDate,
               boolean emptyComments,
               boolean emptyImages,
               java.lang.Object[] images,
               java.lang.String pk,
               java.lang.String reproductionRole,
               primasolutions.ibcs.obm.pub.objects.core.PrimaFinancingMode financingMode,
               java.lang.String bodyWork,
               int buildYear,
               java.lang.String colour,
               boolean emptyUseModes,
               java.lang.String paintType,
               java.lang.String serialNumber,
               java.lang.Object[] useModes,
               double value,
               java.lang.String valueCurrencyCode,
               java.lang.String bodyStyle,
               java.lang.String brandName,
               java.lang.String codeVehicle,
               java.lang.String enginePower,
               java.lang.String firstBuildYear,
               java.lang.String mineType,
               java.lang.String model,
               primasolutions.ibcs.und.pub.objects.carunderwriting.PrimaParkingPlace parkingPlace,
               java.lang.String powerSourceType,
               java.lang.String version) {
            super(
                picActivated,
                comments,
                creationDate,
                emptyComments,
                emptyImages,
                images,
                pk,
                reproductionRole,
                financingMode,
                bodyWork,
                buildYear,
                colour,
                emptyUseModes,
                paintType,
                serialNumber,
                useModes,
                value,
                valueCurrencyCode);
            this.bodyStyle = bodyStyle;
            this.brandName = brandName;
            this.codeVehicle = codeVehicle;
            this.enginePower = enginePower;
            this.firstBuildYear = firstBuildYear;
            this.mineType = mineType;
            this.model = model;
            this.parkingPlace = parkingPlace;
            this.powerSourceType = powerSourceType;
            this.version = version;
        }
     
     
        /**
         * Gets the bodyStyle value for this PWFPrimaVehicle.
         * 
         * @return bodyStyle
         */
        public java.lang.String getBodyStyle() {
            return bodyStyle;
        }
     
     
        /**
         * Sets the bodyStyle value for this PWFPrimaVehicle.
         * 
         * @param bodyStyle
         */
        public void setBodyStyle(java.lang.String bodyStyle) {
            this.bodyStyle = bodyStyle;
        }
     
     
        /**
         * Gets the brandName value for this PWFPrimaVehicle.
         * 
         * @return brandName
         */
        public java.lang.String getBrandName() {
            return brandName;
        }
     
     
        /**
         * Sets the brandName value for this PWFPrimaVehicle.
         * 
         * @param brandName
         */
        public void setBrandName(java.lang.String brandName) {
            this.brandName = brandName;
        }
     
     
        /**
         * Gets the codeVehicle value for this PWFPrimaVehicle.
         * 
         * @return codeVehicle
         */
        public java.lang.String getCodeVehicle() {
            return codeVehicle;
        }
     
     
        /**
         * Sets the codeVehicle value for this PWFPrimaVehicle.
         * 
         * @param codeVehicle
         */
        public void setCodeVehicle(java.lang.String codeVehicle) {
            this.codeVehicle = codeVehicle;
        }
     
     
        /**
         * Gets the enginePower value for this PWFPrimaVehicle.
         * 
         * @return enginePower
         */
        public java.lang.String getEnginePower() {
            return enginePower;
        }
     
     
        /**
         * Sets the enginePower value for this PWFPrimaVehicle.
         * 
         * @param enginePower
         */
        public void setEnginePower(java.lang.String enginePower) {
            this.enginePower = enginePower;
        }
     
     
        /**
         * Gets the firstBuildYear value for this PWFPrimaVehicle.
         * 
         * @return firstBuildYear
         */
        public java.lang.String getFirstBuildYear() {
            return firstBuildYear;
        }
     
     
        /**
         * Sets the firstBuildYear value for this PWFPrimaVehicle.
         * 
         * @param firstBuildYear
         */
        public void setFirstBuildYear(java.lang.String firstBuildYear) {
            this.firstBuildYear = firstBuildYear;
        }
     
     
        /**
         * Gets the mineType value for this PWFPrimaVehicle.
         * 
         * @return mineType
         */
        public java.lang.String getMineType() {
            return mineType;
        }
     
     
        /**
         * Sets the mineType value for this PWFPrimaVehicle.
         * 
         * @param mineType
         */
        public void setMineType(java.lang.String mineType) {
            this.mineType = mineType;
        }
     
     
        /**
         * Gets the model value for this PWFPrimaVehicle.
         * 
         * @return model
         */
        public java.lang.String getModel() {
            return model;
        }
     
     
        /**
         * Sets the model value for this PWFPrimaVehicle.
         * 
         * @param model
         */
        public void setModel(java.lang.String model) {
            this.model = model;
        }
     
     
        /**
         * Gets the parkingPlace value for this PWFPrimaVehicle.
         * 
         * @return parkingPlace
         */
        public primasolutions.ibcs.und.pub.objects.carunderwriting.PrimaParkingPlace getParkingPlace() {
            return parkingPlace;
        }
     
     
        /**
         * Sets the parkingPlace value for this PWFPrimaVehicle.
         * 
         * @param parkingPlace
         */
        public void setParkingPlace(primasolutions.ibcs.und.pub.objects.carunderwriting.PrimaParkingPlace parkingPlace) {
            this.parkingPlace = parkingPlace;
        }
     
     
        /**
         * Gets the powerSourceType value for this PWFPrimaVehicle.
         * 
         * @return powerSourceType
         */
        public java.lang.String getPowerSourceType() {
            return powerSourceType;
        }
     
     
        /**
         * Sets the powerSourceType value for this PWFPrimaVehicle.
         * 
         * @param powerSourceType
         */
        public void setPowerSourceType(java.lang.String powerSourceType) {
            this.powerSourceType = powerSourceType;
        }
     
     
        /**
         * Gets the version value for this PWFPrimaVehicle.
         * 
         * @return version
         */
        public java.lang.String getVersion() {
            return version;
        }
     
     
        /**
         * Sets the version value for this PWFPrimaVehicle.
         * 
         * @param version
         */
        public void setVersion(java.lang.String version) {
            this.version = version;
        }
     
        private java.lang.Object __equalsCalc = null;
        public synchronized boolean equals(java.lang.Object obj) {
            if (!(obj instanceof PWFPrimaVehicle)) return false;
            PWFPrimaVehicle other = (PWFPrimaVehicle) obj;
            if (obj == null) return false;
            if (this == obj) return true;
            if (__equalsCalc != null) {
                return (__equalsCalc == obj);
            }
            __equalsCalc = obj;
            boolean _equals;
            _equals = super.equals(obj) && 
                ((this.bodyStyle==null && other.getBodyStyle()==null) || 
                 (this.bodyStyle!=null &&
                  this.bodyStyle.equals(other.getBodyStyle()))) &&
                ((this.brandName==null && other.getBrandName()==null) || 
                 (this.brandName!=null &&
                  this.brandName.equals(other.getBrandName()))) &&
                ((this.codeVehicle==null && other.getCodeVehicle()==null) || 
                 (this.codeVehicle!=null &&
                  this.codeVehicle.equals(other.getCodeVehicle()))) &&
                ((this.enginePower==null && other.getEnginePower()==null) || 
                 (this.enginePower!=null &&
                  this.enginePower.equals(other.getEnginePower()))) &&
                ((this.firstBuildYear==null && other.getFirstBuildYear()==null) || 
                 (this.firstBuildYear!=null &&
                  this.firstBuildYear.equals(other.getFirstBuildYear()))) &&
                ((this.mineType==null && other.getMineType()==null) || 
                 (this.mineType!=null &&
                  this.mineType.equals(other.getMineType()))) &&
                ((this.model==null && other.getModel()==null) || 
                 (this.model!=null &&
                  this.model.equals(other.getModel()))) &&
                ((this.parkingPlace==null && other.getParkingPlace()==null) || 
                 (this.parkingPlace!=null &&
                  this.parkingPlace.equals(other.getParkingPlace()))) &&
                ((this.powerSourceType==null && other.getPowerSourceType()==null) || 
                 (this.powerSourceType!=null &&
                  this.powerSourceType.equals(other.getPowerSourceType()))) &&
                ((this.version==null && other.getVersion()==null) || 
                 (this.version!=null &&
                  this.version.equals(other.getVersion())));
            __equalsCalc = null;
            return _equals;
        }
     
        private boolean __hashCodeCalc = false;
        public synchronized int hashCode() {
            if (__hashCodeCalc) {
                return 0;
            }
            __hashCodeCalc = true;
            int _hashCode = super.hashCode();
            if (getBodyStyle() != null) {
                _hashCode += getBodyStyle().hashCode();
            }
            if (getBrandName() != null) {
                _hashCode += getBrandName().hashCode();
            }
            if (getCodeVehicle() != null) {
                _hashCode += getCodeVehicle().hashCode();
            }
            if (getEnginePower() != null) {
                _hashCode += getEnginePower().hashCode();
            }
            if (getFirstBuildYear() != null) {
                _hashCode += getFirstBuildYear().hashCode();
            }
            if (getMineType() != null) {
                _hashCode += getMineType().hashCode();
            }
            if (getModel() != null) {
                _hashCode += getModel().hashCode();
            }
            if (getParkingPlace() != null) {
                _hashCode += getParkingPlace().hashCode();
            }
            if (getPowerSourceType() != null) {
                _hashCode += getPowerSourceType().hashCode();
            }
            if (getVersion() != null) {
                _hashCode += getVersion().hashCode();
            }
            __hashCodeCalc = false;
            return _hashCode;
        }
     
        // Type metadata
        private static org.apache.axis.description.TypeDesc typeDesc =
            new org.apache.axis.description.TypeDesc(PWFPrimaVehicle.class, true);
     
        static {
            typeDesc.setXmlType(new javax.xml.namespace.QName("http://objects.pub.obm.ibcs.prima.pwf.com", "PWFPrimaVehicle"));
            org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
            elemField.setFieldName("bodyStyle");
            elemField.setXmlName(new javax.xml.namespace.QName("", "bodyStyle"));
            elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
            elemField.setNillable(true);
            typeDesc.addFieldDesc(elemField);
            elemField = new org.apache.axis.description.ElementDesc();
            elemField.setFieldName("brandName");
            elemField.setXmlName(new javax.xml.namespace.QName("", "brandName"));
            elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
            elemField.setNillable(true);
            typeDesc.addFieldDesc(elemField);
            elemField = new org.apache.axis.description.ElementDesc();
            elemField.setFieldName("codeVehicle");
            elemField.setXmlName(new javax.xml.namespace.QName("", "codeVehicle"));
            elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
            elemField.setNillable(true);
            typeDesc.addFieldDesc(elemField);
            elemField = new org.apache.axis.description.ElementDesc();
            elemField.setFieldName("enginePower");
            elemField.setXmlName(new javax.xml.namespace.QName("", "enginePower"));
            elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
            elemField.setNillable(true);
            typeDesc.addFieldDesc(elemField);
            elemField = new org.apache.axis.description.ElementDesc();
            elemField.setFieldName("firstBuildYear");
            elemField.setXmlName(new javax.xml.namespace.QName("", "firstBuildYear"));
            elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
            elemField.setNillable(true);
            typeDesc.addFieldDesc(elemField);
            elemField = new org.apache.axis.description.ElementDesc();
            elemField.setFieldName("mineType");
            elemField.setXmlName(new javax.xml.namespace.QName("", "mineType"));
            elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
            elemField.setNillable(true);
            typeDesc.addFieldDesc(elemField);
            elemField = new org.apache.axis.description.ElementDesc();
            elemField.setFieldName("model");
            elemField.setXmlName(new javax.xml.namespace.QName("", "model"));
            elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
            elemField.setNillable(true);
            typeDesc.addFieldDesc(elemField);
            elemField = new org.apache.axis.description.ElementDesc();
            elemField.setFieldName("parkingPlace");
            elemField.setXmlName(new javax.xml.namespace.QName("", "parkingPlace"));
            elemField.setXmlType(new javax.xml.namespace.QName("http://carunderwriting.objects.pub.und.ibcs.primasolutions", "PrimaParkingPlace"));
            elemField.setNillable(true);
            typeDesc.addFieldDesc(elemField);
            elemField = new org.apache.axis.description.ElementDesc();
            elemField.setFieldName("powerSourceType");
            elemField.setXmlName(new javax.xml.namespace.QName("", "powerSourceType"));
            elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
            elemField.setNillable(true);
            typeDesc.addFieldDesc(elemField);
            elemField = new org.apache.axis.description.ElementDesc();
            elemField.setFieldName("version");
            elemField.setXmlName(new javax.xml.namespace.QName("", "version"));
            elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
            elemField.setNillable(true);
            typeDesc.addFieldDesc(elemField);
        }
     
        /**
         * Return type metadata object
         */
        public static org.apache.axis.description.TypeDesc getTypeDesc() {
            return typeDesc;
        }
     
        /**
         * Get Custom Serializer
         */
        public static org.apache.axis.encoding.Serializer getSerializer(
               java.lang.String mechType, 
               java.lang.Class _javaType,  
               javax.xml.namespace.QName _xmlType) {
            return 
              new  org.apache.axis.encoding.ser.BeanSerializer(
                _javaType, _xmlType, typeDesc);
        }
     
        /**
         * Get Custom Deserializer
         */
        public static org.apache.axis.encoding.Deserializer getDeserializer(
               java.lang.String mechType, 
               java.lang.Class _javaType,  
               javax.xml.namespace.QName _xmlType) {
            return 
              new  org.apache.axis.encoding.ser.BeanDeserializer(
                _javaType, _xmlType, typeDesc);
        }
     
    }

  12. #12
    Membre éprouvé
    Homme Profil pro
    Inscrit en
    Juin 2005
    Messages
    86
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Juin 2005
    Messages : 86
    Par défaut
    Ton fichier est un peu gros, mais comme ca je dirais que c'est un problème soit de namespace, soit de classe mal référencé dans ton wsdl ou ton wsdd (as-tu regardés les mapping fait dans le wsdd d'ailleurs ?). Sinon, cela peut venir d'un tableau qui te renvoie anyType[] alors que c'est autre chose que tu as dedans.

    Voilà je vois pas trop sinon

  13. #13
    Nouveau membre du Club
    Homme Profil pro
    Administrateur de base de données
    Inscrit en
    Mai 2005
    Messages
    7
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Administrateur de base de données

    Informations forums :
    Inscription : Mai 2005
    Messages : 7
    Par défaut
    Citation Envoyé par xblond
    Ton fichier est un peu gros, mais comme ca je dirais que c'est un problème soit de namespace, soit de classe mal référencé dans ton wsdl ou ton wsdd (as-tu regardés les mapping fait dans le wsdd d'ailleurs ?). Sinon, cela peut venir d'un tableau qui te renvoie anyType[] alors que c'est autre chose que tu as dedans.

    Voilà je vois pas trop sinon
    Ok je vais essayer de regarder par la.

    En fait, dans mon wsdd, j'ai pas mis grand chose (je débute au niveau des services web ). Donc j'ai essayé de voir par rapport à ce qu'expliquait certains sites, mais aucun ne disait la même chose.
    Et effectivement, je suis en train de me dire que dans le wsdd, il y a certains types complexes qui ne sont pas déclarés (mais alors, pourquoi les classes ont bien été générées par la suite ?).

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
     
    <deployment xmlns="http://xml.apache.org/axis/wsdd/"
    	xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
    	<service name="PWFServicesVehiculeImplementation" provider="java:RPC">
    		<parameter name="className" value="PWFServicesVehiculeImplementation"/>
    		<parameter name="allowedMethods" value="*"/>
    		<beanMapping qname="ns:PWFPrimaVehicle" xmlns:ns="urn:Complex" languageSpecificType="java:ComplexType"/>
    	</service>
    </deployment>

    Sinon, j'ai regardé Eclipse WTP, j'ai vu qu'il était possible de convertir une classe Java en un service web (c'est exactement ce que j'ai fais mais manuellement). Peut-etre qu'avec cela, il n'y aura pas d'erreurs (je suis en train de le telecharger).

    Merci beaucoup a vous tous en tout cas

  14. #14
    Membre Expert
    Avatar de xavlours
    Inscrit en
    Février 2004
    Messages
    1 832
    Détails du profil
    Informations forums :
    Inscription : Février 2004
    Messages : 1 832
    Par défaut
    Citation Envoyé par Skyman37
    Sinon, j'ai regardé Eclipse WTP, j'ai vu qu'il était possible de convertir une classe Java en un service web (c'est exactement ce que j'ai fais mais manuellement). Peut-etre qu'avec cela, il n'y aura pas d'erreurs (je suis en train de le telecharger).
    Oui, mais finalement, tu fais des web services, et quand tu veux aider quelqu'un tu te rends compte que t'y connais rien. Par contre c'est super efficace. Globalement, à partir d'une classe java, il doit y avoir une vingtaine de clics et c'est bon t'as déployé ton web-service dans un war sur Tomcat.

    Bon à savoir : la classe de base du web service est instanciée à chaque connexion. Il faut utiliser du statique et des singletons pour avoir des données persistantes.

    Un petit lien : http://www.eclipse.org/webtools/jst/.../M3/tutorials/
    "Le bon ni le mauvais ne me feraient de peine si si si je savais que j'en aurais l'étrenne." B.V.
    Non au langage SMS ! Je ne répondrai pas aux questions techniques par MP.
    Eclipse : News, FAQ, Cours, Livres, Blogs.Et moi.

  15. #15
    Membre éprouvé
    Homme Profil pro
    Inscrit en
    Juin 2005
    Messages
    86
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Juin 2005
    Messages : 86
    Par défaut
    Citation Envoyé par xavlours
    Bon à savoir : la classe de base du web service est instanciée à chaque connexion. Il faut utiliser du statique et des singletons pour avoir des données persistantes.
    Faux, avec Axis, tu peux lui dire dans le WSDD que tu veux un scope="session", comme ca il ne t'instantie pas une nouvelle classe à chaque fois.

  16. #16
    Membre chevronné
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    365
    Détails du profil
    Informations personnelles :
    Localisation : Maroc

    Informations forums :
    Inscription : Janvier 2006
    Messages : 365
    Par défaut
    Bonjour !
    Voudrais-tu nous montrer l'interface Java de definition du service (service endpoint interface) à partir de laquelle tu génères le WSDL pour qu'on puisse avoir une meilleure idée de ces types complexes que tu utilises ? C'est pas très clair en lisant le wsdl, à part qu'il y a un "array of string" .

  17. #17
    Membre habitué
    Inscrit en
    Août 2010
    Messages
    13
    Détails du profil
    Informations forums :
    Inscription : Août 2010
    Messages : 13
    Par défaut problème avec types complexes
    j'ai 2 classes: article et catalogue
    catalogue a un attribut art de type article

    j'ai essayé d'insérer article comme classe interne dans catalogue
    ou bien d'écrire 2 classes indépendantes

    je veux utiliser le même service de classe catalogue pour
    afficher des attributs de catalogue et article.num et nom de types(int, String)


    pour les types simples "int" ça marche bien
    pour types complexes "article" ça génère des erreurs

    comment corriger la ligne en rouge?
    ************************************
    public class article{
    String nom="art1";

    public String getNom()
    {return nom;}

    }

    ************************************


    public class catalogue {

    int num;
    article art;


    public catalogue()
    {num=1;
    art=new article();
    }

    public int getNum()
    {return num;}

    public article getArticle()
    {return art;}

    }
    *************************************
    package DefaultNamespace;

    public class CataClient {

    public static void main(String[] args) throws Exception {
    CatalogueService service = new CatalogueServiceLocator();
    Catalogue calc = service.getcatalogue();

    System.out.println("NUM " + calc.getNum());
    //(pas d'err)



    ArticleService serv = new ArticleServiceLocator();
    Article arti = serv.getarticle();

    System.out.println("ART " + arti.getNom());
    //(pas d'Err mais je veux utiliser le même service calc)


    Article a2=(Article)calc.getArticle();
    System.out.println("ART 2" + a2.getNom());

    //(les Err en rouge)


    }
    }

  18. #18
    Membre habitué
    Inscrit en
    Août 2010
    Messages
    13
    Détails du profil
    Informations forums :
    Inscription : Août 2010
    Messages : 13
    Par défaut (suite)fichier wsdl+message écran
    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions targetNamespace="http://DefaultNamespace" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://DefaultNamespace" xmlns:intf="http://DefaultNamespace" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlnssd="http://www.w3.org/2001/XMLSchema">
    <!--WSDL created by Apache Axis version: 1.4
    Built on Apr 22, 2006 (06:55:48 PDT)-->
    <wsdl:types>
    <schema elementFormDefault="qualified" targetNamespace="http://DefaultNamespace" xmlns="http://www.w3.org/2001/XMLSchema">
    <element name="getNum">
    <complexType/>
    </element>
    <element name="getNumResponse">
    <complexType>
    <sequence>
    <element name="getNumReturn" type="xsd:int"/>
    </sequence>
    </complexType>
    </element>
    <element name="getArticle">
    <complexType/>
    </element>
    <element name="getArticleResponse">
    <complexType>
    <sequence>
    <element name="getArticleReturn" type="xsd:anyType"/>
    </sequence>
    </complexType>
    </element>
    </schema>
    </wsdl:types>

    <wsdl:message name="getNumResponse">

    <wsdl:part element="impl:getNumResponse" name="parameters">

    </wsdl:part>

    </wsdl:message>

    <wsdl:message name="getArticleResponse">

    <wsdl:part element="impl:getArticleResponse" name="parameters">

    </wsdl:part>

    </wsdl:message>

    <wsdl:message name="getArticleRequest">

    <wsdl:part element="impl:getArticle" name="parameters">

    </wsdl:part>

    </wsdl:message>

    <wsdl:message name="getNumRequest">

    <wsdl:part element="impl:getNum" name="parameters">

    </wsdl:part>

    </wsdl:message>

    <wsdl:portType name="catalogue">

    <wsdl:operation name="getNum">

    <wsdl:input message="impl:getNumRequest" name="getNumRequest">

    </wsdl:input>

    <wsdl:output message="impl:getNumResponse" name="getNumResponse">

    </wsdl:output>

    </wsdl:operation>

    <wsdl:operation name="getArticle">

    <wsdl:input message="impl:getArticleRequest" name="getArticleRequest">

    </wsdl:input>

    <wsdl:output message="impl:getArticleResponse" name="getArticleResponse">

    </wsdl:output>

    </wsdl:operation>

    </wsdl:portType>

    <wsdl:binding name="catalogueSoapBinding" type="impl:catalogue">

    <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

    <wsdl:operation name="getNum">

    <wsdlsoap:operation soapAction=""/>

    <wsdl:input name="getNumRequest">

    <wsdlsoap:body use="literal"/>

    </wsdl:input>

    <wsdl:output name="getNumResponse">

    <wsdlsoap:body use="literal"/>

    </wsdl:output>

    </wsdl:operation>

    <wsdl:operation name="getArticle">

    <wsdlsoap:operation soapAction=""/>

    <wsdl:input name="getArticleRequest">

    <wsdlsoap:body use="literal"/>

    </wsdl:input>

    <wsdl:output name="getArticleResponse">

    <wsdlsoap:body use="literal"/>

    </wsdl:output>

    </wsdl:operation>

    </wsdl:binding>

    <wsdl:service name="catalogueService">

    <wsdl:port binding="impl:catalogueSoapBinding" name="catalogue">

    <wsdlsoap:address location="http://localhost:8080/pjcomp/services/catalogue"/>

    </wsdl:port>

    </wsdl:service>

    </wsdl:definitions>
    **************************************

    13 janv. 2011 09:28:01 org.apache.axis.utils.JavaUtils isAttachmentSupported
    ATTENTION: Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
    NUM 1
    ART art1
    Exception in thread "main" AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: org.xml.sax.SAXParseException: Premature end of file.
    faultActor:
    faultNode:
    faultDetail:
    {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: Premature end of file.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at javax.xml.parsers.SAXParser.parse(Unknown Source)
    at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
    at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
    at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    at org.apache.axis.client.Call.invoke(Call.java:2767)
    at org.apache.axis.client.Call.invoke(Call.java:2443)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at DefaultNamespace.CatalogueSoapBindingStub.getArticle(CatalogueSoapBindingStub.java:147)
    at DefaultNamespace.CataClient.main(CataClient.java:17)

    {http://xml.apache.org/axis/}hostname:"***"

    org.xml.sax.SAXParseException: Premature end of file.
    at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:701)
    at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
    at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    at org.apache.axis.client.Call.invoke(Call.java:2767)
    at org.apache.axis.client.Call.invoke(Call.java:2443)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at DefaultNamespace.CatalogueSoapBindingStub.getArticle(CatalogueSoapBindingStub.java:147)
    at DefaultNamespace.CataClient.main(CataClient.java:17)
    Caused by: org.xml.sax.SAXParseException: Premature end of file.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at javax.xml.parsers.SAXParser.parse(Unknown Source)
    at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
    ... 10 more

Discussions similaires

  1. [2012] Tache service web avec paramètre de type Byte
    Par rndhnqz dans le forum SSIS
    Réponses: 1
    Dernier message: 21/04/2014, 19h40
  2. Consommation Service Web avec Axis
    Par Wilkinson dans le forum Services Web
    Réponses: 2
    Dernier message: 30/07/2013, 14h07
  3. creer un web service client avec axis
    Par m3allem001 dans le forum Services Web
    Réponses: 1
    Dernier message: 06/06/2009, 22h46
  4. deployer un service web avec axis 1.4 et websphere
    Par leo13 dans le forum Websphere
    Réponses: 1
    Dernier message: 10/05/2007, 10h45

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