| 12
 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());
            }
      } 
  } | 
Partager