public void Expect_NativeWsdlImporter_Handles_MultipartWsdl() { var wsdlImporter = new NativeWsdlImporter(); var set = MetadataHelper.GetMetadataSetForMultipartWsdl(); wsdlImporter.InitializeMetadataSet(set); WsdlImportResult result = wsdlImporter.ImportWsdl(); Assert.IsTrue(result.Endpoints.Count == 2, "Incorrect number of endpoints"); Assert.IsTrue(result.Bindings.Count == 2, "Incorrect number of bindings"); Assert.IsTrue(result.Contracts.Count == 1, "Incorrect number of contracts"); }
/// <summary> /// Imports the service definition from a given endpoint or local wsdl /// </summary> /// <param name="path">path to the endpoint or local wsdl</param> /// <returns>A ServiceDefinition containing all the metadata.</returns> public ServiceDefinition Import(string path) { // Call the discoveryAgent to get the metadata from the specified path. this.metadataSet = this.discoveryAgent.Process(path); if ((this.metadataSet == null) || (this.metadataSet.MetadataSections.Count == 0)) { throw new MetadataDiscoveryException("There is no metadata available at the specified endpoint"); } // initialize the wsdl importer with the metadata set this.wsdlImporter.InitializeMetadataSet(metadataSet); this.importResult = wsdlImporter.ImportWsdl(); // Call the private methods to build the service definition this.BuildServiceDefinition(); return(this.serviceDefinition); }