How to implement post web service call in sencha touch - sencha-touch

Can anybody tell How to implement post web service call in sencha touch.What is bet way to implement webservice call

Use Ext.Ajax.request() and pass method : 'post' in the options object.

Related

How to create a custom controller with user authentication - Odoo13?

I am trying to create a custom controller with user authentication.
Here is what i did.
class GetUserDetails(http.Controller):
#http.route('/web/getUserDetail',auth='user',type='json')
def getChit(self,**kw):
print('Inside getUser detail',kw)
Issue 1: When i call this controller from an API client (ARC) its directly get into that function, without any authentication.???
Issue 2: If we solved the above issue, how can i authenticate a user via API call/client.
Actually i want to get user details in android app.
AFAIK, Odoo controller using cookie for authentication. So if you call API from other apps/device, better to use Odoo webservice API https://www.odoo.com/documentation/13.0/webservices/odoo
Odoo webservice API already integrated with "Access Rights" or "Record Rule", so IMO this is the best way to connecting Odoo with other apps.
You can use REST Framework for Odoo to create your API and do the authentication (see #13 for more details), or you can use JWT

How do I configure <Create> to ignore location.search parameters?

It seems like any location.search parameters are automatically sent up in the POST API call made by <Create>.
How do I disable this functionality?
Context: I have a third party app that is redirecting to our react-admin page and there is no control over some GET params.

How to ignore ResponseWrapper in ASP.NET Core Web API response

I have an web api project in .net core and in Startup there is configured to use a response wrapper "
app.UseResponseWrapper();"
But this format is applied for all the api methods in my project...
I want an api method in my solution that sends another format response , for example a simple xml. I want to know how to ignore that Response wrapper that is applied for all methods? Is there any decorator for that method ?
I solved my issue.
I had built a custom decorator for methods that is able to modify header response.
In the Response wrapper I succeded to manage and to modify the response

How to invoke MobileFirst adapters with curl and SOAP?

Good day,
We have the requirement to call a MobileFirst Adapter via curl and SOAP, ommiting authentication.
An example how to do it with curl and application/x-www-form-urlencoded looks like this, but we also require to invoke the adapter using SOAP.
curl -XPOST -d 'adapter=PushAdapter&procedure=sendNotifications&parameters=["[\"UserA\",\"UserB\"]", "Pushed.you"]' http://localhost:10080/application/invoke
The reason is, we want to trigger sending PushNotifications through a network zone that only allows SOAP.
We are open to different suggestions, like implementing a new JavaAdapter (not JS), implementing an extra WebService, or anything that pops up which could fulfil the requirement in an acceptable way.
I hope someone can come up with an idea how to call Adapters via SOAP, ommiting authentication.
Thank you,
gizmore
---- Edit ---
I added a new Java Adapter, like the video from Hasan suggests.
Thank you very much for that hint :)
There i added a WebService like this:
#WebService
#Path("/soap")
#OAuthSecurity(enabled=false) // Disable the imfAuthentication :)
public class ExternalPushService {
#POST
#Path("/push")
#WebMethod(action="push")
public String push(#WebParam(name="name") String name) {
return name + "ABC";
}
}
I can now do HTTP POST Requests to the http://localhost:10080/app/adapters/PushBridge/soap/push Endpoint, but the SOAP is not parsed.
Instead i get the complete Envelope in the "name" parameter.
If i do a SOAP call to PushBridge/soap, i get 405 Method not allowed.
Does someone have an idea, how i can get SOAP working out of the box there?
Answer is: NO
when you adding #WebService in your java adapter this the warring facing:
Problem description:This annotation requires a web service project. Convert the Java project to a web project targeting the specified runtime environment
SOAP base service are based on the JAX-WS specification.
but
Java adapters are based on the JAX-RS specification.
https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-0/server-side-development/java-adapter/

Cannot get custom header value from web api if called too frequently

I am calling web api services from angularjs. I am setting some custom header before calling the service. I am getting the value by
Request.Headers.GetValues. It is working fine.
But the problem is if I call multiple service immediately I am getting the header null.
If I use some setTimeout from JavaScript before service call then again it is working fine.
Can anybody let me know what is wrong with my approach?
Thanks in advance.