wso2- how to send some values in a custom handler to backend service - header

I 'm writing a custom handler in WSO2 and I need to send some parameter values (for example adding them to message header in handler) such that the parameter values can be accessed in back-end service. How can I do this? I would appreciate any help.
Thanks

Please refer[1] and get back for further questions.
[1] https://docs.wso2.com/display/AM260/Writing+Custom+Handlers

Related

Query parameter values starting with # is not getting considered in Postman

I developed one application in Mulesoft for calling a SOAP webservice. While making GET call to a SOAP web service from Postman, query parameter value starting with # is not getting considered by my Mulesoft mapping.
e.g: http://localhost:8080/appName?queryParam1=#abc
In my mule application, the value for queryParam1 is coming as empty value. Could some one explain the technical reason for this. Is # is considered as escape character from Postman or Mulesoft Transform Message activity? Thanks in advance
I also faced the same issue in my API, in URI anywhere in between comes the '#' character the rest of your URI will go blank and the 404 HTTP error will occur.
I suggest you to get the value in query parameter without # character and later in the API code or flow prefix it. This will work.
Hope this will resolve your problem.
You will have to encode characters such as #. Refer this link for complete list of such characters. In your example:
Change: http://localhost:8080/appName?queryParam1=#abc
To: http://localhost:8080/appName?queryParam1=%23abc

Mule Web Service Consumer Warning : Operation Messages With More then 1 Part Are Not Supported

Hi I am working with Mule Web Service Consumer and i was trying to call operation with Multiple Parameters it is warning me that
Warning : Operation Messages With More then 1 Part Are Not Supported
I just want to pass multiple parameters to access my SOAP method to achieve the task.
Is this the problem with Web Service Consumer or is their any way to deal with this.
I'm afraid this is a known limitation of the web services consumer. However you can accomplish this with the cxf component.
I having the same issue and found some information around it ...
There is a improvement logged in JIRA, may help if you vote for it :)
This link suggests that you can still use WSConsumer but need to do some hand crafting of the request XML ... I could not understand what that exactly it meant so if anyone has an example on it would be great
PS: The problem I had with using CXF component is that it does not play well with the new Dataweave transformer as the Dataweave needs to be placed within the response block and from there it cannot datasense the response coming out from the CXF component
The Solution here is very simple. You just have to comment other messages and then load metadata for non-commented message (for one which you're trying to load metadata). Repeat this procedure for all the other messages and you're good to go.
Hope this helps !

How to capture the response object from a webhook call

I am creating a Rails 3.2 app and I am using Paymill as the payment gateway.
I am trying to setup a webhook on my system (Already setup on Paymill side). This webhook should respond to callbacks when a transaction was successful.
How can I "capture" the response object in my code? Using params?
Thankful for all help!
I don't know paymill, but it looks like it works the same way as stripe.
Thus, you have to handle the response with params.
You can have a look on this code sample: https://github.com/apalancat/paymill-rails
A webhook call from Paymill includes a JSON in the request. This JSON includes some meta data about the event that was triggered and the objects affected. So, you'd have to take the request body and parse the JSON to extract the information you are looking for. You can see a sample JSON file here:
https://www.paymill.com/de-de/dokumentation/referenz/api-referenz/#events

How to parse WCF binary response manually (xml)

I need to parse WCF binary response. The reason is that I have no contract nor metadata I can just call wcf service with parameters using WebClient. What I'm getting now is binary response with xml inside but when I want to deserialize it with BinaryFormatter and load xml document, it gives me an error because of leading data. Is there some class which can do this for me?
Thanks.
I was also looking for something similar and I came across https://github.com/waf/WCF-Binary-Message-Inspector
It may help you out.
thank you for responses. Actually I ended up following this blog post (Fiddler plugin):
http://blog.functionalfun.net/2009/11/fiddler-plug-in-for-inspecting-wcf.html
there is also a link to source code:
http://archive.msdn.microsoft.com/wcfbinaryinspector
hope it will help

How to log error 500 in wcf applications

We all are know some time we will get 500 error while trying to hit wcf url. for example if pass string value to integer parameter it will throw 500 error as request error. my question is how to log, this kind error in some file? because this will not reach our actual end point class coding right? so how to log this error in some file?
Any Help?
Assuming you want to log these on the server size, you should configure WCF tracing and use SvcTraceViewer to analyze the logs. More details on MSDN: http://msdn.microsoft.com/en-us/library/ms732023.aspx.
I may very well be wrong here - but if the client is supplying the wrong parameters to a web method, that would be a 404 as no method matches the incoming request?
I would say it's the clients job to send the right data to the right function, and to handle failures appropriately (an EndPointNotFoundException perhaps)