Start by using the debugger to find out what is in the
Query
and
server
variables. You don't show the definition of
server
and that could easily generate the problem.
THen check that Certificates are installed - if they aren't then
MSBTS_ReceiveLocation[
^] won't work.