public CreateSequenceResponse(AddressingVersion addressingVersion,
     ReliableMessagingVersion reliableMessagingVersion)
     : base(true)
 {
     this.addressingVersion = addressingVersion;
     this.reliableMessagingVersion = reliableMessagingVersion;
 }
 public CreateSequence(AddressingVersion addressingVersion, ReliableMessagingVersion reliableMessagingVersion, bool ordered, IClientReliableChannelBinder binder, UniqueId offerIdentifier) : base(true)
 {
     this.addressingVersion = addressingVersion;
     this.reliableMessagingVersion = reliableMessagingVersion;
     this.ordered = ordered;
     this.binder = binder;
     this.offerIdentifier = offerIdentifier;
 }
Esempio n. 3
0
 public static ActionHeader Create(XmlDictionaryString dictionaryAction, AddressingVersion addressingVersion)
 {
     if (dictionaryAction == null)
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("action"));
     if (addressingVersion == null)
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("addressingVersion");
     return new DictionaryActionHeader(dictionaryAction, addressingVersion);
 }
 public static FaultToHeader ReadHeader(XmlDictionaryReader reader, AddressingVersion version, string actor, bool mustUnderstand, bool relay)
 {
     EndpointAddress faultTo = ReadHeaderValue(reader, version);
     if (((actor.Length == 0) && !mustUnderstand) && !relay)
     {
         return new FaultToHeader(faultTo, version);
     }
     return new FullFaultToHeader(faultTo, actor, mustUnderstand, relay, version);
 }
 public static string ReadHeaderValue(XmlDictionaryReader reader, AddressingVersion addressingVersion)
 {
     string s = reader.ReadElementContentAsString();
     if ((s.Length <= 0) || ((s[0] > ' ') && (s[s.Length - 1] > ' ')))
     {
         return s;
     }
     return XmlUtil.Trim(s);
 }
 public static ActionHeader ReadHeader(XmlDictionaryReader reader, AddressingVersion version, string actor, bool mustUnderstand, bool relay)
 {
     string action = ReadHeaderValue(reader, version);
     if (((actor.Length == 0) && mustUnderstand) && !relay)
     {
         return new ActionHeader(action, version);
     }
     return new FullActionHeader(action, actor, mustUnderstand, relay, version);
 }
 public static MessageIDHeader ReadHeader(XmlDictionaryReader reader, AddressingVersion version, string actor, bool mustUnderstand, bool relay)
 {
     UniqueId messageId = ReadHeaderValue(reader, version);
     if (((actor.Length == 0) && !mustUnderstand) && !relay)
     {
         return new MessageIDHeader(messageId, version);
     }
     return new FullMessageIDHeader(messageId, actor, mustUnderstand, relay, version);
 }
 public static RelatesToHeader ReadHeader(XmlDictionaryReader reader, AddressingVersion version, string actor, bool mustUnderstand, bool relay)
 {
     System.Xml.UniqueId id;
     Uri uri;
     ReadHeaderValue(reader, version, out uri, out id);
     if (((actor.Length == 0) && !mustUnderstand) && (!relay && (uri == ReplyRelationshipType)))
     {
         return new RelatesToHeader(id, version);
     }
     return new FullRelatesToHeader(id, actor, mustUnderstand, relay, version);
 }
 public static ActionHeader Create(string action, AddressingVersion addressingVersion)
 {
     if (action == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("action"));
     }
     if (addressingVersion == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("addressingVersion");
     }
     return new ActionHeader(action, addressingVersion);
 }
 private static void ApplyAddressingVersion(MessageEncodingBindingElement encodingBindingElement, AddressingVersion addressingVersion)
 {
     EnvelopeVersion envelope = encodingBindingElement.MessageVersion.Envelope;
     if ((envelope == EnvelopeVersion.None) && (addressingVersion != AddressingVersion.None))
     {
         encodingBindingElement.MessageVersion = MessageVersion.CreateVersion(EnvelopeVersion.Soap12, addressingVersion);
     }
     else
     {
         encodingBindingElement.MessageVersion = MessageVersion.CreateVersion(envelope, addressingVersion);
     }
 }
 public static RelatesToHeader Create(System.Xml.UniqueId messageId, AddressingVersion addressingVersion)
 {
     if (object.ReferenceEquals(messageId, null))
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("messageId"));
     }
     if (addressingVersion == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("addressingVersion"));
     }
     return new RelatesToHeader(messageId, addressingVersion);
 }
 public static FaultToHeader Create(EndpointAddress faultTo, AddressingVersion addressingVersion)
 {
     if (faultTo == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("faultTo"));
     }
     if (addressingVersion == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("addressingVersion");
     }
     return new FaultToHeader(faultTo, addressingVersion);
 }
 public static Uri ReadHeaderValue(XmlDictionaryReader reader, AddressingVersion version, UriCache uriCache)
 {
     string uriString = reader.ReadElementContentAsString();
     if (uriString == version.Anonymous)
     {
         return version.AnonymousUri;
     }
     if (uriCache == null)
     {
         return new Uri(uriString);
     }
     return uriCache.CreateUri(uriString);
 }
 private static ActionHeader GetActionHeader(AddressingVersion addressingVersion, ReliableMessagingVersion reliableMessagingVersion, string element)
 {
     WsrmIndex index = null;
     if (reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessagingFebruary2005)
     {
         if (addressingVersion == AddressingVersion.WSAddressingAugust2004)
         {
             if (wsAddressingAug2004WSReliableMessagingFeb2005 == null)
             {
                 wsAddressingAug2004WSReliableMessagingFeb2005 = new WsrmFeb2005Index(addressingVersion);
             }
             index = wsAddressingAug2004WSReliableMessagingFeb2005;
         }
         else if (addressingVersion == AddressingVersion.WSAddressing10)
         {
             if (wsAddressing10WSReliableMessagingFeb2005 == null)
             {
                 wsAddressing10WSReliableMessagingFeb2005 = new WsrmFeb2005Index(addressingVersion);
             }
             index = wsAddressing10WSReliableMessagingFeb2005;
         }
     }
     else
     {
         if (reliableMessagingVersion != ReliableMessagingVersion.WSReliableMessaging11)
         {
             throw Fx.AssertAndThrow("Reliable messaging version not supported.");
         }
         if (addressingVersion == AddressingVersion.WSAddressingAugust2004)
         {
             if (wsAddressingAug2004WSReliableMessaging11 == null)
             {
                 wsAddressingAug2004WSReliableMessaging11 = new Wsrm11Index(addressingVersion);
             }
             index = wsAddressingAug2004WSReliableMessaging11;
         }
         else if (addressingVersion == AddressingVersion.WSAddressing10)
         {
             if (wsAddressing10WSReliableMessaging11 == null)
             {
                 wsAddressing10WSReliableMessaging11 = new Wsrm11Index(addressingVersion);
             }
             index = wsAddressing10WSReliableMessaging11;
         }
     }
     if (index == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ProtocolException(System.ServiceModel.SR.GetString("AddressingVersionNotSupported", new object[] { addressingVersion })));
     }
     return index.GetActionHeader(element);
 }
 public static ToHeader Create(Uri toUri, XmlDictionaryString dictionaryTo, AddressingVersion addressingVersion)
 {
     if (addressingVersion == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("addressingVersion");
     }
     if (toUri != addressingVersion.AnonymousUri)
     {
         return new DictionaryToHeader(toUri, dictionaryTo, addressingVersion);
     }
     if (addressingVersion == AddressingVersion.WSAddressing10)
     {
         return AnonymousTo10;
     }
     return AnonymousTo200408;
 }
 public static ToHeader Create(Uri to, AddressingVersion addressingVersion)
 {
     if (to == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("to"));
     }
     if (to != addressingVersion.AnonymousUri)
     {
         return new ToHeader(to, addressingVersion);
     }
     if (addressingVersion == AddressingVersion.WSAddressing10)
     {
         return AnonymousTo10;
     }
     return AnonymousTo200408;
 }
 public static ToHeader ReadHeader(XmlDictionaryReader reader, AddressingVersion version, UriCache uriCache, string actor, bool mustUnderstand, bool relay)
 {
     Uri to = ReadHeaderValue(reader, version, uriCache);
     if (((actor.Length != 0) || !mustUnderstand) || relay)
     {
         return new FullToHeader(to, actor, mustUnderstand, relay, version);
     }
     if (to != version.Anonymous)
     {
         return new ToHeader(to, version);
     }
     if (version == AddressingVersion.WSAddressing10)
     {
         return AnonymousTo10;
     }
     return AnonymousTo200408;
 }
 public static ReplyToHeader ReadHeader(XmlDictionaryReader reader, AddressingVersion version, string actor, bool mustUnderstand, bool relay)
 {
     EndpointAddress replyTo = ReadHeaderValue(reader, version);
     if (((actor.Length != 0) || mustUnderstand) || relay)
     {
         return new FullReplyToHeader(replyTo, actor, mustUnderstand, relay, version);
     }
     if (replyTo != EndpointAddress.AnonymousAddress)
     {
         return new ReplyToHeader(replyTo, version);
     }
     if (version == AddressingVersion.WSAddressing10)
     {
         return AnonymousReplyTo10;
     }
     return AnonymousReplyTo200408;
 }
 public CallbackContextMessageHeader(EndpointAddress callbackAddress, AddressingVersion version)
 {
     if (callbackAddress == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("callbackAddress");
     }
     if (version == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("version");
     }
     if (version != AddressingVersion.WSAddressing10)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(System.ServiceModel.SR.GetString("CallbackContextOnlySupportedInWSAddressing10", new object[] { version })));
     }
     this.callbackAddress = callbackAddress;
     this.version = version;
 }
Esempio n. 20
0
        private static EndpointAddress ReadFrom(System.ServiceModel.Channels.AddressingVersion addressingVersion, XmlReader xreader)
        {
            string           xml      = xreader.ReadOuterXml();
            StringReader     sreader  = new StringReader(xml);
            XmlReader        reader   = XmlReader.Create(sreader);
            Uri              uri      = null;
            EndpointIdentity identity = null;

            reader.MoveToContent();
            List <AddressHeader> header = new List <AddressHeader> ();

            while (reader.NodeType == XmlNodeType.Element && !reader.IsEmptyElement)
            {
                if (reader.LocalName == "EndpointReference")
                {
                    reader.Read();
                }
                else if (reader.LocalName == "Address" &&
                         reader.NodeType == XmlNodeType.Element &&
                         !reader.IsEmptyElement)
                {
                    uri = new Uri(reader.ReadElementContentAsString());
                }
                else if (reader.LocalName == "Identity" &&
                         reader.NodeType == XmlNodeType.Element &&
                         !reader.IsEmptyElement)
                {
                    //How can key re-empact Identity
                    identity = new X509CertificateEndpointIdentity(new System.Security.Cryptography.X509Certificates.X509Certificate2("powershell.pfx", "mono"));
                    break;
                }
                else
                {
                    var headerName      = reader.LocalName;
                    var headerNamespace = reader.NamespaceURI;
                    reader.MoveToContent();
                    reader.ReadStartElement();
                    var obj = reader.ReadElementContentAs(GetTypeFromLocalName(reader.LocalName), new XmlNamespaceManager(reader.NameTable));
                    header.Add(AddressHeader.CreateAddressHeader(headerName, headerNamespace, obj));
                    reader.MoveToContent();
                    reader.ReadEndElement();
                }
            }
            return(identity == null ? new EndpointAddress(uri, header.ToArray()) : new EndpointAddress(uri, identity, header.ToArray()));
        }
Esempio n. 21
0
		public static MessageVersion CreateVersion (EnvelopeVersion envelope_version,
							    AddressingVersion addressing_version)
		{
			if (envelope_version == EnvelopeVersion.None && addressing_version == AddressingVersion.None)
				return None;
			if (envelope_version == EnvelopeVersion.Soap11 && addressing_version == AddressingVersion.None)
				return Soap11;
			if (envelope_version == EnvelopeVersion.Soap12 && addressing_version == AddressingVersion.WSAddressing10)
				return Soap12WSAddressing10;

			if (envelope_version == EnvelopeVersion.Soap12 && addressing_version == AddressingVersion.None)
				return Soap12;
			if (envelope_version == EnvelopeVersion.Soap11 && addressing_version == AddressingVersion.WSAddressing10)
				return Soap11WSAddressing10;
			if (envelope_version == EnvelopeVersion.Soap11 && addressing_version == AddressingVersion.WSAddressingAugust2004)
				return Soap11WSAddressingAugust2004;
			if (envelope_version == EnvelopeVersion.Soap12 && addressing_version == AddressingVersion.WSAddressingAugust2004)
				return Soap12WSAddressingAugust2004;
			throw new ArgumentException (string.Format ("EnvelopeVersion {0} cannot be used with AddressingVersion {1}", envelope_version, addressing_version));
		}
 internal static string GetAddressingNamespace(AddressingVersion addressing)
 {
     string ns;
     if (addressing == AddressingVersion.WSAddressingAugust2004)
     {
         ns = "http://schemas.xmlsoap.org/ws/2004/08/addressing";
     }
     else if (addressing == AddressingVersion.WSAddressing10)
     {
         ns = "http://www.w3.org/2005/08/addressing";
     }
     else if (addressing == AddressingVersion.None)
     {
         ns = "http://schemas.microsoft.com/ws/2005/05/addressing/none";
     }
     else
     {
         throw FxTrace.Exception.Argument("addressing", SR2.AddressingVersionInvalid(addressing.ToString()));
     }
     return ns;
 }
 public static CreateSequenceResponseInfo Create(AddressingVersion addressingVersion, ReliableMessagingVersion reliableMessagingVersion, XmlDictionaryReader reader)
 {
     CreateSequenceResponseInfo info = new CreateSequenceResponseInfo();
     WsrmFeb2005Dictionary dictionary = XD.WsrmFeb2005Dictionary;
     XmlDictionaryString namespaceUri = WsrmIndex.GetNamespace(reliableMessagingVersion);
     reader.ReadStartElement(dictionary.CreateSequenceResponse, namespaceUri);
     reader.ReadStartElement(dictionary.Identifier, namespaceUri);
     info.Identifier = reader.ReadContentAsUniqueId();
     reader.ReadEndElement();
     if (reader.IsStartElement(dictionary.Expires, namespaceUri))
     {
         reader.ReadElementContentAsTimeSpan();
     }
     if ((reliableMessagingVersion == ReliableMessagingVersion.WSReliableMessaging11) && reader.IsStartElement(DXD.Wsrm11Dictionary.IncompleteSequenceBehavior, namespaceUri))
     {
         string str2 = reader.ReadElementContentAsString();
         if (((str2 != "DiscardEntireSequence") && (str2 != "DiscardFollowingFirstGap")) && (str2 != "NoDiscard"))
         {
             string message = System.ServiceModel.SR.GetString("CSResponseWithInvalidIncompleteSequenceBehavior");
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(message));
         }
     }
     if (reader.IsStartElement(dictionary.Accept, namespaceUri))
     {
         reader.ReadStartElement();
         info.AcceptAcksTo = EndpointAddress.ReadFrom(addressingVersion, reader, dictionary.AcksTo, namespaceUri);
         while (reader.IsStartElement())
         {
             reader.Skip();
         }
         reader.ReadEndElement();
     }
     while (reader.IsStartElement())
     {
         reader.Skip();
     }
     reader.ReadEndElement();
     return info;
 }
 internal static CallbackContextMessageProperty ParseCallbackContextHeader(XmlReader reader, AddressingVersion version)
 {
     CallbackContextMessageProperty property;
     if (reader == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("reader");
     }
     if (version != AddressingVersion.WSAddressing10)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ProtocolException(System.ServiceModel.SR.GetString("CallbackContextOnlySupportedInWSAddressing10", new object[] { version })));
     }
     try
     {
         reader.ReadStartElement("CallbackContext", "http://schemas.microsoft.com/ws/2008/02/context");
         EndpointAddress callbackAddress = EndpointAddress.ReadFrom(version, reader, "CallbackEndpointReference", "http://schemas.microsoft.com/ws/2008/02/context");
         reader.ReadEndElement();
         property = new CallbackContextMessageProperty(callbackAddress);
     }
     catch (XmlException exception)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ProtocolException(System.ServiceModel.SR.GetString("XmlFormatViolationInCallbackContextHeader"), exception));
     }
     return property;
 }
		public void WriteTo (
			AddressingVersion addressingVersion,
			XmlDictionaryWriter writer)
		{
			WriteTo (addressingVersion, writer, "EndpointReference", addressingVersion.Namespace);
		}
Esempio n. 26
0
 protected AddressingHeader(AddressingVersion version)
 {
     _version = version;
 }
Esempio n. 27
0
 MessageVersion(EnvelopeVersion envelope, AddressingVersion addressing)
 {
     this.envelope   = envelope;
     this.addressing = addressing;
 }
Esempio n. 28
0
 public AnonymousToHeader(AddressingVersion version)
     : base(version.AnonymousUri, version)
 {
 }
Esempio n. 29
0
 private MessageVersion(EnvelopeVersion envelopeVersion, AddressingVersion addressingVersion)
 {
     this.envelope   = envelopeVersion;
     this.addressing = addressingVersion;
 }
Esempio n. 30
0
 public FullMessageIDHeader(UniqueId messageId, string actor, bool mustUnderstand, bool relay, AddressingVersion version)
     : base(messageId, version)
 {
     _actor          = actor;
     _mustUnderstand = mustUnderstand;
     _relay          = relay;
 }
Esempio n. 31
0
 internal static void ExportWsdlEndpoint(WsdlExporter exporter, WsdlEndpointConversionContext endpointContext, string wsdlTransportUri, AddressingVersion addressingVersion)
 {
     if (exporter == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context");
     }
     if (endpointContext == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("endpointContext");
     }
     endpointContext.Endpoint.Binding.CreateBindingElements();
     if (wsdlTransportUri != null)
     {
         SoapBinding orCreateSoapBinding = SoapHelper.GetOrCreateSoapBinding(endpointContext, exporter);
         if (orCreateSoapBinding != null)
         {
             orCreateSoapBinding.Transport = wsdlTransportUri;
         }
     }
     if (endpointContext.WsdlPort != null)
     {
         WsdlExporter.WSAddressingHelper.AddAddressToWsdlPort(endpointContext.WsdlPort, endpointContext.Endpoint.Address, addressingVersion);
     }
 }
Esempio n. 32
0
 internal WsrmFeb2005Index(AddressingVersion addressingVersion)
 {
     this.addressingVersion = addressingVersion;
 }
Esempio n. 33
0
 private RelatesToHeader(System.Xml.UniqueId messageId, AddressingVersion version) : base(version)
 {
     this.messageId = messageId;
 }
Esempio n. 34
0
 public FullRelatesToHeader(UniqueId messageId, string actor, bool mustUnderstand, bool relay, AddressingVersion version) : base(messageId, version)
 {
     this.actor          = actor;
     this.mustUnderstand = mustUnderstand;
     this.relay          = relay;
 }
Esempio n. 35
0
 public static MessageVersion CreateVersion(EnvelopeVersion envelope_version,
                                            AddressingVersion addressing_version)
 {
     return(new MessageVersion(envelope_version, addressing_version));
 }
		public void WriteTo (
			AddressingVersion addressingVersion,
			XmlWriter writer, string localname, string ns)
		{
			writer.WriteStartElement (localname, ns);
			WriteContentsTo (addressingVersion, writer);
			writer.WriteEndElement ();
		}
 protected XmlElement CreateWsspSignedEndorsingSupportingTokensAssertion(MetadataExporter exporter, Collection<SecurityTokenParameters> signedEndorsing, Collection<SecurityTokenParameters> optionalSignedEndorsing, AddressingVersion addressingVersion)
 {
     return CreateWsspiSupportingTokensAssertion(exporter, signedEndorsing, optionalSignedEndorsing, addressingVersion, SignedEndorsingSupportingTokensName);
 }
Esempio n. 38
0
 public static UniqueId ReadHeaderValue(XmlDictionaryReader reader, AddressingVersion version)
 {
     Fx.Assert(reader.IsStartElement(XD.AddressingDictionary.MessageId, version.DictionaryNamespace), "");
     return(reader.ReadElementContentAsUniqueId());
 }
Esempio n. 39
0
 public DictionaryToHeader(Uri to, XmlDictionaryString dictionaryTo, AddressingVersion version)
     : base(to, version)
 {
     _dictionaryTo = dictionaryTo;
 }
Esempio n. 40
0
 public FullReplyToHeader(EndpointAddress replyTo, string actor, bool mustUnderstand, bool relay, AddressingVersion version)
     : base(replyTo, version)
 {
     _actor          = actor;
     _mustUnderstand = mustUnderstand;
     _relay          = relay;
 }
 private FaultToHeader(EndpointAddress faultTo, AddressingVersion version) : base(version)
 {
     this.faultTo = faultTo;
 }
Esempio n. 42
0
 protected ToHeader(Uri to, AddressingVersion version)
     : base(version)
 {
     _to = to;
 }
Esempio n. 43
0
 public static Uri ReadHeaderValue(XmlDictionaryReader reader, AddressingVersion version)
 {
     return(ReadHeaderValue(reader, version, null));
 }
 public static EndpointAddress ReadHeaderValue(XmlDictionaryReader reader, AddressingVersion version)
 {
     return(EndpointAddress.ReadFrom(version, reader));
 }
Esempio n. 45
0
 public static EndpointAddress ReadHeaderValue(XmlDictionaryReader reader, AddressingVersion version)
 {
     Fx.Assert(reader.IsStartElement(XD.AddressingDictionary.ReplyTo, version.DictionaryNamespace), "");
     return(EndpointAddress.ReadFrom(version, reader));
 }
 public FullFaultToHeader(EndpointAddress faultTo, string actor, bool mustUnderstand, bool relay, AddressingVersion version) : base(faultTo, version)
 {
     this.actor          = actor;
     this.mustUnderstand = mustUnderstand;
     this.relay          = relay;
 }
        internal static CallbackContextMessageProperty ParseCallbackContextHeader(XmlReader reader, AddressingVersion version)
        {
            CallbackContextMessageProperty property;

            if (reader == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("reader");
            }
            if (version != AddressingVersion.WSAddressing10)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ProtocolException(System.ServiceModel.SR.GetString("CallbackContextOnlySupportedInWSAddressing10", new object[] { version })));
            }
            try
            {
                reader.ReadStartElement("CallbackContext", "http://schemas.microsoft.com/ws/2008/02/context");
                EndpointAddress callbackAddress = EndpointAddress.ReadFrom(version, reader, "CallbackEndpointReference", "http://schemas.microsoft.com/ws/2008/02/context");
                reader.ReadEndElement();
                property = new CallbackContextMessageProperty(callbackAddress);
            }
            catch (XmlException exception)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ProtocolException(System.ServiceModel.SR.GetString("XmlFormatViolationInCallbackContextHeader"), exception));
            }
            return(property);
        }
Esempio n. 48
0
 private ReplyToHeader(EndpointAddress replyTo, AddressingVersion version)
     : base(version)
 {
     _replyTo = replyTo;
 }
Esempio n. 49
0
 public FullFromHeader(EndpointAddress from, string actor, bool mustUnderstand, bool relay, AddressingVersion version)
     : base(from, version)
 {
     _actor          = actor;
     _mustUnderstand = mustUnderstand;
     _relay          = relay;
 }
Esempio n. 50
0
 private ActionHeader(string action, AddressingVersion version) : base(version)
 {
     this.action = action;
 }
Esempio n. 51
0
 private FromHeader(EndpointAddress from, AddressingVersion version)
     : base(version)
 {
     _from = from;
 }
Esempio n. 52
0
 public FullActionHeader(string action, string actor, bool mustUnderstand, bool relay, AddressingVersion version) : base(action, version)
 {
     this.actor          = actor;
     this.mustUnderstand = mustUnderstand;
     this.relay          = relay;
 }
		public void WriteContentsTo (
			AddressingVersion addressingVersion,
			XmlDictionaryWriter writer)
		{
#if NET_2_1
			writer.WriteString (Uri.AbsoluteUri);
#else
			if (addressingVersion == AddressingVersion.WSAddressing10) {
				((IXmlSerializable) EndpointAddress10.FromEndpointAddress (this)).WriteXml (writer);
			} else {
				writer.WriteString (Uri.AbsoluteUri);
			}
#endif
		}
Esempio n. 54
0
 public DictionaryActionHeader(XmlDictionaryString dictionaryAction, AddressingVersion version) : base(dictionaryAction.Value, version)
 {
     this.dictionaryAction = dictionaryAction;
 }
		public void WriteTo (
			AddressingVersion addressingVersion, XmlWriter writer)
		{
			WriteTo (addressingVersion,
				XmlDictionaryWriter.CreateDictionaryWriter (writer));
		}
Esempio n. 56
0
 internal static void WriteStartHeader(XmlDictionaryWriter writer, AddressHeader parameter, AddressingVersion addressingVersion)
 {
     parameter.WriteStartAddressHeader(writer);
     if (addressingVersion == AddressingVersion.WSAddressing10)
     {
         writer.WriteAttributeString(XD.AddressingDictionary.IsReferenceParameter, XD.Addressing10Dictionary.Namespace, "true");
     }
 }
        public virtual Collection<XmlElement> CreateWsspSupportingTokensAssertion(MetadataExporter exporter, Collection<SecurityTokenParameters> signed, Collection<SecurityTokenParameters> signedEncrypted, Collection<SecurityTokenParameters> endorsing, Collection<SecurityTokenParameters> signedEndorsing, Collection<SecurityTokenParameters> optionalSigned, Collection<SecurityTokenParameters> optionalSignedEncrypted, Collection<SecurityTokenParameters> optionalEndorsing, Collection<SecurityTokenParameters> optionalSignedEndorsing, AddressingVersion addressingVersion)
        {
            Collection<XmlElement> supportingTokenAssertions = new Collection<XmlElement>();

            // Signed Supporting Tokens
            XmlElement supportingTokenAssertion = CreateWsspSignedSupportingTokensAssertion(exporter, signed, signedEncrypted, optionalSigned, optionalSignedEncrypted);
            if (supportingTokenAssertion != null)
                supportingTokenAssertions.Add(supportingTokenAssertion);

            // Endorsing Supporting Tokens.
            supportingTokenAssertion = CreateWsspEndorsingSupportingTokensAssertion(exporter, endorsing, optionalEndorsing, addressingVersion);
            if (supportingTokenAssertion != null)
                supportingTokenAssertions.Add(supportingTokenAssertion);

            // Signed Endorsing Supporting Tokens.
            supportingTokenAssertion = CreateWsspSignedEndorsingSupportingTokensAssertion(exporter, signedEndorsing, optionalSignedEndorsing, addressingVersion);
            if (supportingTokenAssertion != null)
                supportingTokenAssertions.Add(supportingTokenAssertion);

            return supportingTokenAssertions;
        }
Esempio n. 58
0
 public FullToHeader(Uri to, string actor, bool mustUnderstand, bool relay, AddressingVersion version)
     : base(to, version)
 {
     _actor          = actor;
     _mustUnderstand = mustUnderstand;
     _relay          = relay;
 }
        protected XmlElement CreateWsspiSupportingTokensAssertion(MetadataExporter exporter, Collection<SecurityTokenParameters> endorsing, Collection<SecurityTokenParameters> optionalEndorsing, AddressingVersion addressingVersion, string assertionName)
        {
            XmlElement result;
            bool hasAssymetricKey = false;

            if ((endorsing == null || endorsing.Count == 0)
                && (optionalEndorsing == null || optionalEndorsing.Count == 0))
            {
                result = null;
            }
            else
            {
                XmlElement policy = CreateWspPolicyWrapper(exporter);

                if (endorsing != null)
                {
                    foreach (SecurityTokenParameters p in endorsing)
                    {
                        if (p.HasAsymmetricKey)
                            hasAssymetricKey = true;

                        policy.AppendChild(CreateTokenAssertion(exporter, p));
                    }
                }
                if (optionalEndorsing != null)
                {
                    foreach (SecurityTokenParameters p in optionalEndorsing)
                    {
                        if (p.HasAsymmetricKey)
                            hasAssymetricKey = true;

                        policy.AppendChild(CreateTokenAssertion(exporter, p, true));
                    }
                }
                if (addressingVersion != null && AddressingVersion.None != addressingVersion)
                {
                    // only add assertion to sign the 'To' only if an assymetric key is found
                    if (hasAssymetricKey)
                    {
                        policy.AppendChild(
                            CreateWsspSignedPartsAssertion(
                                new MessagePartSpecification(new XmlQualifiedName(AddressingStrings.To, addressingVersion.Namespace))));
                    }
                }

                result = CreateWsspAssertion(assertionName);
                result.AppendChild(policy);
            }

            return result;
        }
Esempio n. 60
0
 private RelatesToHeader(UniqueId messageId, AddressingVersion version)
     : base(version)
 {
     _messageId = messageId;
 }