This project is read-only.
1

Resolved

When using JSR-262, object names containing quotations cause serialization problems

description

=========

Exception

System.Xml.XmlException was unhandled
Message="End element 'Selector' from namespace 'http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd' expected. Found text '\"'."
Source="System.Runtime.Serialization"
LineNumber=0
LinePosition=0
StackTrace:
   at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, String res, String arg1, String arg2, String arg3)
   at System.Xml.XmlExceptionHelper.ThrowEndElementExpected(XmlDictionaryReader reader, String localName, String ns)
   at System.Xml.XmlBaseReader.ReadEndElement()
   at WSMan.NET.Management.Selector.ReadFrom(XmlReader reader) in C:\Users\Simon\Documents\Visual Studio 2008\Projects\WSMan.NET\WSMan.NET\WSMan.NET\Management\Selector.cs:line 107
   at WSMan.NET.Management.SelectorSetHeader.ReadFrom(XmlReader reader) in C:\Users\Simon\Documents\Visual Studio 2008\Projects\WSMan.NET\WSMan.NET\WSMan.NET\Management\SelectorSetHeader.cs:line 79
   at WSMan.NET.Management.SelectorSetHeader.ReadFrom(EndpointAddress address) in C:\Users\Simon\Documents\Visual Studio 2008\Projects\WSMan.NET\WSMan.NET\WSMan.NET\Management\SelectorSetHeader.cs:line 69
   at NetMX.Remote.Jsr262.ObjectNameSelector.ExtractObjectName(EndpointAddress address) in C:\dev\Visual Studio 2008\NetMX-55182\NetMX\NetMX.Remote.Jsr262\ObjectNameSelector.cs:line 26
   at NetMX.Remote.Jsr262.Client.Jsr262MBeanServerConnection.<QueryNames>b__17(EndpointAddress x) in C:\dev\Visual Studio 2008\NetMX-55182\NetMX\NetMX.Remote.Jsr262\Client\Jsr262MBeanServerConnection.cs:line 188
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at JmxClientDemo.Program.ShowInfo(IMBeanServerConnection connection) in C:\dev\Visual Studio 2008\NetMX-55182\NetMX\Samples\JmxClientDemo\Program.cs:line 190
   at JmxClientDemo.Program.QueryAgentConnectorDemo() in C:\dev\Visual Studio 2008\NetMX-55182\NetMX\Samples\JmxClientDemo\Program.cs:line 172
   at JmxClientDemo.Program.Main(String[] args) in C:\dev\Visual Studio 2008\NetMX-55182\NetMX\Samples\JmxClientDemo\Program.cs:line 18
   at System.AppDomain._nExecuteAssembly(Assembly 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)
   at System.Threading.ThreadHelper.ThreadStart()
InnerException:

 

Server Response

<?xml version='1.0' encoding='utf-8'?>
<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope">
<S:Header>
<Action xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">
http://schemas.xmlsoap.org/ws/2004/09/enumeration/EnumerateResponse</Action>37f

<ns9:ConnectionId xmlns:ns3="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:ns4="http://schemas.xmlsoap.org/ws/2004/08/eventing"
xmlns:ns5="http://schemas.xmlsoap.org/ws/2004/09/enumeration"
xmlns:ns6="http://schemas.xmlsoap.org/ws/2004/09/transfer"
xmlns:ns7="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"
xmlns:ns8="http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd"
xmlns:ns9="http://jsr262.dev.java.net/jmxconnector">
2405fbf7-2fbf-4b8f-97b1-cba7f75df83d</ns9:ConnectionId>
<To xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">
http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</To>
<MessageID xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">
uuid:ff83b67c-947d-4c68-97ae-2e1edfe56543</MessageID>
<RelatesTo xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">
urn:uuid:57c64fdd-edc3-43e7-8898-b8b4173ac2b3</RelatesTo></S:Header>
<S:Body>1000
<ns5:EnumerateResponse xmlns:ns3="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:ns4="http://schemas.xmlsoap.org/ws/2004/08/eventing"
xmlns:ns5="http://schemas.xmlsoap.org/ws/2004/09/enumeration"
xmlns:ns6="http://schemas.xmlsoap.org/ws/2004/09/transfer"
xmlns:ns7="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"
xmlns:ns8="http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd"
xmlns:ns9="http://jsr262.dev.java.net/jmxconnector">
<ns5:EnumerationContext>
0fc1691e-ce3e-404f-816e-2c018d039df6</ns5:EnumerationContext>
<ns7:Items>
  <ns3:EndpointReference>
    <ns3:Address>http://localhost:8888/</ns3:Address>
    <ns3:ReferenceParameters>
      <ns7:ResourceURI>
      http://jsr262.dev.java.net/DynamicMBeanResource</ns7:ResourceURI>
      <ns7:SelectorSet>
        com.acme:name="AgentConnectorDemo",type="log4j",logger=root,appender=ConsoleAppender</ns7:Selector>
        <ns7:Selector Name="ObjectName">
      </ns7:SelectorSet>
    </ns3:ReferenceParameters>
  </ns3:EndpointReference>
  <ns3:EndpointReference>
    <ns3:Address>http://localhost:8888/</ns3:Address>
    <ns3:ReferenceParameters>
      <ns7:ResourceURI>
      http://jsr262.dev.java.net/DynamicMBeanResource</ns7:ResourceURI>
      <ns7:SelectorSet>
        <ns7:Selector Name="ObjectName">
        com.acme:applicationType="AgentConnectorDemo",name="TransportHandler",type="SoftwareVersion"</ns7:Selector>
      </ns7:SelectorSet>
    </ns3:ReferenceParameters>
  </ns3:EndpointReference>
</ns7:Items>
</ns5:EnumerateResponse></S:Body>
</S:Envelope>

comments