Monday, February 23, 2015

Must receive before sending a message whose messagetype corresponds to a requestresponse operation on an implemented port




The above error occurred in an Orchestration, in which following scenario was to be orchestrated: the process gets started after receiving message over the RequestResponse port (HTTP based) followed by transformation to the destination format and sending out the transformed message to destination system. If all is ok then response message is to be sent back to RequestResponse with status as Processed and if something goes wrong then response message is to be sent back to RequestResponse with status as Failed and Error message.


Based on this, below Orchestration is designed:



As an exception was to be handled so Scope with TransactionType None was added followed by Exception Handler. So flow looked simple and straight forward:

1. Receive Input Message
2. Transform to destination format 
3. Send transformed message to destination system
4. Construct response message and send Positive response back
5. If an exception occurs in above steps then catch it in Exception Handler
6. Construct response message and send negative response back including exception message

All looked good, until it was compiled and error was notified.


Why it happened:

As can be interpreted from error message, there was mismatch found in the number of Request received to the number of Responses sent to the RequestResponse port. Although the flow logically appears correct but syntactically it is not. RequestResponse port requires a pair (one receive and one response) to get successfully validated, so while compiling when first send shape (connected to response operation) is found it gets validated (for compiler pair is completed), and going down in Exception block when second send shape (connected to response operation) is found it throws an error as no matching receive shape is found to complete the pair.



What to do:

In actual, there is if else situation depending on which Response message is to be sent with respective status associated with it. And even compiler loves this segregation as only one condition at a time will be true thus only one pair will form which is valid.
Below is the redesigned Orchestration:


The changes done :

1. Added a Boolean variable _exceptionOccurred initialized with false.
2. In Exception block _exceptionOccurred  is set to true, so whenever exception occurs the variable will be true

3. Then Decide shape is placed under Exception block

4. So if value of variable is false(NoException) then Response message with status processed ok is constructed and sent to requestresponse port

5. And if value of variable is true then Response message with status failed is constructed and sent to requestresponse port



Wondering if there is any other way to handle this scenario?




Must receive before sending a message whose messagetype corresponds to a requestresponse operation on an implemented port(Second approach)


The issue was due to two response sent against single request on requestresponse port and for that I wrote a post : http://tech-findings.blogspot.com/2015/02/must-receive-before-sending-message.html  but was curious to find if there is another way to do this and Deepak Sanghi commented on the link which I shared  on LinkedIn , about the another approach to handle this scenario.


It made sense, and I tried it. Below is the modified orchestration


Changes  done as below:

1.   Receive Input Message
2.   Transform to destination format
3.   Send transformed message to destination system
4.   Construct positive response message (but not sent)
5.   If an exception occurs in above steps then catch it in Exception Handler
6.   Construct negative response message  including exception message (but not sent)
7.   The last thing is to place a send shape which sends response

So depending upon the scenario either of the positive response or negative response will be created but wouldn't be sent immediately instead it is sent at last after evaluating the exception.




Related Post:



Friday, February 13, 2015

A schedule 'OrchestrationName' with parameters cannot have an activatable receive

Scenario is simple, I receive a message and depending upon value present in the distinguished field I had to call a child Orchestration, which will do its intended job and return me back the result (Synchronous call). Below is what I encountered:



Why it happened:


As can be seen from image below, I had created an Orchestration Parameter (although by mistake ;) ) .




So what’s wrong in this?

The error says that if you have defined an Orchestration parameters then it can’t have a receive shape with Activate property set to true.

Why So?

Defining parameters is allowed only in the Orchestration which are to be started/called(Child) from some other Orchestration(Parent). Thus the invocation of such orchestrations does not happen with the Receive shape which is looking out for the message it is configured to, instead it is based on the parameters which is defined in it. So if there is requirement where an Orchestration needs to serve as child orchestration then remember you can't use receive shape to start the process and where an Orchestration is supposed to be started by Receive shape, you can't define parameters.

What if I need to call A->B and B-> C,  B is parent to C?

In this case it will work provided that Activation set to false—that is, only orchestrations that are invoked from another process—will be available for selection, as B is child orchestration to A and it gets instantiated with parameters so even though it is parent to C, it is not activated by Receive shape.


What to do:

Remove the parameter else you won’t be able to compile as having a parameter in Parent orchestration which is instantiated with Receive shape contradicts to the way it is designed to work.  


Monday, February 9, 2015

RPC:0x800706D9: There are no more endpoints available from the endpoint mapper.

Today, it was the BizTalk admin console trying to play with me,  when I opened the admin console, found that am not connected to any BizTalk group.

Seeing this, I tried to join the existing group:
1. Right click the BizTalk Server Admininstration 
2. Connect to existing group
3. Provided the Server name and Database name
4. And clicked ok
5. Got couple of following error
 

6. When trying to refresh the BizTalk Group Node
7.As expected while trying to restart host instance, following error was popped out:



Why it happened: 

There are few scenarios where we can face such errors:
  • Enterprise Single sign on is not installed correctly
  • Enterprise Single sign on in not configured properly/correctly
  • Enterprise Single Sign on service is  not running(not started)

What to do:

Verify that Enterprise Single Sign On Service is running, Run->Services.msc->Enterprise Single Sign On and  check if status is Started
"Enterprise Single Sign-On Service" gets installed while installation of BizTalk and it is there we have to specify the user account name, under which this service will run. That user account should have administrative privileges on the machine else SSO service will not start. And It is mandatory to have as all the configurations are stored in it.
In my case it  was the change in the password (which was part of company policy) which made this service stop and group unavailable. So I needed to reset the credentials for this service.

For that
1. Right click 
2.Go to LogOn  Tab
3. Update the credentials 
4. Click ok
 
5.Start the service