Troubleshooting
No matter how carefully you code, you can always end up with unexpected results. In such cases, you will want to see what is happening and to pinpoint the code that is causing the problem. Debugging can be difficult when there is client-server communication as in the case of web services. Here are a few tips to help you identify and fix common problems that you may face:
- Check the WSDL. As explained earlier, append ?wsdl to the CFC URL and run the URL in a browser to see whether the CFC has any compilation problems and whether the generated WSDL is correct and accessible.
- Use <cfdump> to output to the console to check whether the call is coming to your application and see what arguments are being passed. Remember to remove this function when implementing your application for production.
- Use refreshWSDL. It is possible that the CFC you are accessing through the web service has changed. Use this attribute with <cfinvoke> to regenerate the stubs. Remember to remove it when implementing your application for production.
- If wsversion is not defined while consuming a web service, ColdFusion checks the WSDL to determine which web service engine it should use to consume that particular web service. You can force ColdFusion to use a specific web service engine by specifying wsversion with <cfinvoke>.
- You can use the GetSOAPRequest function to get the actual SOAP request sent and the GetSOAPResponse function to get the actual response received. This information can help you determine whether correct information is being sent and whether you are receiving the correct response.
- You can use a TCP monitor such as TCPMon to track exactly what is being sent and received over the wire. The monitor acts like a proxy between the client and the server and shows you the communication that occurred in between them.