internal override MimeReturn ImportReturn() {
     if (ImportContext.OperationBinding.Output.Extensions.Count == 0) return null;
     MimeReturn importedReturn = new MimeReturn();
     importedReturn.TypeName = typeof(Stream).FullName;
     importedReturn.ReaderType = typeof(AnyReturnReader);
     return importedReturn;
 }
 internal override void GenerateCode(MimeReturn[] importedReturns, MimeParameterCollection[] importedParameters) { 
     for (int i = 0; i < importedReturns.Length; i++) {
         if (importedReturns[i] is MimeTextReturn) {  
             GenerateCode((MimeTextReturn)importedReturns[i], ImportContext.ServiceImporter.CodeGenerationOptions);
         }
     }
 }
Beispiel #3
0
        internal override MimeReturn ImportReturn()
        {
            if (ImportContext.OperationBinding.Output.Extensions.Count == 0)
            {
                return(null);
            }
            MimeReturn importedReturn = new MimeReturn();

            importedReturn.TypeName   = typeof(Stream).FullName;
            importedReturn.ReaderType = typeof(AnyReturnReader);
            return(importedReturn);
        }
Beispiel #4
0
        internal override MimeReturn ImportReturn()
        {
            MimeContentBinding mimeContentBinding = (MimeContentBinding)ImportContext.OperationBinding.Output.Extensions.Find(typeof(MimeContentBinding));

            if (mimeContentBinding != null)
            {
                if (!ContentType.MatchesBase(mimeContentBinding.Type, ContentType.TextXml))
                {
                    return(null);
                }
                MimeReturn importedReturn = new MimeReturn();
                importedReturn.TypeName   = typeof(XmlElement).FullName;
                importedReturn.ReaderType = typeof(XmlReturnReader);
                return(importedReturn);
            }

            MimeXmlBinding mimeXmlBinding = (MimeXmlBinding)ImportContext.OperationBinding.Output.Extensions.Find(typeof(MimeXmlBinding));

            if (mimeXmlBinding != null)
            {
                MimeXmlReturn importedReturn = new MimeXmlReturn();
                MessagePart   part;
                switch (ImportContext.OutputMessage.Parts.Count)
                {
                case 0:
                    throw new InvalidOperationException(Res.GetString(Res.MessageHasNoParts1, ImportContext.InputMessage.Name));

                case 1:
                    if (mimeXmlBinding.Part == null || mimeXmlBinding.Part.Length == 0)
                    {
                        part = ImportContext.OutputMessage.Parts[0];
                    }
                    else
                    {
                        part = ImportContext.OutputMessage.FindPartByName(mimeXmlBinding.Part);
                    }
                    break;

                default:
                    part = ImportContext.OutputMessage.FindPartByName(mimeXmlBinding.Part);
                    break;
                }
                importedReturn.TypeMapping = Importer.ImportTypeMapping(part.Element);
                importedReturn.TypeName    = importedReturn.TypeMapping.TypeFullName;
                importedReturn.ReaderType  = typeof(XmlReturnReader);
                Exporter.AddMappingMetadata(importedReturn.Attributes, importedReturn.TypeMapping, string.Empty);
                return(importedReturn);
            }
            return(null);
        }
 MimeReturn ImportMimeReturn() {
     MimeReturn importedReturn;
     if (OperationBinding.Output.Extensions.Count == 0) {
         importedReturn = new MimeReturn();
         importedReturn.TypeName = typeof(void).FullName;
         return importedReturn;
     }
     for (int i = 0; i < importers.Length; i++) {
         importedReturn = importers[i].ImportReturn();
         if (importedReturn != null) {
             this.importedReturns[i].Add(importedReturn);
             return importedReturn;
         }
     }
     return null;
 }
 private MimeReturn ImportMimeReturn()
 {
     if (base.OperationBinding.Output.Extensions.Count == 0)
     {
         return(new MimeReturn {
             TypeName = typeof(void).FullName
         });
     }
     for (int i = 0; i < this.importers.Length; i++)
     {
         MimeReturn return2 = this.importers[i].ImportReturn();
         if (return2 != null)
         {
             this.importedReturns[i].Add(return2);
             return(return2);
         }
     }
     return(null);
 }
Beispiel #7
0
        MimeReturn ImportMimeReturn()
        {
            MimeReturn importedReturn;

            if (OperationBinding.Output.Extensions.Count == 0)
            {
                importedReturn          = new MimeReturn();
                importedReturn.TypeName = typeof(void).FullName;
                return(importedReturn);
            }
            for (int i = 0; i < importers.Length; i++)
            {
                importedReturn = importers[i].ImportReturn();
                if (importedReturn != null)
                {
                    this.importedReturns[i].Add(importedReturn);
                    return(importedReturn);
                }
            }
            return(null);
        }
 internal override MimeReturn ImportReturn() {
     MimeContentBinding mimeContentBinding = (MimeContentBinding)ImportContext.OperationBinding.Output.Extensions.Find(typeof(MimeContentBinding));
     if (mimeContentBinding != null) {
         if (!ContentType.MatchesBase(mimeContentBinding.Type, ContentType.TextXml)) {
              return null;
         }
         MimeReturn importedReturn = new MimeReturn();
         importedReturn.TypeName = typeof(XmlElement).FullName;
         importedReturn.ReaderType = typeof(XmlReturnReader);
         return importedReturn;
     }
     
     MimeXmlBinding mimeXmlBinding = (MimeXmlBinding)ImportContext.OperationBinding.Output.Extensions.Find(typeof(MimeXmlBinding));
     if (mimeXmlBinding != null) {
         MimeXmlReturn importedReturn = new MimeXmlReturn();
         MessagePart part;
         switch (ImportContext.OutputMessage.Parts.Count) {
             case 0: 
                 throw new InvalidOperationException(Res.GetString(Res.MessageHasNoParts1, ImportContext.InputMessage.Name));
             case 1: 
                 if (mimeXmlBinding.Part == null || mimeXmlBinding.Part.Length == 0) {
                     part = ImportContext.OutputMessage.Parts[0];
                 }
                 else {
                     part = ImportContext.OutputMessage.FindPartByName(mimeXmlBinding.Part);
                 }
                 break;
             default:
                 part = ImportContext.OutputMessage.FindPartByName(mimeXmlBinding.Part);
                 break;
         }
         importedReturn.TypeMapping = Importer.ImportTypeMapping(part.Element);
         importedReturn.TypeName = importedReturn.TypeMapping.TypeFullName;
         importedReturn.ReaderType = typeof(XmlReturnReader);
         Exporter.AddMappingMetadata(importedReturn.Attributes, importedReturn.TypeMapping, string.Empty);
         return importedReturn;
     }
     return null;
 }
 internal virtual void GenerateCode(MimeReturn[] importedReturns, MimeParameterCollection[] importedParameters) {
 }
 internal override void GenerateCode(MimeReturn[] importedReturns, MimeParameterCollection[] importedParameters) { 
     for (int i = 0; i < importedReturns.Length; i++) {
         if (importedReturns[i] is MimeXmlReturn) {
             GenerateCode((MimeXmlReturn)importedReturns[i]);
         }
     }
 }