Esempio n. 1
0
        public ServiceDetail GetServiceDetail(GetServiceDetail gsd)
        {
            Debug.Enter();
            ServiceDetail sd = new ServiceDetail();

            try
            {
                sd.Get(gsd.ServiceKeys);
            }
            catch (Exception e)
            {
                DispositionReport.Throw(e);
            }

            return(sd);
        }
Esempio n. 2
0
        private void RenderServiceDetail(string serviceKey, HtmlTextWriter writer)
        {
            //
            // Get details for this service
            //
            StringCollection serviceKeys = new StringCollection();

            serviceKeys.Add(serviceKey);

            ServiceDetail serviceDetail = new ServiceDetail();

            serviceDetail.Get(serviceKeys);

            //
            // We will only get the first one
            //
            BusinessService businessService = serviceDetail.BusinessServices[0];

            writer.AddAttribute(HtmlTextWriterAttribute.Width, "100%");
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "serviceDetailOuterTable");
            writer.RenderBeginTag(HtmlTextWriterTag.Table);

            //
            // Render the business descriptions if there is one
            //
            writer.RenderBeginTag(HtmlTextWriterTag.Tr);
            writer.RenderBeginTag(HtmlTextWriterTag.Td);
            writer.RenderBeginTag(HtmlTextWriterTag.B);
            writer.Write(Localization.GetString("AWR_SERVICE_DESCRIPTION"));
            writer.RenderEndTag();                      // B
            writer.RenderEndTag();                      // Td
            writer.RenderEndTag();                      // Tr

            foreach (Description description in businessService.Descriptions)
            {
                writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.Write(Server.HtmlEncode(description.Value));
                writer.RenderEndTag();                          // Td
                writer.RenderEndTag();                          // Tr
            }

            //
            // Render each binding in the service that has a WSDL file associated with it
            //
            writer.RenderBeginTag(HtmlTextWriterTag.Tr);
            writer.RenderBeginTag(HtmlTextWriterTag.Td);
            writer.RenderBeginTag(HtmlTextWriterTag.B);
            writer.Write(Localization.GetString("AWR_BINDINGS"));
            writer.RenderEndTag();                      // B
            writer.RenderEndTag();                      // Td
            writer.RenderEndTag();                      // Tr

            foreach (BindingTemplate bindingTemplate in businessService.BindingTemplates)
            {
                //
                // Render each binding in a row
                //
                writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                writer.RenderBeginTag(HtmlTextWriterTag.Td);

                writer.AddAttribute(HtmlTextWriterAttribute.Width, "100%");
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "accessPointTable");
                writer.RenderBeginTag(HtmlTextWriterTag.Table);

                //
                // Render the access point
                //
                writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.RenderBeginTag(HtmlTextWriterTag.B);
                writer.Write(Localization.GetString("AWR_ACCESS_POINT"));
                writer.RenderEndTag();                          // B
                writer.RenderEndTag();                          // Td
                writer.RenderEndTag();                          // Tr

                writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.Write(Server.HtmlEncode(bindingTemplate.AccessPoint.Value));
                writer.RenderEndTag();                  // Td
                writer.RenderEndTag();                  // Tr

                //
                // Render the descriptions.
                //
                writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.RenderBeginTag(HtmlTextWriterTag.B);
                writer.Write(Localization.GetString("AWR_DESCRIPTION"));
                writer.RenderEndTag();                  // B
                writer.RenderEndTag();                  // Td
                writer.RenderEndTag();                  // Tr

                foreach (Description description in bindingTemplate.Descriptions)
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                    writer.Write(Server.HtmlEncode(description.Value));
                    writer.RenderEndTag();                      // Td
                    writer.RenderEndTag();                      // Tr

                    //
                    // Render an empty row between descriptions
                    //
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                    writer.RenderEndTag();                      // Tr
                    writer.RenderEndTag();                      // Td
                }

                //
                // Render the WSDL files.  We are assuming that any overview doc urls are urls to WSDL files
                //
                writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.RenderBeginTag(HtmlTextWriterTag.B);
                writer.Write(Localization.GetString("AWR_ID"));
                writer.RenderEndTag();                  // B
                writer.RenderEndTag();                  // Td
                writer.RenderEndTag();                  // Tr

                int wsdlCount = 0;

                foreach (TModelInstanceInfo instanceInfo in bindingTemplate.TModelInstanceInfos)
                {
                    //
                    // Get the tModel related to this instance.
                    //
                    TModel tModel = new TModel(instanceInfo.TModelKey);

                    //
                    // We don't want any exceptions ruining the rest of our display
                    //
                    try
                    {
                        //
                        // Get details for this tModel.
                        //
                        tModel.Get();

                        bool isWsdlSpec = false;
                        foreach (KeyedReference keyedReference in tModel.CategoryBag)
                        {
                            if (true == keyedReference.KeyValue.Equals(UDDI.Constants.UDDITypeTaxonomyWSDLSpecKeyValue) &&
                                true == keyedReference.TModelKey.ToLower().Equals(UDDI.Constants.UDDITypeTaxonomyTModelKey))
                            {
                                isWsdlSpec = true;
                                break;
                            }
                        }

                        //
                        // If this tModel has an overview doc, then consider that document as the link to the
                        // WSDL file.
                        //
                        if (true == isWsdlSpec &&
                            null != tModel.OverviewDoc.OverviewURL &&
                            tModel.OverviewDoc.OverviewURL.Length > 0)
                        {
                            //
                            // Render the WSDL link
                            //
                            writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                            writer.RenderBeginTag(HtmlTextWriterTag.Td);

                            //
                            // Render the arrow image.
                            //
                            writer.AddAttribute(HtmlTextWriterAttribute.Src, "../images/orange_arrow_right.gif");
                            writer.RenderBeginTag(HtmlTextWriterTag.Img);
                            writer.Write(" ");
                            writer.RenderEndTag();                              // Img

                            //
                            // Make the overview URL a hyper link
                            //
                            writer.AddAttribute(HtmlTextWriterAttribute.Href, tModel.OverviewDoc.OverviewURL);
                            writer.RenderBeginTag(HtmlTextWriterTag.A);
                            writer.Write(tModel.OverviewDoc.OverviewURL);
                            writer.RenderEndTag();                              // A

                            //
                            // Render the first description if there is one
                            //
                            if (tModel.OverviewDoc.Descriptions.Count > 0)
                            {
                                writer.Write(" - ");
                                writer.Write(tModel.OverviewDoc.Descriptions[0].Value);
                            }

                            wsdlCount++;

                            writer.RenderEndTag();                              // Td
                            writer.RenderEndTag();                              // Tr
                        }
                    }
                    catch
                    {
                        //
                        // Intentionally empty.
                        //
                    }
                }

                //
                // If there were no WSDL files registered, render a message saying so.
                //
                if (0 == wsdlCount)
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                    writer.RenderBeginTag(HtmlTextWriterTag.Td);
                    writer.Write(Localization.GetString("AWR_NO_WSDLS"));
                    writer.RenderEndTag();                      // Td
                    writer.RenderEndTag();                      // Tr
                }

                writer.RenderEndTag();          // TABLE
                writer.RenderEndTag();          // Td
                writer.RenderEndTag();          // Tr
            }
            writer.RenderEndTag();              // TABLE
        }