Communication between Podio and WebService using hook - podio

we need to do a communication between Podio and a WebService, and we suppose that the solution is to use hooks.
We have a WebService with one function "createInvoice" with some parameters, and we need to invoke this when we create an item on Podio.
We have read the Podio documentantion but we don't find the manner to do this.
http://podio.github.io/podio-dotnet/webhooks/
As the above link suggests, is it necessary to use a ".ashx" class (Handler) to receive the item from Podio and send the correct information to the WebService or exists another solution?
Thanks!

Its not necessary to be an ashx file.
You just need to have a public URL that expects POST parameters from Podio.
As given in the example code, you need to check the "type" parameter and verify the webhook to enable it.

Related

Identify Operation on the basis of xml content posted in WCF Service without including operation name in Url

How to identify operation from xml content posted to WCF Service Url?
Suppose WCF Service Url is http://single.mat.nn.com and client dont want to include operation name in Url.
Problem is to identify operation on the basis of xml content posted .
I am not able to find any solution for this problem. Is it feasible to do configuration in WCF Service that can identify operation method on the basis of xml content posted to WCF Service URL.
One of the scenarios possible in Extending Dispatchers is:
Custom Operation Dispatching. Users can implement dispatching on something other than action – for example, on the body element, or on a custom message property. This can be done using the IDispatchOperationSelector interface.
Implmenting IDispatchOperationSelector will give you access to the incoming message to parse and decide which method you want to forward the request to.
The SOAP web service based on the corresponding method of the SOAPAction field request in the HTTP request. See the screenshot below.
The SOAPAction field and the method section in the request body can view the operation name of the specific request. If you want to recognize this value, we can intercept the SOAP message through the following two interfaces and get the value of the field.
https://learn.microsoft.com/en-us/dotnet/framework/wcf/extending/how-to-inspect-or-modify-messages-on-the-client
https://learn.microsoft.com/en-us/dotnet/api/system.servicemodel.dispatcher.idispatchmessageinspector?view=netframework-4.8
these two interfaces could capture the SOAP message during the communication. We could retrieve the field value and modify it.
Feel free to let me know if there is anything I can help with.

Web service not returning data when called from code

Got stuck on an issue.
I'm consuming an external web service and I'm trying to receive data from a web method.
This web method returns an array of a particular object.
When I call the method from my code (C#, Service Reference) the response is an empty array, but when i call it from SOAP UI with exactly the same parameters I get the array with data.
What could be the problem? any Idea?
Tks
Ceck the header information, the content type, the parameters. Make sure everything is exactly the same.
Soap UI is obviously setting more things in the background you just need to make sure you replicate it exactly.
Use something like Fiddler and inspect each call, this way you will notice the differences very quickly and you should be able to craft your call correctly.

Pass Parameters to a API Controller from Workflow HttpSend Control

I need to make a api call from my workflow(Method type is POST), I am using HttpSend control from Microsoft.Activities to do this. I am able to call my api but not able to send parameters from workflow to api. I tried passing a simple string type parameter through RequestContent in HttpSend but still not able to retrieve its value in my api call.
Screen Shots
Can you provide me a simple example or a link to explain how can i pass parameters from workflow to api for POST
USe the RequestContent parameter of Call HTTP Web Service action for setting payloads to submit to the service.
See this similar example from SHarePoint
https://blog.vgrem.com/2014/05/08/consuming-the-sharepoint-2013-rest-service-from-sharepoint-designer/

Handle JSON calls in WCF to single URL with method name contained in request body

We are replicating an existing service and need to offer the exact same contract.
Requests are posted to a single URL with the method name contained in the request body.
For example the request body of a call to LoginService.Login:
All calls will be made to: http://example.com/json
{"id": "","method":"LoginService.Login","params":{"aUserID":"flip","aPassword":"1234-613E-1240-C55D-9853F37A41B2"}}
How can we accomplish this within WCF? The response should also be JSON.
I didn't know what I wanted was called jsonrpc. Luckily somebody already tackled this problem:
Implement JSON-RPC in WCF

How can I add a header/datamember to all DataContracts in a WCF service?

I am looking to extend existing services and add Authorization to every call being made. The problem I have is that I don't know how to do this in the best possible manner. What I need to do is to send the name of the module calling the WCF service. I already send the username and password for the service and now I need to extend that with the name of the module calling the service. This is because we might allow a user to open a module and display data from another module but not from a third.
If we would have used message contracts I would just add a MessageHeader for this and set that header when I create the request. That is unfortunately not an option with DataContracts so I was considering the following two alternatives.
Adding a DataMember in a base class with Order=1000 or something like that. I don't know what will happen if we add another DataMember before that though?
Create the property for the module name and set a header in the transport instead. Not really fond of this one though. It's pretty abstract and hard to follow.
Which one is the least evil or do you have a better suggestion?
EDIT 1: The problem is not how to send a header to the service the problem is how to send a header with a specific value to the server. In the message inspector I can only create generic instances with message.GetBody<DataContract>(); this means I have to know the type which I don't know how to.
EDIT 2: The issue here is that in our application we want to restrict access to a call based on from where the call is made so I need to pass this information. Let's say I make the call to MyService from FindUserModule then I need to add the id of that module in a header so that the AuthorizationManager can check if that user really should be authorized. This is due to service calls being used from many modules.
Handle this as SOAP header in custom message inspector.