locked
Messages with different base classes getting mixed up. RRS feed

  • Question

  • I have two seperate messages that are being confused on a Service Port. I have determined through code modification/trial and error that the port code that determines what message just arrived seems to only look at the DsspOperation and the TBody gnoring the TResponse type.

     

    I have 2 messages that inherit from:

    Microsoft.Dss.ServiceModel.Dssp.DsspOperation

     

    They are the following:

     

    Code Snippet

    public class Send : Submit<SendMessage, PortSet<DefaultSubmitResponseType,Fault>>

    ....

    public class Transaction : Submit<SendMessage, PortSet<ReceivedMessage, Fault>>

    ...

     

    [ServicePort]

    public class MessagingOperations : PortSet

    <DsspDefaultLookup,

    DsspDefaultDrop,

    HttpGet,

    Get,

    ReliableSubscribe,

    Subscribe,

    Open,

    Close,

    Transaction,

    Send,

    Received,

    Error>

     

     

    You will note that the difference in the definitions is only in the TResponse Type Parameter. If I compile and send a Transaction message as it is defined above it is decoded as a Send on the service port, and if I subsequently reply on the response port of that "send" successfully with a DefaultSubmitResponseType.Instance the other service waiting in a choice receives an Fault response that is absent of codes and description.

     

    If I change either the TBody type or change the DsspOperation to something else it operates correctly, that is to say a Transaction message is properly delivered to the Transition Handler and the Send Handler receives a proper Send message.

     

    These definitions work:

     

    Code Snippet

    public class Send : Submit<SendMessage, PortSet<DefaultSubmitResponseType,Fault>>

     

    // different DsspOperation

    public class Transaction : Upsert<SendMessage, PortSet<ReceivedMessage, Fault>>

     

    // different TBody

    public class Transaction : Submit<TransactionMessage, PortSet<ReceivedMessage, Fault>>

    >>

     

     

     

    Am I correct in my assumption that the ENTIRE type was used to determine the port the message is applied to? As it seems that it completely ignores the TResponse type.

     

    Bryan

     

    Wednesday, October 22, 2008 10:19 PM

Answers

  • Messages should be delivered based on the Body type and the DSSP Action. The response type is not considered.

     

    So if you have two operations based on Submit they must have different Body types or all the messages will be delivered to the first operation in the PortSet.

     

    If you want to use the same body contents, just declare two classes as wrappers that contain a common class. You don't have to add any extra fields to the wrappers so internally they will have identical structure.

     

    Trevor

     

    Friday, October 24, 2008 6:44 PM

All replies

  • Messages should be delivered based on the Body type and the DSSP Action. The response type is not considered.

     

    So if you have two operations based on Submit they must have different Body types or all the messages will be delivered to the first operation in the PortSet.

     

    If you want to use the same body contents, just declare two classes as wrappers that contain a common class. You don't have to add any extra fields to the wrappers so internally they will have identical structure.

     

    Trevor

     

    Friday, October 24, 2008 6:44 PM
  • Trevor

    Thanks. I could have sworn that I read somewhere that it was the entire type. If I ever come across that text again Ill make a note and let you guys know.

    Bryan

    Monday, October 27, 2008 12:11 PM