public WsdlTemplateBase GetWsdlTemplate(ServiceOperations operations, string baseUri, bool optimizeForFlash, bool includeAllTypesInAssembly, string rawUrl) { var xsd = new XsdGenerator { OperationTypes = operations.AllOperations.Types, OptimizeForFlash = optimizeForFlash, IncludeAllTypesInAssembly = includeAllTypesInAssembly, }.ToString(); var wsdlTemplate = GetWsdlTemplate(); wsdlTemplate.Xsd = xsd; wsdlTemplate.ReplyOperationNames = operations.ReplyOperations.Names; wsdlTemplate.OneWayOperationNames = operations.OneWayOperations.Names; if (rawUrl.ToLower().Contains("servicestack")) { //var qsPos = rawUrl.IndexOf('?'); //var urlWithoutQueryString = qsPos != -1 ? rawUrl.Substring(0, qsPos) : rawUrl; wsdlTemplate.ReplyEndpointUri = rawUrl; wsdlTemplate.OneWayEndpointUri = rawUrl; } else { wsdlTemplate.ReplyEndpointUri = baseUri + "SyncReply.svc"; wsdlTemplate.OneWayEndpointUri = baseUri + "AsyncOneWay.svc"; } return wsdlTemplate; }
public void Wsdl_state_is_correct() { var serviceOperations = new ServiceOperations(base.AllOperations); var wsdlGenerator = new Soap11WsdlMetadataHandler(); var wsdlTemplate = wsdlGenerator.GetWsdlTemplate(serviceOperations, "http://w3c.org/types", false, false, "http://w3c.org/types"); Assert.That(wsdlTemplate.ReplyOperationNames, Is.EquivalentTo(serviceOperations.ReplyOperations.Names)); Assert.That(wsdlTemplate.OneWayOperationNames, Is.EquivalentTo(serviceOperations.OneWayOperations.Names)); }