public TModelDetail Send(SaveTModel saveTModel, AuthToken authToken) { SetAuthToken(saveTModel, authToken); try { return(soapClient.SaveTModel(saveTModel)); } catch (UddiException uddiException) { AttemptRefreshAuthInfo(uddiException, authToken); return(soapClient.SaveTModel(saveTModel)); } }
public TModelDetail SaveTModel([XmlElement(Namespace = Microsoft.Uddi.VersionSupport.UddiVersionSupport.CurrentNamespace, IsNullable = false)] SaveTModel saveTModel) { object[] results = InvokeWebMethod("SaveTModel", new object[] { saveTModel }); return((TModelDetail)results[0]); }
/// <summary> /// Callback-ul apelat după completarea noii valori in UpdateForm. /// Modifica valoarea pe serverul UDDI si in lista de ontologii. /// </summary> void updateForm_ValueUpdated(object sender, ValueUpdateEventArgs e) { GetTModelDetail getTModelDetail = new GetTModelDetail(((OntInfo)selectedItem.Tag).tModelKey); TModelDetail tModelDetail = getTModelDetail.Send(uddiConnection); TModel tModel = tModelDetail.TModels[0]; tModel.OverviewDoc.OverviewUrl = e.NewValue; SaveTModel saveTModel = new SaveTModel(tModel); saveTModel.Send(uddiConnection); selectedItem.SubItems[2].Text = e.NewValue; }
protected void Button1_Click(object sender, EventArgs e) { string wsdl = TextBox1.Text; string tmodelname = TextBox2.Text; string tmodeldesp = TextBox3.Text; string busi_name = TextBox4.Text; string busi_desp = TextBox5.Text; string service_name = TextBox6.Text; string service_desp = TextBox7.Text; if (wsdl != null && tmodelname != null && tmodeldesp != null && busi_name != null && busi_desp != null && service_name != null && service_desp != null) { /*ep.UseDefaultCredentials = true; ep.ebay_publishing();*/ Publish.Url = "http://WIN-NSA2A8QGUJO/uddipublic/publish.asmx"; Publish.User = "******"; Publish.Password = "******"; //Create tModel SaveTModel stm = new SaveTModel(); stm.TModels.Add(); stm.TModels[0].Name = tmodelname; stm.TModels[0].Descriptions.Add("en", tmodeldesp ); stm.TModels[0].OverviewDoc.OverviewURL = wsdl; stm.TModels[0].CategoryBag.Add ("CS779", "wsdlSpec", "uuid:c1acf26d-9672-4404-9d70-39b756e62ab4"); string sTModelKey = ""; //Send to UDDI try { TModelDetail tmd = stm.Send(); sTModelKey = tmd.TModels[0].TModelKey; } catch (UddiException ue) { MessageBox.Show(ue.Message); return; } //BusinessEntity et = new BusinessEntity(); //Create Business SaveBusiness sb = new SaveBusiness(); sb.BusinessEntities.Add(); sb.BusinessEntities[0].Names.Add(busi_name); sb.BusinessEntities[0].Descriptions.Add("en", busi_desp); //sb.BusinessEntities[0].CategoryBag.Add("categorization", "CS779","uuid:"+sTModelKey); //Create BusinessService sb.BusinessEntities[0].BusinessServices.Add(); sb.BusinessEntities[0].BusinessServices[0].Names.Add(service_name); sb.BusinessEntities[0].BusinessServices[0].Descriptions.Add("en", service_desp); //sb.BusinessEntities[0].BusinessServices[0].CategoryBag.Add("categorization","CS779","uuid:"+sTModelKey); //Create BindingTemplate sb.BusinessEntities[0].BusinessServices[0].BindingTemplates.Add(); sb.BusinessEntities[0].BusinessServices[0].BindingTemplates[0]. Descriptions.Add("en", "Binding"); sb.BusinessEntities[0].BusinessServices[0].BindingTemplates[0]. AccessPoint.Text = "Access Point"; sb.BusinessEntities[0].BusinessServices[0].BindingTemplates[0]. AccessPoint.URLType = Microsoft.Uddi.Api.URLType.Http; //Create tModelInstanceInfo sb.BusinessEntities[0].BusinessServices[0].BindingTemplates[0]. TModelInstanceDetail.TModelInstanceInfos.Add(); sb.BusinessEntities[0].BusinessServices[0].BindingTemplates[0]. TModelInstanceDetail.TModelInstanceInfos[0].Descriptions. Add("en", "Insert Description Here"); //Use tModelKey string from above sb.BusinessEntities[0].BusinessServices[0].BindingTemplates[0]. TModelInstanceDetail.TModelInstanceInfos[0].TModelKey = sTModelKey; //Send to UDDI try { BusinessDetail bd = sb.Send(); } catch (UddiException ue) { MessageBox.Show(ue.Message); return; } TextBox1.Text = String.Empty; TextBox2.Text = String.Empty; TextBox3.Text = String.Empty; TextBox4.Text = String.Empty; TextBox5.Text = String.Empty; TextBox6.Text = String.Empty; TextBox7.Text = String.Empty; get_Services(); } else { MessageBox.Show("Make sure fields are not empty"); } }
/// <summary> /// Publica ontologie cu numele si URL-ul specificat in campurile corespunzatoare (daca nu exista deja). /// </summary> private void performPublish() { String ontologyName = txbOntologyName.Text.Trim(); String ontologyURL = txbOntologyURL.Text.Trim(); if (ontologyName == String.Empty || ontologyURL == String.Empty) { MessageBox.Show("All values must be set", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } try { FindTModel findTModel = new FindTModel(ontologyName); // uuid:a035a07c-f362-44dd-8f95-e2b134bf43b4 == uddi-org:general_keywords key KeyedReference categoryOntology = new KeyedReference("uuid:a035a07c-f362-44dd-8f95-e2b134bf43b4", "ontology", "QoS"); findTModel.CategoryBag.Add(categoryOntology); findTModel.FindQualifiers.Add(FindQualifier.ExactNameMatch); TModelList tModelList = findTModel.Send(uddiConnection); if (0 == tModelList.TModelInfos.Count) { TModel ontologyTModel = new TModel(ontologyName); ontologyTModel.CategoryBag.Add(categoryOntology); ontologyTModel.OverviewDoc.OverviewUrl = ontologyURL; SaveTModel saveOntologyTModel = new SaveTModel(ontologyTModel); saveOntologyTModel.Send(uddiConnection); MessageBox.Show("Publish successful", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Ontology already exists"); } } catch (UddiException e) { MessageBox.Show("Uddi error: "+ e.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception e){ MessageBox.Show("General exception: " + e.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
/// <summary> /// Saves the T model. /// </summary> /// <param name="uConn">The UDDI connection.</param> /// <param name="tModel">The t model.</param> public static void SaveTModel(UddiConnection uConn, TModel tModel) { SaveTModel sTModel = new SaveTModel(tModel); TModelDetail tDetail = sTModel.Send(uConn); }