Lorsque vous avec l'exception

class org.apache.axis.AxisFault: org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.

Selon les ressources listées ci dessous, c'est que vous avez laissé des caractères blancs avant le début de la déclaration de votre prologue.

Un prologue se compose de deux partie :

  • Partie 1 comprend la déclaration XML
  • Partie 2 comprend des Document Type Declaration (DTD)

En fait, vous obtenez cette exception si vous avez des espaces blancs avant le prologue. Corriger le XML de telle sorte que le prologue soit la première chose dans le fichier devrait régler le problème. Oui, la solution est simple et si elle est connue elle permet d'économiser beaucoup de temps.

Également si le retour du serveur appelé ne réponds rien, on obtient la même erreur, voir la trace Axis SOAP suivante :

2006-04-13 09:32:23,390 DEBUG [org.apache.axis.transport.http.HTTPSender] (Timer-1) Enter:  HTTPSender::invoke
2006-04-13 09:32:23,656 DEBUG [org.apache.axis.transport.http.HTTPSender] (Timer-1) XML sent:
2006-04-13 09:32:23,656 DEBUG [org.apache.axis.transport.http.HTTPSender] (Timer-1) ---------------------------------------------------
2006-04-13 09:32:23,656 DEBUG [org.apache.axis.transport.http.HTTPSender] (Timer-1) POST /mypath/myservice.php?myparamkey=myparamvalue HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.4
Host: myserver.no-ip.info
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: ""
Content-Length: 1130
 
<?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><wsmethode xmlns="urn:pidi.francetelecom.com"><in0><ns1:appelReussi xmlns:ns1="urn:ws.placeoweb.com:wsdl:etat">1</ns1:appelReussi></in0></wsmethode</soapenv:Body></soapenv:Envelope>
2006-04-13 09:32:23,968 DEBUG [org.apache.axis.transport.http.HTTPSender] (Timer-1) HTTP/1.1 200 OK
2006-04-13 09:32:23,968 DEBUG [org.apache.axis.transport.http.HTTPSender] (Timer-1) Date Wed, 13 Apr 2006 07:28:37 GMT
2006-04-13 09:32:23,968 DEBUG [org.apache.axis.transport.http.HTTPSender] (Timer-1) Server Apache/2.2.3 (Red Hat)
2006-04-13 09:32:23,968 DEBUG [org.apache.axis.transport.http.HTTPSender] (Timer-1) X-Powered-By PHP/5.1.6
2006-04-13 09:32:23,968 DEBUG [org.apache.axis.transport.http.HTTPSender] (Timer-1) X-SOAP-Server NuSOAP/0.7.2 (1.9)
2006-04-13 09:32:23,968 DEBUG [org.apache.axis.transport.http.HTTPSender] (Timer-1) Content-Length 1673
2006-04-13 09:32:23,968 DEBUG [org.apache.axis.transport.http.HTTPSender] (Timer-1) Vary Accept-Encoding
2006-04-13 09:32:23,968 DEBUG [org.apache.axis.transport.http.HTTPSender] (Timer-1) Connection close
2006-04-13 09:32:23,968 DEBUG [org.apache.axis.transport.http.HTTPSender] (Timer-1) Content-Type text/xml; charset=ISO-8859-1
2006-04-13 09:32:23,968 DEBUG [org.apache.axis.transport.http.HTTPSender] (Timer-1) 
XML received:
2006-04-13 09:32:23,968 DEBUG [org.apache.axis.transport.http.HTTPSender] (Timer-1) -----------------------------------------------
2006-04-13 09:32:24,000 DEBUG [org.apache.axis.transport.http.HTTPSender] (Timer-1) org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.

Ressources