Unable to access party using send port AS2 Dynamic Send Port RRS feed

  • Question

  • Hi all,

    I want to send AS2EDI messages to multiple trading partners (url's). I use one dynamic send port with a AS2EDISendPipeline in it. I receive EDI messages from a Back End Application so I add a custom pipeline component to the EDIReceivePipeline to Create the AS2To context properties with the same name as AS2To (AS2-To) value in the AS2 Agreement. What I try I can't make it work. I see the AS2To property is filled with the right value before the AS2 Encoder component is executed. The AS2 Encoder component gives me the following error message (see below). I also tried to set the HTTP.UserHTTP.... context property following the MSDN site (AS2 Outgoing Messages) without success. Does anybody know what I forget ??? 

    This is a scenario that a lot of customers use I think because noone wants to create 1000 send ports and link them to the specific agreement. Please help me out with this issue. Soon we have to decide what option we gonna use in production. Option 1 : dynamicaly or static (1000 send ports). Option 2 is for maintance killing ofcourse.

    inmsg.Context.Write("AS2To", AS2PropertiesNamespace, strReceiverEAN);

    I use BizTalk Server 2010. 

    The less information about Agreement Resolution can you read here :

    I add a additional agreement resolver AS2To value with the exact same value as in my pipelinecomponent....

    A message sent to adapter "HTTP" on send port "SendPort_Dynamic_To_TradingPartner_AS2" with URI "http://localhost/VPN/BTSHTTPReceive.dll" is suspended. 

     Error details: There was a failure executing the send pipeline: "DX.Edigas.Pipelines.AS2EDISendPipelineCustom, DNWB.Edigas.Pipelines, Version=, Culture=neutral, PublicKeyToken=0a961ca07d86dcf4" Source: "AS2 encoder" Send Port: "SendPort_Dynamic_To_TradingPartner_AS2" URI: "http://localhost/VPN/BTSHTTPReceive.dll" Reason: Unable to access party using send port: SendPort_Dynamic_To_TradingPartner_AS2.  

     MessageId:  {3DF5B5E7-C64F-468F-869D-8FEB300A86EC}

     InstanceID: {5A01A6A6-E131-4282-BCED-22CBB5250928}

    Robert Rijsdijk. 


    Thursday, March 24, 2011 12:13 AM


All replies

  • Hi Robert,

    I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Friday, March 25, 2011 9:18 AM
  • Thank Wen-Jun that you wanna look at this issue. I did some investigation with the SQL Profiler to look what BizTalk is doing under water with the trading partner management tables. The only query I see is a query to get the agreement with the Send Port in the where clause. I expected to see first a query with AS2-To in it. So I thought why not change the port from Static to Dynamic in the table : tpm.SendPortReference to SendPort_Dynamic_To_TradingPartner_AS2 and it works :)). But the properties of the AS2 Agreement can't select anymore because I added a dynamic send port under water....... So I hope you can see in the Code of the AS2 Encoder pipeline component what is going to Resolve the Agreement on Context Property AS2To level.....That you don't have to select a Send Port cause you can't select a dynamic send port.

    See below the only query I found when I run my solution :

    exec sp_executesql N'SELECT
    [Extent1].[Id] AS [Id],
    [Extent1].[version] AS [version],
    [Extent1].[ProtocolSettingsId] AS [ProtocolSettingsId],
    [Extent1].[SenderId] AS [SenderId],
    [Extent1].[ReceiverId] AS [ReceiverId],
    [Extent2].[Id] AS [Id1],
    [Extent3].[Id] AS [Id2]
    FROM      [tpm].[OnewayAgreement] AS [Extent1]
    LEFT OUTER JOIN [tpm].[Agreement] AS [Extent2] ON [Extent1].[Id] = [Extent2].[SenderOnewayAgreementId]
    LEFT OUTER JOIN [tpm].[Agreement] AS [Extent3] ON [Extent1].[Id] = [Extent3].[ReceiverOnewayAgreementId]
    INNER JOIN  (SELECT [Extent4].[OnewayAgreementId] AS [OnewayAgreementId], [Extent5].[Name] AS [Name]
     FROM  [tpm].[OnewayAgreementSendPortReference] AS [Extent4]
     INNER JOIN [tpm].[SendPortReference] AS [Extent5] ON [Extent5].[Id] = [Extent4].[SendPortReferenceId] ) AS [Join3] ON [Extent1].[Id] = [Join3].[OnewayAgreementId]
    LEFT OUTER JOIN [tpm].[Agreement] AS [Extent6] ON [Extent2].[Id] = [Extent6].[Id]
    LEFT OUTER JOIN [tpm].[Agreement] AS [Extent7] ON [Extent3].[Id] = [Extent7].[Id]
    WHERE ([Join3].[Name] = @p__linq__0) AND ([Extent6].[Protocol] = @p__linq__1 OR [Extent7].[Protocol] = @p__linq__2)',N'@p__linq__0 nvarchar(4000),@p__linq__1 nvarchar(4000),@p__linq__2 nvarchar(4000)',@p__linq__0=N'SendPort_Dynamic_To_TradingPartner_AS2',@p__linq__1=N'as2',@p__linq__2=N'as2'

    Friday, March 25, 2011 10:56 AM
  • Hello Robert,


    Please refer to the following article:


    Writing AS2 Context Properties for Outbound Party Resolution

    Party resolution of outbound AS2 message can be performed using the AS2To context property or the AS2To property in the Http.UserHttpHeaders context property. However, BizTalk Server does not write the AS2To property to the context upon receiving an AS2 message. If you want to perform party resolution on the AS2To or UserHttpHeaders context property, you have to write a custom orchestration or a custom pipeline component to do so. This is required only if the send port is not linked to the party.

    In a custom orchestration, you can append AS2-To to the beginning of the existing Http.UserHttpHeaders context property using the following code:

    Copy Code

    Message_1(Http.UserHttpHeaders) = “AS2-To: MyPartner\r\n” + Message_1(Http.UserHttpHeaders);

    In a custom pipeline component, you can append AS2-To to the beginning of the existing Http.UserHttpHeaders context property using the following code. You need to append AS2-To to Http.UserHttpHeaders context property before the message is processed by the As2Encoder component.

    Copy Code

    string strName="UserHttpHeaders";
    string strValue = "AS2-To: MyPartner\r\n" + (string)baseMessage.Context.Read(strName, "");
    baseMessage.Context.Write(strName, "", strValue);



    The property that you need to promote is AS2-To  instead of AS2To(missing hyphen).


    Let me know if this works for you.




    Tuesday, March 29, 2011 9:39 PM
  • Hi Belinda,

    I copied the code from above article in my custom pipeline component but without success. Still the same error message :

    Reason: Unable to access party using send port: SendPort_Dynamic_To_TradingPartner_AS2.

    I see that the UserHttpHeaders is filled with AS2-To: <Partnername> but nothing is happening .....

    Can I please ask the BizTalk Development team what is happing exaclty in de AS2 Encoder pipeline component.


    Robert Rijsdijk.

    Thursday, March 31, 2011 1:13 PM
  • Hello Robert,

    Sorry for the delay in my response.

    Please note that I did engage an Escalation Engineer with the information that you had provided. It would be best if a paid support incident is opened since your question falls into a category which requires a more in-depth level of support.

    Please visit the below link to see the various paid support options that are available to better meet your needs.;en-us;offerprophone

    Thank you,

    Monday, April 18, 2011 6:01 PM
  • Hello, You may have forgotten to unlink the "SendPort_Dynamic_To_TradingPartner_AS2" port from the sender party. (Party properties/Send ports). Trying to send over this port having it linked to the Party will result in the error you are getting. Be sure also to specify which party is your local Biztalk one, and setting the AS2-To should complete the job.
    C# + BizTalk2009 Developer
    Monday, May 2, 2011 9:22 PM
  • Dynamic Send Ports can't be linked to a Party or Agreement. So I don't have a link to the objects. I wish I could link it to a Party :)



    Robert Rijsdijk

    Wednesday, May 18, 2011 8:19 AM
  • True. Therefore, the "Unable to access party using send port.." error can occur regardless of the port being static or dynamic.


    C#/BizTalk 2010 Developer
    Wednesday, May 18, 2011 2:26 PM
  • Did you get this resolved yet? Could you let me know the work around?


    Thanks and Regards, Vikram
    Wednesday, May 25, 2011 3:39 PM