Beispiel #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");

                node n1 = new node();
                n1.clientName = "juddicloud";
                //the following are optional
                /*
                 * max length is 255
                 * proxy transport
                 * factory*
                 * juddiapi url
                 */
                n1.proxyTransport = "org.apache.juddi.v3.client.transport.JAXWSTransport";
                n1.custodyTransferUrl = "http://uddi-jbossoverlord.rhcloud.com/services/custody-transfer";
                n1.inquiryUrl = "http://uddi-jbossoverlord.rhcloud.com/services/inquiry";
                n1.publishUrl = "http://uddi-jbossoverlord.rhcloud.com/services/publish";
                n1.securityUrl = "http://uddi-jbossoverlord.rhcloud.com/services/security";
                n1.subscriptionUrl = "http://uddi-jbossoverlord.rhcloud.com/services/subscription";
                n1.subscriptionListenerUrl = "http://uddi-jbossoverlord.rhcloud.com/services/subscription-listener";
                n1.name = "juddicloud";
                n1.description = "juddicloud";
                save_node saveNode = new save_node();
                saveNode.authInfo = (clerk.getAuthToken(clerk.getUDDINode().getSecurityUrl()));
                saveNode.node = new node[] { (n1) };
                PrintJUDDI<save_node> p = new PrintJUDDI<save_node>();
                Console.Out.WriteLine("Before sending");
                Console.Out.WriteLine(p.print(saveNode));

                node[] nodes = clerk.getUDDINode().getTransport().getJUDDIApiService(clerk.getUDDINode().getJuddiApiUrl()).save_Node(saveNode);

             //  clerk.saveNode(n1);

            }
            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();
            }
        }
Beispiel #2
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");

                node n1 = new node();
                n1.clientName = "juddicloud";
                //the following are optional

                /*
                 * max length is 255
                 * proxy transport
                 * factory*
                 * juddiapi url
                 */
                n1.proxyTransport          = "org.apache.juddi.v3.client.transport.JAXWSTransport";
                n1.custodyTransferUrl      = "http://uddi-jbossoverlord.rhcloud.com/services/custody-transfer";
                n1.inquiryUrl              = "http://uddi-jbossoverlord.rhcloud.com/services/inquiry";
                n1.publishUrl              = "http://uddi-jbossoverlord.rhcloud.com/services/publish";
                n1.securityUrl             = "http://uddi-jbossoverlord.rhcloud.com/services/security";
                n1.subscriptionUrl         = "http://uddi-jbossoverlord.rhcloud.com/services/subscription";
                n1.subscriptionListenerUrl = "http://uddi-jbossoverlord.rhcloud.com/services/subscription-listener";
                n1.name        = "juddicloud";
                n1.description = "juddicloud";
                save_node saveNode = new save_node();
                saveNode.authInfo = (clerk.getAuthToken(clerk.getUDDINode().getSecurityUrl()));
                saveNode.node     = new node[] { (n1) };
                PrintJUDDI <save_node> p = new PrintJUDDI <save_node>();
                Console.Out.WriteLine("Before sending");
                Console.Out.WriteLine(p.print(saveNode));


                node[] nodes = clerk.getUDDINode().getTransport().getJUDDIApiService(clerk.getUDDINode().getJuddiApiUrl()).save_Node(saveNode);



                //  clerk.saveNode(n1);
            }
            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();
                }
            }
        }