title: Error in deserializing body of reply message for operation
body: <p>I'm writing console WCF-client for one WCF-WebService. When calling the service I get an error in deserializing body of request:</p>
  
  <blockquote>
    <p>Error in deserializing body of reply message for operation 'GetProfiles'</p>
  </blockquote>
  
  <p>Agent Code:</p>
  
  <pre><code>string  userLogin = "root", userPassword = "root";
  string ipaddress = "192.168.137.164";
  
  HttpTransportBindingElement httpTransportBindingElement = new    HttpTransportBindingElement();
  httpTransportBindingElement.AuthenticationScheme = AuthenticationSchemes.Digest;
  httpTransportBindingElement.KeepAliveEnabled = false;
  httpTransportBindingElement.MaxBufferSize = int.MaxValue;
  httpTransportBindingElement.MaxBufferPoolSize = int.MaxValue;
  httpTransportBindingElement.MaxReceivedMessageSize = int.MaxValue;
  
  TextMessageEncodingBindingElement textMessageEncodingBindingElement = new TextMessageEncodingBindingElement();
  textMessageEncodingBindingElement.MaxReadPoolSize = int.MaxValue;
  textMessageEncodingBindingElement.MaxWritePoolSize = int.MaxValue;
  textMessageEncodingBindingElement.ReaderQuotas.MaxDepth = 64;
  textMessageEncodingBindingElement.ReaderQuotas.MaxBytesPerRead = int.MaxValue;
  textMessageEncodingBindingElement.ReaderQuotas.MaxArrayLength = int.MaxValue;
  textMessageEncodingBindingElement.ReaderQuotas.MaxNameTableCharCount = int.MaxValue;
  textMessageEncodingBindingElement.ReaderQuotas.MaxStringContentLength = int.MaxValue;
  
  
  CustomBinding binding = new CustomBinding(textMessageEncodingBindingElement, httpTransportBindingElement);
  
  EndpointAddress MediaEndPointAddress = new EndpointAddress("http://" + ipaddress + ":80/onvif/services");
  
  MediaClient mediaClient = new MediaClient(binding, MediaEndPointAddress);
  mediaClient.ClientCredentials.UserName.UserName = userLogin;
  mediaClient.ClientCredentials.UserName.Password = userPassword;
  
  Profile[] profiles = mediaClient.GetProfiles(); // throw excpetion
  </code></pre>
  
  <p>I have already watched the requests and responses with a sniffer and it's OK! The WebService has sent '200 OK'. If I have a small response from the WebService, there won't be any errors and exceptions! I haven't got WebService code. What should I do?</p>
  
  <p>Stack trace:</p>
  
  <pre><code>&lt;E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"&gt;
  &lt;System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"&gt;
  &lt;EventID&gt;131075&lt;/EventID&gt;
  &lt;Type&gt;3&lt;/Type&gt;
  &lt;SubType Name="Error"&gt;0&lt;/SubType&gt;
  &lt;Level&gt;2&lt;/Level&gt;
  &lt;TimeCreated SystemTime="2012-01-11T11:11:12.2185609Z" /&gt;
  &lt;Source Name="System.ServiceModel" /&gt;
  &lt;Correlation ActivityID="{550193ea-8569-40e6-b794-1a0eed69a1ba}" /&gt;
  &lt;Execution ProcessName="TestingConsole.vshost" ProcessID="6128" ThreadID="9" /&gt;
  &lt;Channel /&gt;
  &lt;Computer&gt;WS-LSH&lt;/Computer&gt;
  &lt;/System&gt;
  &lt;ApplicationData&gt;
  &lt;TraceData&gt;
  &lt;DataItem&gt;
  &lt;TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord"    Severity="Error"&gt;
  &lt;TraceIdentifier&gt;http://msdn.microsoft.com/ru-RU/library/System.ServiceModel.Diagnostics.ThrowingException.aspx&lt;/TraceIdentifier&gt;
  &lt;Description&gt;Throwing an exception.&lt;/Description&gt;
  &lt;AppDomain&gt;TestingConsole.vshost.exe&lt;/AppDomain&gt;
  &lt;Exception&gt;
  &lt;ExceptionType&gt;System.ServiceModel.CommunicationException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&lt;/ExceptionType&gt;
  &lt;Message&gt;Error in deserializing body of reply message for operation 'GetProfiles'.    &lt;/Message&gt;
  &lt;StackTrace&gt;
  at System.ServiceModel.Dispatcher.XmlSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, XmlSerializer serializer, MessagePartDescription returnPart, MessagePartDescriptionCollection bodyParts, Object[] parameters, Boolean isRequest)
  at System.ServiceModel.Dispatcher.XmlSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, String action, MessageDescription messageDescription, Object[] parameters, Boolean isRequest)
  at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest)
  at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeReply(Message message, Object[] parameters)
  at System.ServiceModel.Dispatcher.ProxyOperationRuntime.AfterReply(ProxyRpc&amp;amp; rpc)
  at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc&amp;amp; rpc)
  at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
  at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
  at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
  at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp;amp; msgData, Int32 type)
  at TestingConsole.Onvif.Media.Media.GetProfiles(GetProfilesRequest request)
  at TestingConsole.Onvif.Media.MediaClient.TestingConsole.Onvif.Media.Media.GetProfiles(GetProfilesRequest request)
  at TestingConsole.Onvif.Media.MediaClient.GetProfiles()
  at TestingConsole.Program.Main(String[] args)
  at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
  at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
  at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
  at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
  at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
  at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
  at System.Threading.ThreadHelper.ThreadStart()
  &lt;/StackTrace&gt;
  &lt;ExceptionString&gt;System.ServiceModel.CommunicationException: Error in deserializing body of reply message for operation 'GetProfiles'. ---&amp;gt; System.InvalidOperationException: There is an error in XML document (2, 6287). ---&amp;gt; System.Xml.XmlException: The byte 0x03 is not valid at this location.  Line 2, position 6287.
      at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, String res, String arg1, String arg2, String arg3)
     at System.Xml.XmlExceptionHelper.ThrowInvalidXml(XmlDictionaryReader reader, Byte b)
     at System.Xml.XmlUTF8TextReader.Read()
     at System.Xml.XmlDictionaryReader.ReadString(Int32 maxStringContentLength)
     at System.Xml.XmlDictionaryReader.ReadString()
     at System.Xml.XmlBaseReader.ReadElementString()
     at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderMedia.Read59_VideoSourceConfiguration(Boolean isNullable, Boolean checkType)
     at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderMedia.Read150_Profile(Boolean isNullable, Boolean checkType)
     at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderMedia.Read224_GetProfilesResponse()
     at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer73.Deserialize(XmlSerializationReader reader)
     at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
     --- End of inner exception stack trace ---
     at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
     at System.ServiceModel.Dispatcher.XmlSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, XmlSerializer serializer, MessagePartDescription returnPart, MessagePartDescriptionCollection bodyParts, Object[] parameters, Boolean isRequest)
     --- End of inner exception stack trace ---&lt;/ExceptionString&gt;
  &lt;InnerException&gt;
  &lt;ExceptionType&gt;System.InvalidOperationException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&lt;/ExceptionType&gt;
  &lt;Message&gt;There is an error in XML document (2, 6287).&lt;/Message&gt;
  &lt;StackTrace&gt;
  at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
  at     System.ServiceModel.Dispatcher.XmlSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, XmlSerializer serializer, MessagePartDescription returnPart, MessagePartDescriptionCollection bodyParts, Object[] parameters, Boolean isRequest)
  &lt;/StackTrace&gt;
  &lt;ExceptionString&gt;System.InvalidOperationException: There is an error in XML document (2, 6287). ---&amp;gt; System.Xml.XmlException: The byte 0x03 is not valid at this location.  Line 2, position 6287.
     at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, String res, String arg1, String arg2, String arg3)
     at System.Xml.XmlExceptionHelper.ThrowInvalidXml(XmlDictionaryReader reader, Byte b)
     at System.Xml.XmlUTF8TextReader.Read()
     at System.Xml.XmlDictionaryReader.ReadString(Int32 maxStringContentLength)
     at System.Xml.XmlDictionaryReader.ReadString()
     at System.Xml.XmlBaseReader.ReadElementString()
     at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderMedia.Read59_VideoSourceConfiguration(Boolean isNullable, Boolean checkType)
     at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderMedia.Read150_Profile(Boolean isNullable, Boolean checkType)
     at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderMedia.Read224_GetProfilesResponse()
     at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer73.Deserialize(XmlSerializationReader reader)
     at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
     --- End of inner exception stack trace ---
     at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
     at System.ServiceModel.Dispatcher.XmlSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, XmlSerializer serializer, MessagePartDescription returnPart, MessagePartDescriptionCollection bodyParts, Object[] parameters, Boolean isRequest)&lt;/ExceptionString&gt;
  &lt;InnerException&gt;
  &lt;ExceptionType&gt;System.Xml.XmlException, System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&lt;/ExceptionType&gt;
  &lt;Message&gt;The byte 0x03 is not valid at this location.  Line 2, position 6287.&lt;/Message&gt;
  &lt;StackTrace&gt;
  at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, String     res, String arg1, String arg2, String arg3)
  at System.Xml.XmlExceptionHelper.ThrowInvalidXml(XmlDictionaryReader reader, Byte b)
  at System.Xml.XmlUTF8TextReader.Read()
  at System.Xml.XmlDictionaryReader.ReadString(Int32 maxStringContentLength)
  at System.Xml.XmlDictionaryReader.ReadString()
  at System.Xml.XmlBaseReader.ReadElementString()
  at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderMedia.Read59_VideoSourceConfiguration(Boolean isNullable, Boolean checkType)
  at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderMedia.Read150_Profile(Boolean isNullable, Boolean checkType)
  at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderMedia.Read224_GetProfilesResponse()
  at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer73.Deserialize(XmlSerializationReader reader)
  at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
  &lt;/StackTrace&gt;
  &lt;ExceptionString&gt;System.Xml.XmlException: The byte 0x03 is not valid at this location.  Line 2, position 6287.
     at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, String res, String arg1, String arg2, String arg3)
     at System.Xml.XmlExceptionHelper.ThrowInvalidXml(XmlDictionaryReader reader, Byte b)
     at System.Xml.XmlUTF8TextReader.Read()
     at System.Xml.XmlDictionaryReader.ReadString(Int32 maxStringContentLength)
     at System.Xml.XmlDictionaryReader.ReadString()
     at System.Xml.XmlBaseReader.ReadElementString()
     at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderMedia.Read59_VideoSourceConfiguration(Boolean isNullable, Boolean checkType)
     at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderMedia.Read150_Profile(Boolean isNullable, Boolean checkType)
     at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderMedia.Read224_GetProfilesResponse()
     at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer73.Deserialize(XmlSerializationReader reader)
     at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)&lt;/ExceptionString&gt;
  &lt;/InnerException&gt;
  &lt;/InnerException&gt;
  &lt;/Exception&gt;
  &lt;/TraceRecord&gt;
  &lt;/DataItem&gt;
  &lt;/TraceData&gt;
  &lt;/ApplicationData&gt;
  </code></pre>
  
  <p>I rewrite my code. Now I have got:</p>
  
  <pre><code>    string soapRequest = "&lt;s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\"&gt;" +
                                   "&lt;s:Header&gt;" +
                                   "&lt;/s:Header&gt;" +
                                   "&lt;s:Body xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"&gt;" +
                                   "&lt;GetProfiles xmlns=\"http://www.onvif.org/ver10/media/wsdl\"/&gt;" +
                                   "&lt;/s:Body&gt;" +
                                   "&lt;/s:Envelope&gt;";
  
  
  XmlReader envelopeReader = XmlReader.Create(new StringReader(soapRequest));
  
  Message requestMsg = Message.CreateMessage(envelopeReader, int.MaxValue, MessageVersion.Soap12);
  
  Message responseMsg = null;
  
  IChannelFactory&lt;IRequestChannel&gt; channelFactory = binding.BuildChannelFactory&lt;IRequestChannel&gt;();
  channelFactory.Open();
  
  IRequestChannel channel = channelFactory.CreateChannel(MediaEndPointAddress);
  channel.Open();
  
  responseMsg = channel.Request(requestMsg);
  Console.WriteLine(responseMsg.ToString());
  </code></pre>
  
  <p>The last string return message "Error reading body: System.Xml.XmlException: '�' contains invalid UTF8 bytes. ...}".</p>
  
  <p>WebService sends non-ut8 bytes, but points "UTF-8" in header.
  What can I do?</p>
  
  <p>Reply Message Body</p>
  
  <pre><code>HTTP/1.1 200 OK
  Server: gSOAP/2.7
  Content-Type: application/soap+xml; charset=utf-8
  Content-Length: 11591
  Connection: close
  
  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
              &lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"                         xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding"                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"                       xmlns:xsd="http://www.w3.org/2001/XMLSchema"                        xmlns:wsa5="http://www.w3.org/2005/08/addressing"                       xmlns:xmime5="http://www.w3.org/2005/05/xmlmime"                        xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"                        xmlns:ter="http://www.onvif.org/ver10/error"                        xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"                      xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"                      xmlns:c14n="http://www.w3.org/2001/10/xml-exc-c14n#"                        xmlns:ds="http://www.w3.org/2000/09/xmldsig#"                       xmlns:tns1="http://www.onvif.org/ver10/topics"                      xmlns:ns1="http://www.onvif.org/ver20/analytics/wsdl"                       xmlns:ns2="http://www.onvif.org/ver10/schema"                       xmlns:ns3="http://docs.oasis-open.org/wsn/b-2"                      xmlns:ns4="http://docs.oasis-open.org/wsrf/bf-2"                        xmlns:ns5="http://docs.oasis-open.org/wsn/t-1"                      xmlns:ns6="http://www.onvif.org/ver10/device/wsdl"                      xmlns:ns7="http://www.onvif.org/ver10/events/wsdl"                      xmlns:ns9="http://docs.oasis-open.org/wsrf/r-2"                         xmlns:ns10="http://www.onvif.org/ver10/imaging/wsdl"                        xmlns:ns11="http://www.onvif.org/ver10/media/wsdl"                      xmlns:ns12="http://www.onvif.org/ver20/ptz/wsdl"                        xmlns:ns13="http://www.onvif.org/ver10/network/wsdl/"                       xmlns:ns14="http://schemas.xmlsoap.org/ws/2005/04/discovery"                        xmlns:ns16="http://www.onvif.org/ver10/analytics/wsdl/RuleEngineBinding"                        xmlns:ns17="http://www.onvif.org/ver10/analytics/wsdl/AnalyticsEngineBinding"                       xmlns:ns18="http://www.onvif.org/ver10/events/wsdl/PullPointSubscriptionBinding"                        xmlns:ns19="http://www.onvif.org/ver10/events/wsdl/EventBinding"                        xmlns:ns20="http://www.onvif.org/ver10/events/wsdl/SubscriptionManagerBinding"                      xmlns:ns21="http://www.onvif.org/ver10/events/wsdl/NotificationProducerBinding"                         xmlns:ns22="http://www.onvif.org/ver10/events/wsdl/NotificationConsumerBinding"                         xmlns:ns23="http://www.onvif.org/ver10/events/wsdl/PullPointBinding"                        xmlns:ns24="http://www.onvif.org/ver10/events/wsdl/CreatePullPointBinding"                      xmlns:ns25="http://www.onvif.org/ver10/events/wsdl/PausableSubscriptionManagerBinding"                      xmlns:ns26="http://www.onvif.org/ver10/network/wsdl/RemoteDiscoveryBinding"                         xmlns:ns27="http://www.onvif.org/ver10/network/wsdl/DiscoveryLookupBinding"                         xmlns:ns28="http://www.onvif.org/ver10/events/wsdl/EventPortType"                       xmlns:ns29="http://www.3svision.com.tw/2009/event/topics"&gt;                      &lt;SOAP-ENV:Header&gt;&lt;/SOAP-ENV:Header&gt;&lt;SOAP-ENV:Body&gt;&lt;ns11:GetProfilesResponse&gt;&lt;ns11:Profiles token="Main_h264" fixed="true"&gt;&lt;ns2:Name&gt;Main h264&lt;/ns2:Name&gt;&lt;ns2:VideoSourceConfiguration token="0"&gt;&lt;ns2:Name&gt;user0&lt;/ns2:Name&gt;&lt;ns2:UseCount&gt;0&lt;/ns2:UseCount&gt;&lt;ns2:SourceToken&gt;0&lt;/ns2:SourceToken&gt;&lt;Bounds xmlns="http://www.onvif.org/ver10/schema" height="720" width="1280" y="0" x="0"&gt;&lt;/Bounds&gt;&lt;/ns2:VideoSourceConfiguration&gt;&lt;ns2:AudioSourceConfiguration token="0"&gt;&lt;ns2:Name&gt;user0&lt;/ns2:Name&gt;&lt;ns2:UseCount&gt;0&lt;/ns2:UseCount&gt;&lt;ns2:SourceToken&gt;0&lt;/ns2:SourceToken&gt;&lt;/ns2:AudioSourceConfiguration&gt;&lt;ns2:VideoEncoderConfiguration token="Main_h264"&gt;&lt;ns2:Name&gt;Main h264&lt;/ns2:Name&gt;&lt;ns2:UseCount&gt;0&lt;/ns2:UseCount&gt;&lt;ns2:Encoding&gt;H264&lt;/ns2:Encoding&gt;&lt;ns2:Resolution&gt;&lt;ns2:Width&gt;1280&lt;/ns2:Width&gt;&lt;ns2:Height&gt;720&lt;/ns2:Height&gt;&lt;/ns2:Resolution&gt;&lt;ns2:Quality&gt;60&lt;/ns2:Quality&gt;&lt;ns2:RateControl&gt;&lt;ns2:FrameRateLimit&gt;30&lt;/ns2:FrameRateLimit&gt;&lt;ns2:EncodingInterval&gt;15&lt;/ns2:EncodingInterval&gt;&lt;ns2:BitrateLimit&gt;3072&lt;/ns2:BitrateLimit&gt;&lt;/ns2:RateControl&gt;&lt;ns2:H264&gt;&lt;ns2:GovLength&gt;0&lt;/ns2:GovLength&gt;&lt;ns2:H264Profile&gt;Baseline&lt;/ns2:H264Profile&gt;&lt;/ns2:H264&gt;&lt;ns2:Multicast&gt;&lt;ns2:Address&gt;&lt;ns2:Type&gt;IPv4&lt;/ns2:Type&gt;&lt;ns2:IPv4Address&gt;0.0.0.0&lt;/ns2:IPv4Address&gt;&lt;/ns2:Address&gt;&lt;ns2:Port&gt;0&lt;/ns2:Port&gt;&lt;ns2:TTL&gt;5&lt;/ns2:TTL&gt;&lt;ns2:AutoStart&gt;false&lt;/ns2:AutoStart&gt;&lt;/ns2:Multicast&gt;&lt;ns2:SessionTimeout&gt;PT0S&lt;/ns2:SessionTimeout&gt;&lt;/ns2:VideoEncoderConfiguration&gt;&lt;ns2:AudioEncoderConfiguration token="0"&gt;&lt;ns2:Name&gt;user0&lt;/ns2:Name&gt;&lt;ns2:UseCount&gt;0&lt;/ns2:UseCount&gt;&lt;ns2:Encoding&gt;G7Ю11&lt;/ns2:Encoding&gt;&lt;ns2:Bitrate&gt;64000&lt;/ns2:Bitrate&gt;&lt;ns2:SampleRate&gt;8000&lt;/ns2:SampleRate&gt;&lt;ns2:Multicast&gt;&lt;ns2:Address&gt;&lt;ns2:Type&gt;IPv4&lt;/ns2:Type&gt;&lt;ns2:IPv4Address&gt;0.0.0.0&lt;/ns2:IPv4Address&gt;&lt;/ns2:Address&gt;&lt;ns2:Port&gt;0&lt;/ns2:Port&gt;&lt;ns2:TTL&gt;5&lt;/ns2:TTL&gt;&lt;ns2:AutoStart&gt;false&lt;/ns2:AutoStart&gt;&lt;/ns2:Multicast&gt;&lt;ns2:SessionTimeout&gt;PT0S&lt;/ns2:SessionTimeout&gt;&lt;/ns2:AudioEncoderConfiguration&gt;&lt;/ns11:Profiles&gt;&lt;ns11:Profiles token="Sub_h264" fixed="true"&gt;&lt;ns2:Name&gt;Sub h264&lt;/ns2:Name&gt;&lt;ns2:VideoSourceConfiguration token="1"&gt;&lt;ns2:Name&gt;user1&lt;/ns2:Name&gt;&lt;ns2:UseCount&gt;0&lt;/ns2:UseCount&gt;&lt;ns2:SourceToken&gt;0&lt;/ns2:SourceToken&gt;&lt;Bounds xmlns="http://www.onvif.org/ver10/schema" height="720" width="1280" y="0" x="0"&gt;&lt;/Bounds&gt;&lt;/ns2:VideoSourceConfiguration&gt;&lt;ns2:AudioSourceConfiguration token="0"&gt;&lt;ns2:Name&gt;user0&lt;/ns2:Name&gt;&lt;ns2:UseCount&gt;0&lt;/ns2:UseCount&gt;&lt;ns2:SourceToken&gt;0&lt;/ns2:SourceToken&gt;&lt;/ns2:AudioSourceConfiguration&gt;&lt;ns2:VideoEncoderConfiguration token="Sub_h264"&gt;&lt;ns2:Name&gt;Sub h264&lt;/ns2:Name&gt;&lt;ns2:UseCount&gt;0&lt;/ns2:UseCount&gt;&lt;ns2:Encoding&gt;H264&lt;/ns2:Encoding&gt;&lt;ns2:Resolution&gt;&lt;ns2:Width&gt;640&lt;/ns2:Width&gt;&lt;ns2:Height&gt;352&lt;/ns2:Height&gt;&lt;/ns2:Resolution&gt;&lt;ns2:Quality&gt;70&lt;/ns2:Quality&gt;&lt;ns2:RateControl&gt;&lt;ns2:FrameRateLimit&gt;30&lt;/ns2:FrameRateLimit&gt;&lt;ns2:EncodingInterval&gt;15&lt;/ns2:EncodingInterval&gt;&lt;ns2:BitrateLimit&gt;3072&lt;/ns2:BitrateLimit&gt;&lt;/ns2:RateControl&gt;&lt;ns2:H264&gt;&lt;ns2:GovLength&gt;0&lt;/ns2:GovLength&gt;&lt;ns2:H264Profile&gt;Baseline&lt;/ns2:H264Profile&gt;&lt;/ns2:H264&gt;&lt;ns2:Multicast&gt;&lt;ns2:Address&gt;&lt;ns2:Type&gt;IPv4&lt;/ns2:Type&gt;&lt;ns2:IPv4Address&gt;0.0.0.0&lt;/ns2:IPv4Address&gt;&lt;/ns2:Address&gt;&lt;ns2:Port&gt;0&lt;/ns2:Port&gt;&lt;ns2:TTL&gt;5&lt;/ns2:TTL&gt;&lt;ns2:AutoStart&gt;false&lt;/ns2:AutoStart&gt;&lt;/ns2:Multicast&gt;&lt;ns2:SessionTimeout&gt;PT0S&lt;/ns2:SessionTimeout&gt;&lt;/ns2:VideoEncoderConfiguration&gt;&lt;ns2:AudioEncoderConfiguration token="0"&gt;&lt;ns2:Name&gt;user0&lt;/ns2:Name&gt;&lt;ns2:UseCount&gt;0&lt;/ns2:UseCount&gt;&lt;ns2:Encoding&gt;G711&lt;/ns2:Encoding&gt;&lt;ns2:Bitrate&gt;64000&lt;/ns2:Bitrate&gt;&lt;ns2:SampleRate&gt;8000&lt;/ns2:SampleRate&gt;&lt;ns2:Multicast&gt;&lt;ns2:Address&gt;&lt;ns2:Type&gt;IPv4&lt;/ns2:Type&gt;&lt;ns2:IPv4Address&gt;0.0.0.0&lt;/ns2:IPv4Address&gt;&lt;/ns2:Address&gt;&lt;ns2:Port&gt;0&lt;/ns2:Port&gt;&lt;ns2:TTL&gt;5&lt;/ns2:TTL&gt;&lt;ns2:AutoStart&gt;false&lt;/ns2:AutoStart&gt;&lt;/ns2:Multicast&gt;&lt;ns2:SessionTimeout&gt;PT0S&lt;/ns2:SessionTimeout&gt;&lt;/ns2:AudioEncoderConfiguration&gt;&lt;/ns11:Profiles&gt;&lt;ns11:Profiles token="Motion_jpeg" fixed="true"&gt;&lt;ns2:Name&gt;Motion jpeg&lt;/ns2:Name&gt;&lt;ns2:VideoSourceConfiguration token="2"&gt;&lt;ns2:Name&gt;user2&lt;/ns2:Name&gt;&lt;ns2:UseCount&gt;0&lt;/ns2:UseCount&gt;&lt;ns2:SourceToken&gt;0&lt;/ns2:SourceToken&gt;&lt;Bounds xmlns="http://www.onvif.org/ver10/schema" height="720" width="1280" y="0" x="0"&gt;&lt;/Bounds&gt;&lt;/ns2:VideoSourceConfiguration&gt;&lt;ns2:AudioSourceConfiguration token="0"&gt;&lt;ns2:Name&gt;user0&lt;/ns2:Name&gt;&lt;ns2:UseCount&gt;0&lt;/ns2:UseCount&gt;&lt;ns2:SourceToken&gt;0&lt;/ns2:SourceToken&gt;&lt;/ns2:AudioSourceConfiguration&gt;&lt;ns2:VideoEncoderConfiguration token="Motion_jpeg"&gt;&lt;ns2:Name&gt;Motion jpeg&lt;/ns2:Name&gt;&lt;ns2:UseCount&gt;0&lt;/ns2:UseCount&gt;&lt;ns2:Encoding&gt;JPEG&lt;/ns2:Encoding&gt;&lt;ns2:Resolution&gt;&lt;ns2:Width&gt;1280&lt;/ns2:Width&gt;&lt;ns2:Height&gt;720&lt;/ns2:Height&gt;&lt;/ns2:Resolution&gt;&lt;ns2:QualitЭy&gt;70&lt;/ns2:Quality&gt;&lt;ns2:RateControl&gt;&lt;ns2:FrameRateLimit&gt;15&lt;/ns2:FrameRateLimit&gt;&lt;ns2:EncodingInterval&gt;15&lt;/ns2:EncodingInterval&gt;&lt;ns2:BitrateLimit&gt;3072&lt;/ns2:BitrateLimit&gt;&lt;/ns2:RateControl&gt;&lt;ns2:Multicast&gt;&lt;ns2:Address&gt;&lt;ns2:Type&gt;IPv4&lt;/ns2:Type&gt;&lt;ns2:IPv4Address&gt;0.0.0.0&lt;/ns2:IPv4Address&gt;&lt;/ns2:Address&gt;&lt;ns2:Port&gt;0&lt;/ns2:Port&gt;&lt;ns2:TTL&gt;5&lt;/ns2:TTL&gt;&lt;ns2:AutoStart&gt;false&lt;/ns2:AutoStart&gt;&lt;/ns2:Multicast&gt;&lt;ns2:SessionTimeout&gt;PT0S&lt;/ns2:SessionTimeout&gt;&lt;/ns2:VideoEncoderConfiguration&gt;&lt;ns2:AudioEncoderConfiguration token="0"&gt;&lt;ns2:Name&gt;user0&lt;/ns2:Name&gt;&lt;ns2:UseCount&gt;0&lt;/ns2:UseCount&gt;&lt;ns2:Encoding&gt;G711&lt;/ns2:Encoding&gt;&lt;ns2:Bitrate&gt;64000&lt;/ns2:Bitrate&gt;&lt;ns2:SampleRate&gt;8000&lt;/ns2:SampleRate&gt;&lt;ns2:Multicast&gt;&lt;ns2:Address&gt;&lt;ns2:Type&gt;IPv4&lt;/ns2:Type&gt;&lt;ns2:IPv4Address&gt;0.0.0.0&lt;/ns2:IPv4Address&gt;&lt;/ns2:Address&gt;&lt;ns2:Port&gt;0&lt;/ns2:Port&gt;&lt;ns2:TTL&gt;5&lt;/ns2:TTL&gt;&lt;ns2:AutoStart&gt;false&lt;/ns2:AutoStart&gt;&lt;/ns2:Multicast&gt;&lt;ns2:SessionTimeout&gt;PT0S&lt;/ns2:SessionTimeout&gt;&lt;/ns2:AudioEncoderConfiguration&gt;&lt;/ns11:Profiles&gt;&lt;ns11:Profiles token="mc_test" fixed="false"&gt;&lt;ns2:Name&gt;mc_test&lt;/ns2:Name&gt;&lt;ns2:VideoSourceConfiguration token="2"&gt;&lt;ns2:Name&gt;Hе&lt;/ns2:Name&gt;&lt;ns2:UseCount&gt;0&lt;/ns2:UseCount&gt;&lt;ns2:SourceToken&gt;0&lt;/ns2:SourceToken&gt;&lt;Bounds xmlns="http://www.onvif.org/ver10/schema" height="720" width="1280" y="0" x="0"&gt;&lt;/Bounds&gt;&lt;/ns2:VideoSourceConfiguration&gt;&lt;ns2:AudioSourceConfiguration token="0"&gt;&lt;ns2:Name&gt;user0&lt;/ns2:Name&gt;&lt;ns2:UseCount&gt;0&lt;/ns2:UseCount&gt;&lt;ns2:SourceToken&gt;0&lt;/ns2:SourceToken&gt;&lt;/ns2:AudioSourceConfiguration&gt;&lt;ns2:VideoEncoderConfiguration token="Motion_jpeg"&gt;&lt;ns2:Name&gt;јч
  @јч
  @peg&lt;/ns2:Name&gt;&lt;ns2:UseCount&gt;0&lt;/ns2:UseCount&gt;&lt;ns2:Encoding&gt;JPEG&lt;/ns2:Encoding&gt;&lt;ns2:Resolution&gt;&lt;ns2:Width&gt;1280&lt;/ns2:Width&gt;&lt;ns2:Height&gt;720&lt;/ns2:Height&gt;&lt;/ns2:Resolution&gt;&lt;ns2:Quality&gt;70&lt;/ns2:Quality&gt;&lt;ns2:RateControl&gt;&lt;ns2:FrameRateLimit&gt;15&lt;/ns2:FrameRateLimit&gt;&lt;ns2:EncodingInterval&gt;15&lt;/ns2:EncodingInterval&gt;&lt;ns2:BitrateLimit&gt;3072&lt;/ns2:BitrateLimit&gt;&lt;/ns2:RateControl&gt;&lt;ns2:Multicast&gt;&lt;ns2:Address&gt;&lt;ns2:Type&gt;IPv4&lt;/ns2:Type&gt;&lt;ns2:IPv4Address&gt;0.0.0.0&lt;/ns2:IPv4Address&gt;&lt;/ns2:Address&gt;&lt;ns2:Port&gt;0&lt;/ns2:Port&gt;&lt;ns2:TTL&gt;5&lt;/ns2:TTL&gt;&lt;ns2:AutoStart&gt;false&lt;/ns2:AutoStart&gt;&lt;/ns2:Multicast&gt;&lt;ns2:SessionTimeout&gt;PT0S&lt;/ns2:SessionTimeout&gt;&lt;/ns2:VideoEncoderConfiguration&gt;&lt;ns2:AudioEncoderConfiguration token="0"&gt;&lt;ns2:Name&gt;user0&lt;/ns2:Name&gt;&lt;ns2:UseCount&gt;0&lt;/ns2:UseCount&gt;&lt;ns2:Encoding&gt;G711&lt;/ns2:Encoding&gt;&lt;ns2:Bitrate&gt;64000&lt;/ns2:Bitrate&gt;&lt;ns2:SampleRate&gt;8000&lt;/ns2:SampleRate&gt;&lt;ns2:Multicast&gt;&lt;ns2:Address&gt;&lt;ns2:Type&gt;IPv4&lt;/ns2:Type&gt;&lt;ns2:IPv4Address&gt;0.0.0.0&lt;/ns2:IPv4Address&gt;&lt;/ns2:Address&gt;&lt;ns2:Port&gt;0&lt;/ns2:Port&gt;&lt;ns2:TTL&gt;5&lt;/ns2:TTL&gt;&lt;ns2:AutoStart&gt;false&lt;/ns2:AutoStart&gt;&lt;/ns2:Multicast&gt;&lt;ns2:SessionTimeout&gt;PT0S&lt;/ns2:SessionTimeout&gt;&lt;/ns2:AudioEncoderConfiguration&gt;&lt;/ns11:Profiles&gt;&lt;ns11:Profiles token="MACROSCOP" fixed="false"&gt;&lt;ns2:Name&gt;MACROSCOP&lt;/ns2:Name&gt;&lt;ns2:VideoSourceConfiguration token="2"&gt;&lt;ns2:Name&gt;Hе&lt;/ns2:Name&gt;&lt;ns2:UseCount&gt;0&lt;/ns2:UseCount&gt;&lt;ns2:SourceToken&gt;0&lt;/ns2:SourceToken&gt;&lt;Bounds xmlns="http://www.onvif.org/ver10/schema" heightЮ="720" width="1280" y="0" x="0"&gt;&lt;/Bounds&gt;&lt;/ns2:VideoSourceConfiguration&gt;&lt;ns2:AudioSourceConfiguration token="0"&gt;&lt;ns2:Name&gt;user0&lt;/ns2:Name&gt;&lt;ns2:UseCount&gt;0&lt;/ns2:UseCount&gt;&lt;ns2:SourceToken&gt;0&lt;/ns2:SourceToken&gt;&lt;/ns2:AudioSourceConfiguration&gt;&lt;ns2:VideoEncoderConfiguration token="Motion_jpeg"&gt;&lt;ns2:Name&gt;јч
  @јч
  @peg&lt;/ns2:Name&gt;&lt;ns2:UseCount&gt;0&lt;/ns2:UseCount&gt;&lt;ns2:Encoding&gt;JPEG&lt;/ns2:Encoding&gt;&lt;ns2:Resolution&gt;&lt;ns2:Width&gt;1280&lt;/ns2:Width&gt;&lt;ns2:Height&gt;720&lt;/ns2:Height&gt;&lt;/ns2:Resolution&gt;&lt;ns2:Quality&gt;70&lt;/ns2:Quality&gt;&lt;ns2:RateControl&gt;&lt;ns2:FrameRateLimit&gt;15&lt;/ns2:FrameRateLimit&gt;&lt;ns2:EncodingInterval&gt;15&lt;/ns2:EncodingInterval&gt;&lt;ns2:BitrateLimit&gt;3072&lt;/ns2:BitrateLimit&gt;&lt;/ns2:RateControl&gt;&lt;ns2:Multicast&gt;&lt;ns2:Address&gt;&lt;ns2:Type&gt;IPv4&lt;/ns2:Type&gt;&lt;ns2:IPv4Address&gt;0.0.0.0&lt;/ns2:IPv4Address&gt;&lt;/ns2:Address&gt;&lt;ns2:Port&gt;0&lt;/ns2:Port&gt;&lt;ns2:TTL&gt;5&lt;/ns2:TTL&gt;&lt;ns2:AutoStart&gt;false&lt;/ns2:AutoStart&gt;&lt;/ns2:Multicast&gt;&lt;ns2:SessionTimeout&gt;PT0S&lt;/ns2:SessionTimeout&gt;&lt;/ns2:VideoEncoderConfiguration&gt;&lt;ns2:AudioEncoderConfiguration token="0"&gt;&lt;ns2:Name&gt;user0&lt;/ns2:Name&gt;&lt;ns2:UseCount&gt;0&lt;/ns2:UseCount&gt;&lt;ns2:Encoding&gt;G711&lt;/ns2:Encoding&gt;&lt;ns2:Bitrate&gt;64000&lt;/ns2:Bitrate&gt;&lt;ns2:SampleRate&gt;8000&lt;/ns2:SampleRate&gt;&lt;ns2:Multicast&gt;&lt;ns2:Address&gt;&lt;ns2:Type&gt;IPv4&lt;/ns2:Type&gt;&lt;ns2:IPv4Address&gt;0.0.0.0&lt;/ns2:IPv4Address&gt;&lt;/ns2:Address&gt;&lt;ns2:Port&gt;0&lt;/ns2:Port&gt;&lt;ns2:TTL&gt;5&lt;/ns2:TTL&gt;&lt;ns2:AutoStart&gt;false&lt;/ns2:AutoStart&gt;&lt;/ns2:Multicast&gt;&lt;ns2:SessionTimeout&gt;PT0S&lt;/ns2:SessionTimeout&gt;&lt;/ns2:AudioEncoderConfiguration&gt;&lt;/ns11:Profiles&gt;&lt;/ns11:GetProfilesResponse&gt;&lt;/SOAP-ENV:Body&gt;&lt;/SOAP-ENV:Envelope&gt;
  </code></pre>