cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

API Proxy - Using path parameter as variable

Former Member
0 Likes
2,783

I have a box standard API Proxy where I can call the endpoint using the GET verb. The path suffix looks like below:

/order/58

The resource is setup as follows:

The problem I'm having is with the DefaultFaultFlow policy. When enabled, the policy always gets triggered, when turned off the endpoint successfully makes the SOAP call to my backend server and returns the results for the passed order id.

I suspect it has something to do with the pattern matching of the URL. The condition string for the policy is:

proxy.pathsuffix MatchesPath "/order/" OR proxy.pathsuffix MatchesPath "/order//**" OR proxy.pathsuffix MatchesPath "/order/(**" OR proxy.pathsuffix MatchesPath "/order/{orderId}" OR proxy.pathsuffix MatchesPath "/order/{orderId}/**" OR proxy.pathsuffix MatchesPath "/order/{orderId}(**"

The error returned, which doesn't really tell me much is:

{
    "fault": {
        "faultstring": "Raising fault. Fault name : defaultRaiseFaultPolicy",
        "detail": {
            "errorcode": "steps.raisefault.RaiseFault"
        }
    }
}


I've searched around for working examples, but so far I'm stuck. Does anyone have any ideas what the issue could be?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
I managed to solve it on my own. When reviewing the debug log for the proxy, I noticed that the first condition that should cover my path parameter was expecing a GET verb. But the log showed it received a POST.Because I'm doing a SOAP request I'm assigning a message, which seems to convert the verb from GET over to POST. That would explain why it was dropping to the DefaultFaultFlow policy, as no routes matched.

I've moved the AssignMessage policy which holds my SOAP payload, over into the PostFlow section of the proxy. Now, the GET verb is correctly presented and the flow conditions fire as they should. Hope that helps someone out in the future!

Elijah_Martinez1
Product and Topic Expert
Product and Topic Expert
0 Likes

Dear Logan,

I am happy that you were able to promptly resolve this issue - what may help other users is if you can mark this answer as the accepted one for your post, which will highlight the answer as the correct one for the question, as well as marking this answered.

Regards,
Elijah

AlfiyaPatil
Explorer
0 Likes
can you please explain how did you assign message?

Answers (0)