Closed Mazwak closed 8 years ago
Have you tried playing with the locale option?
Locale did not change anything.
However, after 3 hours, I got it working. I think it comes from the message size, where you use the number of characters, instead of the size in bytes.
In http_transport, line 168 : original_length = message.bytesize
Does it looks good to you ?
Ah hah! So we have some double byte characters causing the message length != message byte size I presume.
Yes, as UTF-8 uses 1 to 4 bytes for a single characters.
'é' uses 2, in "Docs périmés".
I did not search winrm documentation, but it is most likely expecting the size of the message in bytes, and not the number of character. Which makes sense.
I found this in the WSMV spec: Content-Length: Contains the size, in bytes, of the message body. It MUST be present.
Do you mind sending a PR?
Done
Following #143 , I now have a problem I can't debug.
I'm still using the same query :
ASSOCIATORS OF {Win32_Directory.Name="#{path}"} WHERE AssocClass = Win32_Subdirectory ResultRole = PartComponent
When the path contains 'é', and most likely other accented characters, I get an error :
WinRM/lib/winrm/http/response_handler.rb:79:in
raise_transport_error': Bad HTTP response returned from server (400). (WinRM::WinRMHTTPTransportError)`The SOAP response is indeed bad, in fact totally empty :
The exact query is :
ASSOCIATORS OF {Win32_Directory.Name="e:\\Maldi-Tof\\ESEC\\doc périmés"} WHERE AssocClass = Win32_Subdirectory ResultRole = PartComponent
Running the query remotely from windows seven works.
I've been searching the whole afternoon, but to no avail.
Do you have an idea ?