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 :

Problème de (de)serialisation d'Array avec Axis


Sujet :

Services Web Java

  1. #1
    Candidat au Club
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    3
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 3
    Par défaut Problème de (de)serialisation d'Array avec Axis
    Bonjour tout le monde,
    Je commence à peine les webservices, et j'ai pu faire quelques petites choses pour le moment qui marchent.
    Mais je suis confronté à un problème.
    Une de mes classe (qui s'appelle Category) contient un array d'une autre classe (qui s'appelle CategoryInfo) déclaré comme "public CategoryInfo[] data";

    Je pense donc que j'ai un problème lors de l'envoi de cet array. Mes autres webservices eux fonctionnent bien, mais aucun n'utilise d'array pour le moment.

    Voici 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
     
    <deployment xmlns="http://xml.apache.org/axis/wsdd/"
        xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
      <service name="SqlGenerator" provider="java:RPC">
        <parameter name="className" value="webservices.sql.generator.SqlGenerator"/>
        <parameter name="allowedMethods" value="*"/>
     
        <beanMapping qname="myNS:Directory" xmlns:myNS="urn:SqlGenerator" languageSpecificType="java:objects.Directory"/>
        <beanMapping qname="myNS:Category" xmlns:myNS="urn:Category" languageSpecificType="java:objects.Category"/>
        <beanMapping qname="myNS:CategoryInfo" xmlns:myNS="urn:CategoryInfo" languageSpecificType="java:objects.CategoryInfo"/>
     
    	<arrayMapping qname="ns:ArrayOfCategoryInfo" xmlns:ns="urn:CategoryInfo"
    	languageSpecificType="java:objects.CategoryInfo[]"
    	serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
    	deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
    	innerType="ns2:CategoryInfo" xmlns:ns2="urn:CategoryInfo"
    	encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> 
     
      </service>
    </deployment>
    Voici maintenant l'erreur qui m'est renvoyée :
    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
     
    error : 
    AxisFault
     faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
     faultSubcode: 
     faultString: org.xml.sax.SAXException: Invalid element in objects.Category - ownerId
     faultActor: 
     faultNode: 
     faultDetail: 
    	{http://xml.apache.org/axis/}hostname:laptop
     
    org.xml.sax.SAXException: Invalid element in objects.Category - ownerId
    	at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
    	at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
    	at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
    	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(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 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 webservices.TestClient.testAddCategory(TestClient.java:262)
    	at webservices.TestClient.main(TestClient.java:284)
    Et enfin, mon message soap :
    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
     
    <?xml version="1.0" encoding="UTF-8"?>
       <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
          <soapenv:Body>
             <ns1:insert soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://webservices.sql.generator.SqlGenerator">
                <arg1 href="#id0"/>
             </ns1:insert>
             <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:Category" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="urn:Category">
                <data soapenc:arrayType="ns2:Category[2]" xsi:type="soapenc:Array">
                   <data href="#id1"/>
                   <data href="#id2"/>
                </data>
                <id href="#id3"/>
                <name xsi:type="soapenc:string">Musique2</name>
                <shared href="#id4"/>
                <userid href="#id5"/>
             </multiRef>
             <multiRef id="id4" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:int" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">0</multiRef>
             <multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:Category" xmlns:ns3="urn:Category" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
                <name xsi:type="soapenc:string">Nom</name>
                <ownerId href="#id6"/>
                <type xsi:type="soapenc:string">Text</type>
                <userid href="#id7"/>
             </multiRef>
             <multiRef id="id2" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns4:Category" xmlns:ns4="urn:Category" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
                <name xsi:type="soapenc:string">Value</name>
                <ownerId href="#id8"/>
                <type xsi:type="soapenc:string">Doc</type>
                <userid href="#id9"/>
             </multiRef>
             <multiRef id="id3" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:int" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">0</multiRef>
             <multiRef id="id5" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:int" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">3</multiRef>
             <multiRef id="id7" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:int" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">0</multiRef>
             <multiRef id="id6" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:int" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">0</multiRef>
             <multiRef id="id8" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:int" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">0</multiRef>
             <multiRef id="id9" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:int" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">0</multiRef>
          </soapenv:Body>
       </soapenv:Envelope>
    J'ai remarqué dans le message SOAP qu'il ne créé pas de CategoryInfo[] mais des Category[].

    Quelqu'un aurait il une idée svp ?

    Merci d'avance

  2. #2
    Candidat au Club
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    3
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 3
    Par défaut
    une petite update sur ce sujet, en espérant avoir une réponse parce que je suis bien bloqué, et que pour la suite de ce que je veux faire, je vais utiliser énormément d'array

  3. #3
    Invité de passage
    Inscrit en
    Novembre 2006
    Messages
    1
    Détails du profil
    Informations forums :
    Inscription : Novembre 2006
    Messages : 1
    Par défaut
    Salut,

    As-tu trouvé une réponse pour ton problème car je bute aussi sur ce problème.

  4. #4
    Candidat au Club
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    3
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 3
    Par défaut
    malheureusement, non ..
    du coup ba j ai laissé un peu tombé ce que je développais.
    et je vais ptetre passer par du RMI.

Discussions similaires

  1. Problème déploiement Web avec Axis
    Par ArnaudDev dans le forum Applets
    Réponses: 3
    Dernier message: 18/08/2009, 10h44
  2. Probléme: un client java qui consomme une array avec soap
    Par mejdi331 dans le forum Services Web
    Réponses: 1
    Dernier message: 28/01/2009, 16h54
  3. Problème avec Axis 1.4
    Par SyLvErStOrM dans le forum Services Web
    Réponses: 10
    Dernier message: 15/09/2008, 14h24
  4. Problème WSDL avec Axis
    Par irnbru dans le forum Services Web
    Réponses: 4
    Dernier message: 06/06/2008, 23h13
  5. Problème de Calendar avec Axis
    Par touffifou dans le forum Services Web
    Réponses: 1
    Dernier message: 18/03/2008, 14h31

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