Example #1
0
        public static void Generate(ArrayList services, ArrayList schemas, string binOper, string protocol)
        {
            ServiceDescriptionCollection descCol = new ServiceDescriptionCollection();

            foreach (ServiceDescription sd in services)
            {
                descCol.Add(sd);
            }

            XmlSchemas schemaCol;

            if (schemas.Count > 0)
            {
                schemaCol = new XmlSchemas();
                foreach (XmlSchema sc in schemas)
                {
                    schemaCol.Add(sc);
                }
            }
            else
            {
                schemaCol = descCol[0].Types.Schemas;
            }

            string oper, bin = null;

            int i = binOper.IndexOf('/');

            if (i != -1)
            {
                oper = binOper.Substring(i + 1);
                bin  = binOper.Substring(0, i);
            }
            else
            {
                oper = binOper;
            }

            ConsoleSampleGenerator sg = new ConsoleSampleGenerator(descCol, schemaCol);

            string req, resp;

            sg.GenerateMessages(oper, bin, protocol, out req, out resp);

            Console.WriteLine();
            Console.WriteLine("Sample request message:");
            Console.WriteLine();
            Console.WriteLine(req);
            Console.WriteLine();
            Console.WriteLine("Sample response message:");
            Console.WriteLine();
            Console.WriteLine(resp);
        }
Example #2
0
		public static void Generate (ArrayList services, ArrayList schemas, string binOper, string protocol)
		{
			ServiceDescriptionCollection descCol = new ServiceDescriptionCollection ();
			foreach (ServiceDescription sd in services)
				descCol.Add (sd);
				
			XmlSchemas schemaCol;

			if (schemas.Count > 0) {
				schemaCol = new XmlSchemas ();
				foreach (XmlSchema sc in schemas)
					schemaCol.Add (sc);
			}
			else
				schemaCol = descCol[0].Types.Schemas;
				
			string oper, bin = null; 
			
			int i = binOper.IndexOf ('/');
			if (i != -1) {
				oper = binOper.Substring (i+1);
				bin = binOper.Substring (0,i);
			}
			else
				oper = binOper;
			
			ConsoleSampleGenerator sg = new ConsoleSampleGenerator (descCol, schemaCol);
			
			string req, resp;
			sg.GenerateMessages (oper, bin, protocol, out req, out resp);
			
			Console.WriteLine ();
			Console.WriteLine ("Sample request message:");
			Console.WriteLine ();
			Console.WriteLine (req);
			Console.WriteLine ();
			Console.WriteLine ("Sample response message:");
			Console.WriteLine ();
			Console.WriteLine (resp);
		}