Rule Policy not updating message? - biztalk

I have built a schema, an orchestration with a receive port that receives messages of that type, and passes the message to a business rule. The business rule policy updates an element in the message with a true or false based on the rule. I have a scope shape with a call rule shape inside it. The call rule shape passes the message to the rule, and then I have a send shape which sends the message to a send port. I've tested the rule policy and it works fine, but when I drop a file, the orchestration processes it and output a file which should have an updated value from the rule policy, however the output file is always the same as the input file. I know messages are immutable, so how shoudl I be getting a value out of the BR, and constructing a new message with it?

The Call Rules shape will construct the new message, so it sounds like your rule may not be firing. Have you enabled tracking on the policy? See link for instructions:
http://msdn.microsoft.com/en-us/library/aa995589(BTS.10).aspx

Related

Google drive “patch semantics” and partial file update

Reading https://developers.google.com/drive/api/v3/reference/files/update I see this comment: "This method supports patch semantics.". Googling around, I can't find any description of the meaning of that phrase neither any hint about how to partially update a Google Drive document. The (diverse) source code I have studied just upload the new version of the file, complete.
Do you know what "patch semantics" means in this context?
Do you know how to partially update a file in google drive without just overwriting it completely?
Thanks!
It means that it is a HTTP PATCH request as opposed to a HTTP PUT request.
The HTTP PATCH request method applies partial modifications to a resource.
VS
The HTTP PUT request method creates a new resource or replaces a representation of the target resource with the request payload.
In the request body, supply the relevant portions of a Files resource, according to the rules of patch semantics.
A PUT would require that you send all of the values and it would update the entire object. Where by a PATCH will only update the parameters you send.
Using the Google drive file update method lets say that you only want to update the file name. Using a PATCH method will allow you to only send the name and only the name would be updated.
However if this was a PUT method every parameter in the object would need to be sent as they will all be updated any parameter that you do not send would then be updated to null.

Apigee rest endpoint path mapping to custom path

I have rest end point /admn_resource_manager.I have created a apigee proxy to expose this.
I dont want to expose it like this to others as I want something like /adminmanager.
Is there any way to map /adminmanager to /admn_resource_manager using Apigee.
end user would use http://someurl.apigee/adminmanager instead of http://someurl.apigee/admn_resource_manager
I explored KeyValueMapoperation and AssignMessage in Apigee.
I am not sure if these are the right option to implement map path.I didn't get any example for this either.
The way you would think to do this would be to use the Assign Message policy and use the Set -> Path element. But this policy isn't currently working as designed for rewriting the proxy's target URL. See the Assign Message Guidance for more details.
To rewrite the incoming URL to a different target URL you can use the Assign Message Policy to set the entire URL (target.url) in the Target Endpoint flow, or you can use a JavaScript callout to set it. I chose to use a JavaScript callout because it gives a lot more control when rewriting the URL.
Here is an example project on Github I put together for this you can use to see how I did it. It uses the swapi.co api as the target endpoint. This proxy uses the Assign Message and JavaScript callout policies to rewrite the URL. Here's some details about it...
Proxy Endpoints
Create a proxy endpoint for each resource you are renaming.
This is where you setup the Assign Message policy to set the variables for the new path suffix.
Assign Message Policies
Set on the PreFlow of each proxy endpoint to set the targetPathSuffix and appendResourceIdToUrl (if needed) variables.
JavaScript Policy
Calls out to the URLRewrite.js file to execute the js code.
Set on the TargetEndpoints PreFlow and executes on each request
Uses the variables set in the Assign Message Policies to change the target.url variable.
I think Apigee can do it.
When I was started Apigee I have learned and try to understand from the picture below. (I think it is describe the main concept of this platform)
From your scenario,
You can specify the URL that you wants client to call maybe someurl.apigee/adminmanager or something else
Apigee is a middle also known as a Gateway. When you received the request from client, you can manage whatever you want. Of course, including pass your client to other URL like someurl.apigee/admn_resource_manager . (You just assigned new url to that request)
Because I'm not an expert as well so, you this link below can explain you more information.
Link:Using Flow Variables

fiddler autoresponder add latency rule not working

Using Fiddler I am trying to use the Autoresponder to add a rule that when I hit my web service url which is as per below:
http://uummas09:28020/RestfulRetekService/ItemWebService.json?action=keywordSearch&username=StockOnHandPortlet&sessionId=P_ISomGc6U5_433Vh3ApmwI&keywords=Green&itemStatus=A
I want fiddler to add latency of 50000 milliseconds (50 seconds). But I am having troubles getting fiddler to do that for me. Here is how I've tried to set up the rule in fiddler.
The rule is specified as...
EXACT:http://uummas09:28020/RestfulRetekService/ItemWebService.json?action=keywordSearch&username=StockOnHandPortlet&sessionId=P_ISomGc6U5_433Vh3ApmwI&keywords=Green&itemStatus=A
My first question is how can I wildcard the url in the rule so that it does not consider the query string?
Also I tried to get a rule to work for me for a simple url. i.e. I set a rule for
EXACT:http://www.google.com.au
but it still did not work for me. Can someone point me out to what I might be doing wrong.
thanks
To expand on #EricLaw's answer, to enable the auto-responder:
Check Enable automatic responses to tell Fiddler that you want to respond to requests.
Check Unmatched requests passthrough to tell Fiddler that you want any requests not matched by your rules.
Your rule won't cause a delay because rules aren't matched when they have a blank action to respond with, so if you only want to add a delay, use the *delay:1000 as the response, instead of a file path. You can get the latency to work by typing something like *action (which isn't a real action) to get it to match and cause the delay.
For those who are trying to delay HTTPS traffic, check that you trust your root certificate and capture HTTPS traffic.
You haven't checked the box at the top-left, Enable Automatic Responses, so none of your rules run.
To create a rule that ignores the query string, remove EXACT: from the front of the rule and delete everything after the ?.

Generate Get Request with No User Agent

I have a website that has been experiencing errors because of null references due to poorly coded logic regarding the user agent. Basically, there has been a slew of incoming requests that contain no user agent which leads to null reference exceptions in the user agent tracking. (It contained a call to "Request.UserAgent.ToLower()) I am correcting this logic to avoid the error condition. Since I'm certain these requests are coming from specialized tools and not ordinary users, I'm also blocking empty user agents via URL rewrite rules.
I need to test both of these changes. However, I can't seem to find a user agent spoofer that will enable me to generate a simple get request with NO USER AGENT. All of the tools that I have tried will allow me to do a custom agent string, but they won't let that string be left empty and there are no options that I can find to tell it to send no user agent.
So my question is, what tools are available, for a Windows-based system, that I can use to emulate a browser request with NO USER AGENT so that I can verify that my changes are working properly?
I believe that value is coming from the request headers. If yes, just try
Fiddler. Go to composer tab (see below) - by default it adds User-Agent to the request, however when you delete it in the Composer it seems to disappear from the request.

"the page cannot be refreshed without resending the information" with http post method but not with get why?

When i forward a request from within a post method, a confirmation alert appear
with a message "page cannot be refreshed without resending the information".
But this alert box doesn't appear when the forward is done from a get method.
What is the reason ?
Please help.
Because a POST, in the HTTP specifications, is intended for requests that are non-idempotent, because they modify state on the server (for example, by adding a new product to a category), that would be modified again if the request was resubmlited (it would create yet a new product in the category, for example).
A GET, on the other hand, is intended for requests that are idempotent. For example, a google search is idempotent. Searching twice for the same thing doesn't modify anything on the server, and resubmitting the same request doesn't have any unwanted effect.
The browser expects web applications to respect this convention, and thus warns the user about this unwanted side-effect before re-submitting a POST request.
The usual practice is to follow the post-redirect-get pattern to let the user refresh after a post without this annoying popup, and without unwanted side-effect.
Because a GET request includes those parameters in the URL (e.g. the URL ends with ?param1=foo&param2=bar). GET requests usually don't involve sensitive data or actions that change state of the server. From the URL, you know what you're sending.
With a POST, the parameters are "hidden", submitted in the background as part of your HTTP request, and you can't see them by looking at the URL. Those params cause the server to change state, and it could cause issues if that same data was transmitted twice (e.g. you'd accidentally purchase something twice from a web store). The browser lets you know in case you don't realize you'd be resending it.

Resources