Axis WSDL

Résolu
Bonjour,
Encore une fois j'ai une question speciale axis :)
Je voudrais générer des classes proxy a partir d'un fichier WSDL et je suis bloqué :s ( je travaille sous linux )
Alors voici les etapes que j'ai suivi:
1) Creation de mon fichier.JWS mis dans tomcat/webapps/axis
2) Creation de monfichier.WSDL a partir de l'url
3) je tape la commande suivante:
java org.apache.axis.wsdl.WSDL2Java -p repertoire monfichier.wsdl

Et voici le message d'erreur que j'obtiens:
Fatal Error: URI=file:///usr/local/apache-tomcat-6.0.26/webapps/axis/Carre.wsdl Line=1: The prefix "wsdl" for element "wsdl:definitions" is not bound.
at org.apache.axis.utils.XMLUtils$ParserErrorHandler.fatalError(XMLUtils.java:723)
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.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(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.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:369)
at org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:420)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:482)
at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
at java.lang.Thread.run(Threadrer 7.0</config>

Quelqu'un sait il d'où vient le problème s'il vous plait??
Merci

1 réponse

  1. Modérateur
    Peux-tu nous donner le contenu de /usr/local/apache-tomcat-6.0.26/webapps/axis/Carre.wsdl, je pense qu'il comporte une erreur de syntaxe.

    Pendant que j'y suis pour tester un webservice, tu as des outils comme soapui qui pourraient t'aider.

    Bonne chance
    1. En fait j'ai réussi la génération des classes de carre.wsdl en le deplaçant vers un autre dossier ( je l'avais mis avec les jws d'axis).
      J'ai réessayé avec ce carre.wsdl plusieurs ça marche bien.
      Mais avec un autre fichier .wsdl j'ai la fameuse erreur "prefix "wsdl" for element "wsdl:definitions" is not bound. " :(
      Merci pour ta réponse .
    2. Modérateur
      Ben je suppose que c'est le même genre de problème... et donc de solution ?
    3. ben non :(
      rien a faire cette fois !
    4. J'ai trouvé la solution:
      j'ajoute l'entete suivant :
      <?xml version="1.0" encoding="UTF-8"?>
      <wsdl:definitions targetNamespace="urn:CalculService2" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="urn:CalculService2" xmlns:intf="urn:CalculService2" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

      NB:
      il faut changer l'urn pour chaque fichier wsdl par le nom tout simplement!
    5. Modérateur
      Merci pour ces précisions et bonne continuation !