Bonjour,
J'ai dévelopé un serveur soap en php5, il marche bien(j'ai fait les tests avec un client soap php).
Maintenant J'essaie de développer un client Soap Java avec la la librarire Ksoap2, mais la connexion échoue.
Voici mon code(J'ai remplacé l'url réel que je voulais pas afficher dans le forum par localhost)


Code :
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
 
 public static void main(String[] args) {
        String url="http://localhost/serverSoap.php";
        String MethodNamespace="urn:CSP";
        String MethodName="getServerDate";
         try {
        	// build request string
 
             System.out.println("creating http transport");
        	HttpTransportSE transportSE = new HttpTransportSE(url);
        	transportSE.debug = true;
            System.out.println("Creating Soap Object");
        	 SoapObject SOAPHello = new SoapObject (MethodNamespace,MethodName );
 
 
 
        	//SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
           SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapSerializationEnvelope.VER11);
 
        	//envelope.setOutputSoapObject(SOAPHello);
            envelope.bodyOut = SOAPHello;
 
            System.out.println("try to  connect");
        	//transportSE.call("uurn:urn:CSP#getServerDate", envelope);
            transportSE.call(null,envelope);
        	System.out.println("Called uurn:CSP#getServerDate by transportSE");
 
        	//System.out.println("Res "+envelope.getResponse());
 
        	}
Le message d'erreur à l'exécution est:
Exception Thrown ------ > org.xmlpull.v1.XmlPullParserException: expected: END_TAG {http://schemas.xmlsoap.org/soap/envelope/}Body (position:END_TAG </{http://schemas.xmlsoap.org/soap/envelope/}SOAP-ENV:Fault>@2:209 in java.io.InputStreamReader@863399)
at javaapplication1.Main.main(Main.java:45)
Il s'agit de l'instruction :transportSE.call(null,envelope); ou l'appel échoue
.Pourriez vous m'aider?
Merci