Can't get sendToGateway to work

I am using the following:

{{ 'yes!' | assignTo: yay }}
 
<p>
    {{ now | dateFormat }}
    {{ yay }}
</p>
 
{{ { a: true } | sendToGateway('GetTagsRequest') | toResults }}
 
<p>
    {{ now | dateFormat }}
    {{ yay }}
</p>

I don’t get any errors, and my BP hits in the GetTagsRequest service. But the thing stops working. I only see the first paragraph on the screen. The second now and second yay variables never print. It’s like this tag shut things down completely and only straight HTML works.

This is a “get” request that doesn’t take any parameters. I also tried sending just { } and even empty string ‘’.

If I post the sample code from the filters example page, I also get nothing. I wouldn’t expect it to work! But I’d expect to see an exception or something. http://templates.servicestack.net/docs/servicestack-filters#sendtogateway

{{ { customerId } | sendToGateway('QueryCustomers') | toResults | get(0) 
   | htmlDump({ caption: 'ALFKI' }) }}

{{ { countryIn:['UK','Germany'], orderBy:'customerId',take:5 } | sendToGateway: QueryCustomers
   | toResults | selectFields(['CustomerId', 'CompanyName', 'City'])
   | htmlDump({ caption: 'Implicit AutoQuery Conventions' }) }}

{{ { companyNameContains:'the',orderBy:'-Country,CustomerId' } | sendToGateway: QueryCustomers 
   | toResults | selectFields: CustomerId, CompanyName, Country
   | htmlDump }}

During debugging, the rendering pauses at that point in the DOM until I continue. So it’s doing SOMETHING there… but I don’t know what!

Any thoughts on what’s going on? This is not a web app. It’s an ASP.NET CORE app based on the template.

I found the section on error handling and see that this is how it’s supposed to work. By dumping lastError, I’m able to see what’s going on.

{{ lastError | ifExists | dump }}

1 Like