Re: [xmlblaster] Java and C#

2008-05-30 Thread Marcel Ruff

Arghad Arnaout wrote:

Hi ..

Marcel, thanx for correcting me  .. I referenced the wrong example  ..
OK to connect using the XML-RPC .. you can check the source code 
shipped with xmlBlaster source code under the directory 


XMLBLASTER_HOME\demo\csharp\xmlrpc

I think that it contains all what you need to connect ... all the stub 
code (XmlBlaster.cs in CSharpDrawingDemo project and XmlBlasterClient 
in XmlBlasterLib project) for connecting to xmlblaster server 

I think it is correct :-)
This code is contributed by Cyrille,

regards
Marcel


Marcel, please correct me if I was wrong...

regards,
Arghad


On Fri, May 30, 2008 at 10:53 AM, Marcel Ruff <[EMAIL PROTECTED] 
> wrote:


Arghad Arnaout wrote:

Hi Mohannad ..
Here you can find a sample on how to write a client in csharp ...
http://www.xmlblaster.com/xmlBlaster/doc/requirements/client.csharp.html

You can start from the code here:
http://www.xmlblaster.org/xmlBlaster/src/csharp/Hello.cs.html

This Hello.cs uses the SOCKET protocol, so no XMLRPC is needed in
this case.

But the C# client uses a C DLL beneath (for the SOCKET
communication) which is compiled like this:

build c-lib  --> xmlBlaster/lib/libxmlBlasterClientCD.so

If you are on Linux a .so, on Windows a .dll is generated.
On Windows you need the Visual Studio compiler
and if on Linux you need the gcc or icc and mono

thanks
Marcel

First you have to start the server with XMLRPC support and
then you can start your .NET client ...

Hope this help you ..
Cheers,
Arghad



On Fri, May 30, 2008 at 9:54 AM, Mohannad
<[EMAIL PROTECTED] 
>>
wrote:

   Dear sir,

   I need to make a small communication using XMLblaster
between two
   objects : Java and C#.

   Mr.Zied made a file /(Attached)/ for testing latency in
Java and I
   need to make the same but in C# to make that small
communication.

   Could any body help please?

   Thanks

   Mohannad



-- 
Marcel Ruff

http://www.xmlBlaster.org
http://watchee.net
Phone: +49 7551 309371





--
Marcel Ruff
http://www.xmlBlaster.org
http://watchee.net
Phone: +49 7551 309371



Re: [xmlblaster] Java and C#

2008-05-30 Thread Arghad Arnaout
Hi ..

Marcel, thanx for correcting me  .. I referenced the wrong example  ..
OK to connect using the XML-RPC .. you can check the source code shipped
with xmlBlaster source code under the directory

XMLBLASTER_HOME\demo\csharp\xmlrpc

I think that it contains all what you need to connect ... all the stub code
(XmlBlaster.cs in CSharpDrawingDemo project and XmlBlasterClient in
XmlBlasterLib project) for connecting to xmlblaster server 

Marcel, please correct me if I was wrong...

regards,
Arghad


On Fri, May 30, 2008 at 10:53 AM, Marcel Ruff <[EMAIL PROTECTED]> wrote:

> Arghad Arnaout wrote:
>
>> Hi Mohannad ..
>> Here you can find a sample on how to write a client in csharp ...
>> http://www.xmlblaster.com/xmlBlaster/doc/requirements/client.csharp.html
>>
>> You can start from the code here:
>> http://www.xmlblaster.org/xmlBlaster/src/csharp/Hello.cs.html
>>
>>  This Hello.cs uses the SOCKET protocol, so no XMLRPC is needed in this
> case.
>
> But the C# client uses a C DLL beneath (for the SOCKET communication) which
> is compiled like this:
>
> build c-lib  --> xmlBlaster/lib/libxmlBlasterClientCD.so
>
> If you are on Linux a .so, on Windows a .dll is generated.
> On Windows you need the Visual Studio compiler
> and if on Linux you need the gcc or icc and mono
>
> thanks
> Marcel
>
>> First you have to start the server with XMLRPC support and then you can
>> start your .NET client ...
>>
>> Hope this help you ..
>> Cheers,
>> Arghad
>>
>>
>>
>> On Fri, May 30, 2008 at 9:54 AM, Mohannad <[EMAIL PROTECTED] > [EMAIL PROTECTED]>> wrote:
>>
>>Dear sir,
>>
>>I need to make a small communication using XMLblaster between two
>>objects : Java and C#.
>>
>>Mr.Zied made a file /(Attached)/ for testing latency in Java and I
>>need to make the same but in C# to make that small communication.
>>
>>Could any body help please?
>>
>>Thanks
>>
>>Mohannad
>>
>>
>
> --
> Marcel Ruff
> http://www.xmlBlaster.org
> http://watchee.net
> Phone: +49 7551 309371
>
>


Re: [xmlblaster] Java and C#

2008-05-30 Thread Marcel Ruff

Arghad Arnaout wrote:

Hi Mohannad ..
Here you can find a sample on how to write a client in csharp ...
http://www.xmlblaster.com/xmlBlaster/doc/requirements/client.csharp.html

You can start from the code here:
http://www.xmlblaster.org/xmlBlaster/src/csharp/Hello.cs.html


This Hello.cs uses the SOCKET protocol, so no XMLRPC is needed in this case.

But the C# client uses a C DLL beneath (for the SOCKET communication) 
which is compiled like this:


build c-lib 
 --> xmlBlaster/lib/libxmlBlasterClientCD.so


If you are on Linux a .so, on Windows a .dll is generated.
On Windows you need the Visual Studio compiler
and if on Linux you need the gcc or icc and mono

thanks
Marcel
First you have to start the server with XMLRPC support and then you 
can start your .NET client ...


Hope this help you ..
Cheers,
Arghad



On Fri, May 30, 2008 at 9:54 AM, Mohannad <[EMAIL PROTECTED] 
> wrote:


Dear sir,

I need to make a small communication using XMLblaster between two
objects : Java and C#.

Mr.Zied made a file /(Attached)/ for testing latency in Java and I
need to make the same but in C# to make that small communication.

Could any body help please?

Thanks

Mohannad 






--
Marcel Ruff
http://www.xmlBlaster.org
http://watchee.net
Phone: +49 7551 309371



Re: [xmlblaster] Java and C#

2008-05-30 Thread Arghad Arnaout
Hi Mohannad ..
Here you can find a sample on how to write a client in csharp ...
http://www.xmlblaster.com/xmlBlaster/doc/requirements/client.csharp.html

You can start from the code here:
http://www.xmlblaster.org/xmlBlaster/src/csharp/Hello.cs.html

First you have to start the server with XMLRPC support and then you can
start your .NET client ...

Hope this help you ..
Cheers,
Arghad



On Fri, May 30, 2008 at 9:54 AM, Mohannad <[EMAIL PROTECTED]> wrote:

> Dear sir,
>
> I need to make a small communication using XMLblaster between two objects :
> Java and C#.
>
> Mr.Zied made a file *(Attached)* for testing latency in Java and I need to
> make the same but in C# to make that small communication.
>
> Could any body help please?
>
> Thanks
>
> Mohannad


[xmlblaster] Java and C#

2008-05-30 Thread Mohannad
Dear sir,

I need to make a small communication using XMLblaster between two objects :
Java and C#.

Mr.Zied made a file *(Attached)* for testing latency in Java and I need to
make the same but in C# to make that small communication.

Could any body help please?

Thanks

Mohannad

import org.xmlBlaster.util.Global;
import org.xmlBlaster.util.SessionName;
import org.xmlBlaster.util.XmlBlasterException;
import org.xmlBlaster.client.qos.ConnectQos;
import org.xmlBlaster.client.qos.PublishQos;
import org.xmlBlaster.client.I_Callback;
import org.xmlBlaster.client.key.PublishKey;
import org.xmlBlaster.client.key.UpdateKey;
import org.xmlBlaster.client.qos.UpdateQos;
import org.xmlBlaster.client.I_XmlBlasterAccess;
import org.xmlBlaster.util.MsgUnit;
import java.util.Scanner;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import org.xmlBlaster.util.qos.address.Address;
import org.xmlBlaster.util.qos.address.CallbackAddress;


public class PingTest implements I_Callback
{
	private String oid="test";
	private Global glob;
	I_XmlBlasterAccess con;
	long fin = -1L;
	long debut = -1L;
	long latence = -1L; 
	static boolean t =true;
	static PrintWriter output = null;
	
/*	public static byte [] (byte y [], int n_byte){
		
		byte [] x = new byte [n_byte];
		for (int i = 0; i ", ""); 
  }
  catch (Exception e) {
 System.err.println(e.getMessage());
  }
   }

void send(String cont)
{
PublishKey pk = new PublishKey(glob, oid, "text/xml", "1.0");
PublishQos pq = new PublishQos(glob);

	
pq.setPersistent(false);


 byte [] content = cont.getBytes();
 byte [] x = new byte [content.length *2];
for (int i = 0; i<(content.length *2);i++)
{
	if (i < content.length )
	x[i] = content[i];
	
	else
	x[i] = content[i/content.length];
}

System.out.println("The size. is "+ x.length);
MsgUnit msgUnit = new MsgUnit(pk, content, pq);
	
try {
		
	// 	publish
	con.publish(msgUnit);

} catch (XmlBlasterException e) {
		System.err.print(e);
	}	
} 
   //update : reception d'un message 
   public String update(String cbSessionId, UpdateKey updateKey, byte[] content,
UpdateQos updateQos)
   {
	   
	   String receive = new String(content);
	   
	   if (receive.equals("pong1234"))
	  // if (receive.has)
	{
	   

	fin=System.currentTimeMillis();
System.out.println("fin   : "+fin);
	   
	latence = (fin-debut)/2;
	System.out.println("latence : "+latence);
	output.println("latence "+latence );
   	   	
	try {
		
		con.erase("", null);
		
	} catch (XmlBlasterException e) {
			e.printStackTrace();
		}

		con.disconnect(null);
	   t = true;
	   }
	   
	   return "";
   }

   
   public static void main(String args[]) {
  Global glob = new Global();

  if (glob.init(args) != 0) { // Get help with -help
 System.out.println(glob.usage());
 System.out.println("Example: java HelloWorld2 -session.name Jack");
 System.exit(1);
  }
  
  try{
  
  output = new PrintWriter(new File
  ("data.txt"));
	}
	 catch(FileNotFoundException e){
	 	System.out.println("Problem opening files.");
	 }
	 
	
	
  PingTest ping = new PingTest(glob);
	
	// send 50 messages   
  	for (int i =0; i<50; i++)
  	{
 	while (!t){}
   new PingTest(glob);
  }
  
  output.close();
}
}