Java Web Service link :
This web service is temporarily unavailable until July 8th 2016, if you need an earlier access you can contact Maxime Chassaing at this address: maxime.chassaing[@]gmail[dot]com
http://orws2.isima.fr:80/WebServiceRO/WebServiceROSoap?WSDL
Web Service link :
This web service is temporarily unavailable until July 8th 2016, if you need earlier an access you can contact Maxime Chassaing at this address: maxime.chassaing[@]gmail[dot]com
http://orws.isima.fr/WebServiceRO/WebServiceROSoap?WSDL
ServiceReference1.WebServiceROSoapClient client = new ServiceReference1.WebServiceROSoapClient();
string filename = "c:\\euro.svg"; FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read); int taille = (int)fs.Length; byte[] ImageData = new byte[fs.Length]; fs.Read(ImageData, 0, (int)fs.Length); fs.Close();
string secret_key = client.startThread_SVGtoPNG(ImageData, ref codeErreur, ref erreur);
int response; // ==0 in progress but not finished, ==1 finished, ==-1 error
do
{
System.Threading.Thread.Sleep(5000);
response = client.isCompleteThread(secret_key, ref codeErreur, ref erreur);
} while (response == 0);
byte[] dataResult = new byte[100000]; dataResult = client.readResult(secret_key, ref codeErreur, ref erreur); string fileName2 = "c:\\fichier_recu.png"; FileStream fileStream2 = new FileStream(fileName2, FileMode.Create); fileStream2.Write(dataResult, 0, dataResult.Length); fileStream2.Close();
private void button1_Click(object sender, EventArgs e)
{
int codeErreur = 0;
string erreur = "";
try
{
ServiceReference1.WebServiceROSoapClient client = new ServiceReference1.WebServiceROSoapClient();
// http://openclipart.org/
// part 1 : Submit a file
// -----------------------
// read a file on SVG format
// and transform it into an array of bytes
string filename = "c:\\euro.svg";
FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read);
int taille = (int)fs.Length;
byte[] ImageData = new byte[fs.Length];
fs.Read(ImageData, 0, (int)fs.Length);
fs.Close();
// upload the file on the server and required transformation
string secret_key = client.startThread_SVGtoPNG(ImageData, ref codeErreur, ref erreur);
// test if the
if (codeErreur == 0)
{
// part 2 : check if job finished
// ------------------------------
// the submission is OK
// we must wait until server has achieved the job
int response; // ==0 in progress but not finished, ==1 finished, ==-1 error
do
{
System.Threading.Thread.Sleep(5000);
response = client.isCompleteThread(secret_key, ref codeErreur, ref erreur);
} while (response == 0);
// part 3 : read the file into the format png
// ------------------------------------------
byte[] dataResult = new byte[100000];
dataResult = client.readResult(secret_key, ref codeErreur, ref erreur);
string fileName2 = "c:\\fichier_recu.png";
FileStream fileStream2 = new FileStream(fileName2, FileMode.Create);
fileStream2.Write(dataResult, 0, dataResult.Length);
fileStream2.Close();
}
else
richTextBox1.AppendText("Submission result : " + erreur);
richTextBox1.AppendText("job ended \n");
}
catch (Exception E)
{
richTextBox1.AppendText("erreur : "+ E.ToString());
richTextBox1.AppendText(codeErreur.ToString());
}
}
}
webservices.WebServiceRO client = new webservices.WebServiceRO();
webservices.WebServiceROSoap portJava;
portJava = client.getWebServiceROSoapPort();
File filename = new File("c:\\euro.svg");
InputStream fs = new FileInputStream(filename );
int taille = fs.available();
byte[] ImageData = new byte[taille];
fs.read(ImageData);
fs.close();
javax.xml.ws.Holder‹java.lang.Integer› error = new javax.xml.ws.Holder‹java.lang.Integer› ();
javax.xml.ws.Holder‹java.lang.String› stringError = new javax.xml.ws.Holder‹java.lang.String› ();
String secret_key;
secret_key = portJava.startThreadSVGtoPNG(ImageData,error,stringError);
int response; // ==0 in progress but not finished, ==1 finished, ==-1 error
do
{
Thread.sleep(5000);
response = portJava.isCompleteThread(secret_key, error, stringError);
} while (response == 0);
byte[] res = null;
res = portJava.readResult(secret_key, error, stringError);
String fileName2 = "c:\\fichier_recu.png";
File imagefile = new File(fileName2);
FileOutputStream fileStream2 = new FileOutputStream(imagefile,false);
fileStream2.write(res);
fileStream2.close();