Bonjour à tous,

Je suis développeur .net et je ne connais rien au Java.

J'ai besoin de consommer un WebService écrit en .net, à partir de Java.

En fait, je n'arrive pas à passer des paramètres, ils sont toujours vides.

Le web service : http://www.chevalier-edition.com/des...ebservice.asmx (CreateImage2D)

Pour tester, c'est simple il suffit de l'appeler et de lui passer "ID", il répond par la valeur même de l'ID ou par "ID est vide".

Voici une partie du code actuel :
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
import java.awt.*;
import java.net.URL;
import java.util.*;
import java.io.*;
import java.net.URLConnection;
import java.net.MalformedURLException;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import javax.xml.namespace.QName;
import javax.xml.rpc.NamespaceConstants;
import javax.xml.rpc.ParameterMode;
import java.net.URL;
 
 
                  String      strEndPoint       = "http://site/webservice.asmx";
                  String      strSoapAction     = "http://schemas.xmlsoap.org/wsdl/CreateImage2D";
                  String      strSchemaURL      = "http://site/webservice.asmx?WSDL";
                  String      strParamName1     = "Id";
                  String      strParamName2     = "Coord";
                  String      strParamName3     = "Color";
 
                  String      strParameterVal1  = "987";
                  String      strParameterVal2  = "Coord";
                  String      strParameterVal3  = "Color";
 
                  String      strFunctionName   = "CreateImage2D";
 
                  Call  call   = new Call(strEndPoint); 
 
                  call.setOperationName(new QName (strFunctionName));
 
                  call.setReturnType(XMLType.XSD_STRING);
 
                  call.addParameter("Id", XMLType.XSD_STRING, ParameterMode.IN);
                  call.addParameter("Coord",XMLType.XSD_STRING, ParameterMode.IN);
 
                  call.addParameter("Color", XMLType.XSD_STRING, ParameterMode.IN);
 
                  call.setSOAPActionURI(strSoapAction); 
 
                  String      strResult = (String) call.invoke(new Object[] { strParameterVal1 , strParameterVal2 , strParameterVal13});
                  System.out.println(strResult);
            }
            catch (Exception e)
            {
                  System.err.println(e.toString());
            }
      } 
  }
Quelqu'un saurait-il m'indiquer comment procéder ?

Merci d'avance pour votre aide.