public static instanceDetails MapInstanceDetails(uddi.apiv2.instanceDetails instanceDetails) { if (instanceDetails == null) return null; instanceDetails r = new instanceDetails(); r.description = MapDescription(instanceDetails.description); r.instanceParms = instanceDetails.instanceParms; r.Items = MapOverviewDoc(instanceDetails.overviewDoc); return r; }
private bindingTemplate createWSDLBinding(QName serviceQName, string portName, Uri serviceUrl, xmlsoap.schemas.easyWsdl.tDefinitions wsdlDefinition) { bindingTemplate bindingTemplate = new bindingTemplate(); // Set BusinessService Key bindingTemplate.serviceKey = (UDDIKeyConvention.getServiceKey(properties, serviceQName.getLocalPart())); if (serviceUrl != null) { // Set AccessPoint accessPoint accessPoint = new accessPoint(); accessPoint.useType = (AccessPointType.endPoint.ToString()); accessPoint.Value = (urlLocalizer.rewrite(serviceUrl)); bindingTemplate.Item = (accessPoint); // Set Binding Key String bindingKey = UDDIKeyConvention.getBindingKey(properties, serviceQName, portName, serviceUrl); bindingTemplate.bindingKey = (bindingKey); } org.xmlsoap.schemas.easyWsdl.tService service = wsdlDefinition.getService(serviceQName); if (service != null) { List<tModelInstanceInfo> tii = new List<tModelInstanceInfo>(); org.xmlsoap.schemas.easyWsdl.tPort port = service.getPort(portName); if (port != null) { if (serviceUrl == null) { if (port.Any != null) { HashSet<XmlElement>.Enumerator it = port.Any.GetEnumerator(); while (it.MoveNext()) { String location = null; if (it.Current.LocalName.Equals("address", StringComparison.CurrentCultureIgnoreCase) && it.Current.NamespaceURI.Equals("http://schemas.xmlsoap.org/wsdl/soap/", StringComparison.CurrentCultureIgnoreCase)) { location = it.Current.GetAttribute("location"); } else if (it.Current.LocalName.Equals("address", StringComparison.CurrentCultureIgnoreCase) && it.Current.NamespaceURI.Equals("http://schemas.xmlsoap.org/wsdl/http/", StringComparison.CurrentCultureIgnoreCase)) { location = it.Current.GetAttribute("location"); } else if (it.Current.LocalName.Equals("address", StringComparison.CurrentCultureIgnoreCase) && it.Current.NamespaceURI.Equals("http://schemas.xmlsoap.org/wsdl/soap12/", StringComparison.CurrentCultureIgnoreCase)) { location = it.Current.GetAttribute("location"); } if (location != null) { try { Uri locationURI = new Uri(location); accessPoint accessPoint = new accessPoint(); accessPoint.useType = (AccessPointType.endPoint.ToString()); accessPoint.Value = (urlLocalizer.rewrite(locationURI)); bindingTemplate.Item = (accessPoint); // Set Binding Key String bindingKey = UDDIKeyConvention.getBindingKey(properties, serviceQName, portName, locationURI); bindingTemplate.bindingKey = (bindingKey); break; } catch (Exception e) { log.error("", e); } } } } } XmlQualifiedName bx = port.binding; org.xmlsoap.schemas.easyWsdl.tBinding bindingelement = wsdlDefinition.getBinding(bx); // Set the Binding Description String bindingDescription = ""; // Override with the service description from the WSDL if present if (bindingelement != null && bindingelement.documentation != null && bindingelement.documentation.Any != null) { HashSet<XmlNode>.Enumerator it = bindingelement.documentation.Any.GetEnumerator(); while (it.MoveNext()) { bindingDescription += it.Current.Value; } } if (String.IsNullOrEmpty(bindingDescription)) bindingDescription = properties.getProperty(Property.BINDING_DESCRIPTION, Property.DEFAULT_BINDING_DESCRIPTION); ; bindingTemplate.description = Common2UDDI.mapdescription(bindingDescription, lang).ToArray(); // reference wsdl:binding tModel tModelInstanceInfo tModelInstanceInfoBinding = new tModelInstanceInfo(); tModelInstanceInfoBinding.tModelKey = (keyDomainURI + bindingelement.name); instanceDetails instanceDetails = new instanceDetails(); instanceDetails.instanceParms = (portName); tModelInstanceInfoBinding.instanceDetails = (instanceDetails); tModelInstanceInfoBinding.description = Common2UDDI.mapdescription("The wsdl:binding that this wsdl:port implements. " + bindingDescription + " The instanceParms specifies the port local name.", lang).ToArray(); tii.Add(tModelInstanceInfoBinding); // reference wsdl:portType tModel org.xmlsoap.schemas.easyWsdl.tPortType portType = wsdlDefinition.getPortType(bindingelement.type); tModelInstanceInfo tModelInstanceInfoPortType = new tModelInstanceInfo(); tModelInstanceInfoPortType.tModelKey = (keyDomainURI + portType.name); String portTypeDescription = ""; if (portType.documentation != null && portType.documentation.Any != null) { HashSet<XmlNode>.Enumerator it = portType.documentation.Any.GetEnumerator(); while (it.MoveNext()) { portTypeDescription += it.Current.Value; } } tModelInstanceInfoPortType.description = Common2UDDI.mapdescription("The wsdl:portType that this wsdl:port implements." + portTypeDescription,lang).ToArray(); tii.Add(tModelInstanceInfoPortType); bindingTemplate.tModelInstanceDetails = tii.ToArray(); } else { log.error("Could not find Port with portName: " + portName); } } else { log.error("Could not find Service with serviceName: " + serviceQName.getLocalPart()); } return bindingTemplate; }
public void xr_instanceDetails() { Console.Out.WriteLine("serialization instanceDetails"); instanceDetails r = new instanceDetails(); XmlSerializer xr = new XmlSerializer(typeof(instanceDetails)); StringWriter sw = new StringWriter(); xr.Serialize(sw, r); System.Console.Out.WriteLine(sw.ToString()); }
protected bindingTemplate createWADLBinding(QName serviceQName, String portName, Uri serviceUrl, resources res) { bindingTemplate bindingTemplate = new bindingTemplate(); // Set BusinessService Key bindingTemplate.serviceKey = (UDDIKeyConvention.getServiceKey(properties, serviceQName.getLocalPart())); List<tModelInstanceInfo> items = new List<tModelInstanceInfo>(); if (serviceUrl != null) { // Set AccessPoint accessPoint accessPoint = new accessPoint(); accessPoint.useType = (AccessPointType.endPoint.ToString()); accessPoint.Value = ((serviceUrl.ToString())); bindingTemplate.Item = (accessPoint); // Set Binding Key String bindingKey = UDDIKeyConvention.getBindingKey(properties, serviceQName, portName, serviceUrl); bindingTemplate.bindingKey = (bindingKey); bindingTemplate.description = Common2UDDI.mapdescription(getDescription(res.doc), lang).ToArray(); // reference wsdl:binding tModel tModelInstanceInfo tModelInstanceInfoBinding = new tModelInstanceInfo(); tModelInstanceInfoBinding.tModelKey = (keyDomainURI + "binding"); instanceDetails id = new instanceDetails(); id.instanceParms= portName ; tModelInstanceInfoBinding.instanceDetails = (id); tModelInstanceInfoBinding.description = Common2UDDI.mapdescription("The binding that this endpoint implements. " + bindingTemplate.description[0].Value + " The instanceParms specifies the port local name.", lang).ToArray(); items.Add(tModelInstanceInfoBinding); tModelInstanceInfo tModelInstanceInfoPortType = new tModelInstanceInfo(); tModelInstanceInfoPortType.tModelKey = (keyDomainURI + "rest"); tModelInstanceInfoPortType.description = Common2UDDI.mapdescription("The wadl:Resource:base implements.", lang).ToArray(); items.Add(tModelInstanceInfoPortType); } bindingTemplate.tModelInstanceDetails = items.ToArray(); return bindingTemplate; }