示例#1
0
        public static void main(string[] args)
        {
            UDDIClient clerkManager = null;
            Transport  transport    = null;
            UDDIClerk  clerk        = null;

            try
            {
                clerkManager = new UDDIClient("uddi.xml");

                transport = clerkManager.getTransport("default");

                UDDI_Security_SoapBinding    security = transport.getUDDISecurityService();
                UDDI_Inquiry_SoapBinding     inquiry  = transport.getUDDIInquiryService();
                UDDI_Publication_SoapBinding publish  = transport.getUDDIPublishService();
                JUDDIApiService juddi = transport.getJUDDIApiService();

                clerk = clerkManager.getClerk("default");

                clerk newclerk = new clerk();
                newclerk.node      = new node();
                newclerk.node.name = "juddicloud";
                newclerk.publisher = "root";
                newclerk.password  = "******";

                newclerk.name = "juddicloud";
                UDDIClerk cc = new UDDIClerk(newclerk);


                save_clerk saveClerk = new save_clerk();
                saveClerk.authInfo = clerk.getAuthToken(clerk.getUDDINode().getSecurityUrl());
                saveClerk.clerk    = new clerk[] { newclerk };
                clerk[] ret = juddi.save_Clerk(saveClerk);

                Console.Out.WriteLine(ret.Length);
            }
            catch (Exception ex)
            {
                while (ex != null)
                {
                    System.Console.WriteLine("Error! " + ex.Message);
                    ex = ex.InnerException;
                }
            }
            finally
            {
                if (transport != null && transport is IDisposable)
                {
                    ((IDisposable)transport).Dispose();
                }
                if (clerk != null)
                {
                    clerk.Dispose();
                }
            }
        }
    //internal System.Threading.WaitCallback startTread(ListBox ls)
    internal System.Threading.ThreadStart startTread(clerk.ClerkGUI c)
    {
        while (true)
        {
            n = c;
            //Requesting for Sending Data //
            c.AddToTextBox("Data Send to : "+c.getIp());
            DataSend ds = new DataSend(c.getIp(), "5210");
            ds.sendData("Free");
            //Requesting For
            c.AddToTextBox("\nData Successfully Sent to : " + c.getIp());
            DataReceive dr = new DataReceive("5211");
            c.AddToTextBox("\nData Received"+dr.getData()+"from ip-address"+dr.ipaddress);
            computeIt(dr.getData());

        }
        throw new NotImplementedException();
    }