void IWsdlExportExtension.ExportEndpoint(WsdlExporter exporter, WsdlEndpointConversionContext endpointContext)
 {
     if (exporter == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("exporter");
     }
     if (endpointContext == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("endpointContext");
     }
     MessageContractExporter.ExportMessageBinding(exporter, endpointContext, typeof(XmlSerializerMessageContractExporter), this.reflector.Operation);
 }
Beispiel #2
0
 void IWsdlExportExtension.ExportEndpoint(WsdlExporter exporter, WsdlEndpointConversionContext endpointContext)
 {
     if (exporter == null)
     {
         throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("exporter");
     }
     if (endpointContext == null)
     {
         throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("endpointContext");
     }
     MessageContractExporter.ExportMessageBinding(exporter, endpointContext, typeof(DataContractSerializerMessageContractExporter), this.operation);
 }
        private void ExportFault(FaultDescription fault, System.ServiceModel.Description.XmlSerializerOperationBehavior.Reflector.OperationReflector operationReflector)
        {
            Message message = new Message {
                Name = base.GetFaultMessageName(fault.Name)
            };
            XmlQualifiedName elementName = this.ExportFaultElement(fault, operationReflector);

            base.contractContext.WsdlPortType.ServiceDescription.Messages.Add(message);
            MessageContractExporter.AddMessagePart(message, "detail", elementName, null);
            OperationFault operationFault = base.contractContext.GetOperationFault(fault);

            WsdlExporter.WSAddressingHelper.AddActionAttribute(fault.Action, operationFault, base.exporter.PolicyVersion);
            operationFault.Message = new XmlQualifiedName(message.Name, message.ServiceDescription.TargetNamespace);
        }
 private void ExportMembersMapping(XmlMembersMapping membersMapping, Message message, bool skipSchemaExport, bool isEncoded, bool isRpc, bool isDocWrapped, bool isHeader)
 {
     if (!skipSchemaExport)
     {
         if (isEncoded)
         {
             this.SoapExporter.ExportMembersMapping(membersMapping);
         }
         else
         {
             this.XmlExporter.ExportMembersMapping(membersMapping, !isRpc);
         }
     }
     if (isDocWrapped)
     {
         if (isHeader)
         {
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Header cannot be Document Wrapped", new object[0])));
         }
         MessageContractExporter.AddMessagePart(message, "parameters", new XmlQualifiedName(membersMapping.XsdElementName, membersMapping.Namespace), XmlQualifiedName.Empty);
     }
     else
     {
         bool flag = !isRpc && !isEncoded;
         for (int i = 0; i < membersMapping.Count; i++)
         {
             XmlMemberMapping mapping  = membersMapping[i];
             string           partName = (isHeader || flag) ? NamingHelper.XmlName(mapping.MemberName) : mapping.XsdElementName;
             if (flag)
             {
                 MessageContractExporter.AddMessagePart(message, partName, new XmlQualifiedName(mapping.XsdElementName, mapping.Namespace), XmlQualifiedName.Empty);
             }
             else
             {
                 if (string.IsNullOrEmpty(mapping.TypeName))
                 {
                     throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(System.ServiceModel.SR.GetString("SFxAnonymousTypeNotSupported", new object[] { message.Name, partName })));
                 }
                 MessageContractExporter.AddMessagePart(message, partName, XmlQualifiedName.Empty, new XmlQualifiedName(mapping.TypeName, mapping.TypeNamespace));
             }
         }
     }
 }