WSman/WinRM isn't working on browser due to Same Origin Policy RRS feed

  • Question

  • Hi guys,

    I have successfully configured  WinRM on my Windows Enterprise 7 PC. I have written a javascript code using SOAP, and I can currently get information from remote servers/host using nodejs. However, when going through the web browser (.html file) the request is being blocked by the same origin policy. I get the error "no Access-Control-Allow-Origin header is present. Origin: XXXX is therefore not allowed access. The response had HTTP status code 405".

    From my research I learned that I have to add that header (Access-Control-Allow-Origin) to my server. The server that is showing up in my browser's console is "Microsoft-HTTPAPI/2.0". I do not have any experience with the configuration. Please how can I add that header to the server? Is there config file I can edit or something? 

    Also do you guys know how I can link an apache server to wsman protocol? I am asking because I have been able to overcome same origin policy on my apache server by adding that header to the "httpd.conf" file. But since apache isn't responsible for my wsman services I get an error code 404 not found.

    Thank you.

    Thursday, January 29, 2015 12:18 AM


All replies

  • Hello Uzokwe,

    Thank you for your inquiry about Wsman protocol. One of the Open specifications team member will contact you shortly.

    Sreekanth Nadendla
    Microsoft Windows Open specifications

    Thursday, January 29, 2015 2:44 PM
  • Hello Uzokwe -

    I'll research this for you. Can you please share more details about your setup and implementation ? Is your server non-windows ? Have you implemented MS-WSMAN\MS-WSMV open specifications on your server and client ? Does your client leverage inbuilt windows APIs to interact with your server ?



    Tarun Chopra | Escalation Engineer | Open Specifications Support Team

    Thursday, January 29, 2015 4:15 PM
  • Hello Uzokwe -

    Appreciate if you can please respond to above queries.


    Tarun Chopra | Escalation Engineer | Open Specifications Support Team

    Sunday, February 1, 2015 4:20 AM
  • Hello Uzokwe - We are still awaiting to hear back from you.

    Tarun Chopra | Escalation Engineer | Open Specifications Support Team

    Wednesday, February 4, 2015 6:56 PM
  • Hello Uzokwe - As we didn't hear back from you, we have closed the case\investigation at our end. Should you require any assistance in future, please open up a new thread on our forum with above requested details.

    Tarun Chopra | Escalation Engineer | Open Specifications Support Team

    Friday, February 6, 2015 5:48 PM
  • Hello Tarun,

    I am sorry I have been away for some time. I have set up both winrm and wmi on the servers. They are both running on windows OS. One is a windows 7 and the other is a windows 2012 server. I used nodejs to test that the winrm is properly configured. I can get host information output on nodejs remotely from one server to another. I am facing the same origin issue when I try to go through a web browser. I have set up cors on the iis server but I am still getting the no access-control-allow-origin header. This is because the wsman request I am sending is going to Microsoft httpapi/2.0 every time I send the request using the http://ipaddress:portNumber/wsman but if i remove the "/wsman" part then the request goes to the iis server and I get the access-control-allow-origin header which makes sense because I added it. However, I do not get the wsman response I want because I didn't specify the ApplicationName (/wsman). I am using the SOAP API to send these requests btw.


    Friday, February 20, 2015 6:56 PM
  • Hello Uzokwe - Thanks for the update. Are you sending this wsman request using inbuilt libraries in windows or implementing MS-WSMAN protocol specification published here ?

    Kindly share this information as it will help us evaluate if this query should be handled by our team or different one.


    Tarun Chopra | Escalation Engineer | Open Specifications Support Team

    Friday, February 20, 2015 9:49 PM
  • Hello,

    I think I am using inbuilt libraries in Windows because I have not set up/configured MS-WSMAN. I barely know what it is.

    Monday, February 23, 2015 9:55 PM
  • Hi,

    This forum handles requests related to Open Specifications documentation issues.
    The Open Specifications can be found at:
    Your question is not related to the Open Specifications documentation set.

    I suggest the following forum to get a better assistance.


    Tuesday, February 24, 2015 4:43 AM