Solution
When using G Web Development Software to make HTTP requests, two primary factors could return error 353650.
- Missing server-side CORS headers:
The G Web Development Software may find issues communicating with LabVIEW Web Services due to Cross-Origin Resource Sharing (CORS) configurations, to solve this error complete the next steps depending on the Web Server used to host the application.
When using the Application Web Server
To solve this issue modify your LabVIEW Web Service and use the Set HTTP Header.vi to set the HTTP Header field, wire the Access-Control-Allow-Origin to the header input. You could specify the allowed domain on its own, or choose the value "*" to allow any domain, and wire it to the header value input. Using the asterisk, “*” to allow any domain has security implications that should be researched and reviewed before this solution is implemented.
When using the NI Web Server
Use the NI Web Server Configuration tool on the machine hosting the web service to configure Cross-Origin Resource Sharing (CORS).
1. Open the application and go to the Remote tab.
2. In the Cross-Origin Resource Sharing (CORS) section select the Enable CORS for a list of trusted web servers option and specify the domain. You can also use the * to allow any domain. As detailed in the last section using the asterisk to allow any domain has security implications that should be previously contemplated.
3. Click on Apply and restart to complete the changes.
After completing the changes run the G Web Development Software program to communicate with the LabVIEW Web Service.
- Requesting to incorrect IP address:
If the CORS headers have been properly configured on the server side but the error persists, it may be due to an incorrect or malformed IP address.
When publishing a G Web application on a network for access by other clients, ensure that the localhost address (127.0.0.1) used during testing for HTTP Requests is replaced with its IPv4 address.
A common mistake occurs when the localhost address, used during testing to communicate with the web service on the same machine, is mistakenly left unchanged when deploying the application. This can result in error 363650, as external clients attempt to connect to their own local machines instead of the actual host. Ensure the correct network IP address of the host is specified before deployment to avoid this issue.