欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

RosettaNet Configuration Bug:Value cannot be null

程序员文章站 2022-04-21 15:39:51
...

最近发现在配置RosettaNet时候,总是报错: Value cannot be null.很郁闷,因为没办法调出UI配置Agreement,只好在数据库里修改 TPA 信息.

不死心找bug, 反编译Microsoft.Solutions.BTARN.AdminSnapin.dll, 跟踪调试,发现在

public ProcessConfiguration(string displayCode)
        {...

this.fieldActivityProperties.ActivityName = values.Get("Activity_Name");

时候报错:value cannot be null.

 

检查BTARNConfig..PIPConfig表Data字段,发现少了Activity_Name字段,

<key name="Activity_Name" value="Notify of Consumption" />

 

检查Hotfix History,发现原来是打过KB938839 Hotfix,需要更新BTARNConfig数据库.详见KB938839 ,

 

Update_BTARNConfig_PIPConfig.sql

 

USE [BTARNCONFIG]
GO

BEGIN TRANSACTION updatePatch
    SET ANSI_NULLS OFF
    GO

    SET QUOTED_IDENTIFIER ON
    GO

    DECLARE @ActivityName   nvarchar(300)
    DECLARE @lengthPart1    bigint
    DECLARE @nameExists    int
    DECLARE @PIPID        int
    DECLARE @PIPName    nvarchar(256)
    DECLARE @stringPart1    nvarchar(4000)
    DECLARE @stringPart2    nvarchar(4000)
    DECLARE @totalLength    bigint
    DECLARE @totalString    nvarchar(4000)    

    DECLARE data_cursor CURSOR
    FOR SELECT ID,Name,Data FROM dbo.PIPConfig

    OPEN data_cursor

    FETCH NEXT FROM data_cursor
    INTO @PIPID,@PIPName,@totalString

    WHILE @@FETCH_STATUS=0
        BEGIN
            SELECT @nameExists=CHARINDEX('Activity_Name',@totalString)
    
            IF (@nameExists = 0)
                BEGIN

                SELECT @lengthPart1=(CHARINDEX('<key name="Activity_Type"',@totalString)-1),@totalLength=DATALENGTH(@totalString) 

                SELECT @stringPart1=SUBSTRING(@totalString,1,@lengthPart1),@stringPart2=SUBSTRING(@totalString,@lengthPart1+1,@[email protected])

                SET @ActivityName='<key name="Activity_Name" value="'[email protected]+'" />'
    
                SET @[email protected][email protected]

                UPDATE PIPConfig
                SET data[email protected][email protected]
                WHERE [email protected]
                
                END

            FETCH NEXT FROM data_cursor
            INTO @PIPID,@PIPName,@totalString
        END

    CLOSE data_cursor

    DEALLOCATE data_cursor

COMMIT TRANSACTION updatePatch

--------------------------------------------

 

附 PIPConfig Data

<?xml version="1.0" encoding="utf-8"?>
<NameValueCollection>
    <key name="PIP_Code" value="4B3"/>
    <key name="PIP_Description" value="&quot;The &quot;&quot;Notify of Consumption&quot;&quot; Partner Interface Process supports consumption notification within a consignment inventory management process where &#xD;&#xA;-The supplier ships product to a consigned warehouse location based upon receipt of demand forecast and t"/>
    <key name="PIP_DisplayCode" value="TI_STD_4B3_V01.00"/>
    <key name="PIP_InternalID" value="1011"/>
    <key name="PIP_messageStandard" value=""/>
    <key name="PIP_Name" value="Notify of Consumption"/>
    <key name="PIP_nonRosettaNet" value="False"/>
    <key name="PIP_payloadBindingID" value=""/>
    <key name="PIP_Standard" value="RosettaNet"/>
    <key name="PIP_standardVersion" value=""/>
    <key name="PIP_Version" value="V01.00"/>
    <key name="Activity_Name" value="Notify of Consumption"/>
    <key name="Activity_Type" value="Notification"/>
    <key name="Activity_IsSingleAction" value="True"/>
    <key name="Activity_IsSynchronous" value="False"/>
    <key name="Activity_NonRepudiationOfReceipt" value="False"/>
    <key name="Activity_TimetoAcknowledge" value="7200"/>
    <key name="Activity_TimetoPerform" value="86400"/>
    <key name="Activity_Retrycount" value="3"/>
    <key name="Activity_IsAuthorizationRequired" value="False"/>
    <key name="Activity_NonRepudiationofOriginandContent" value="False"/>
    <key name="Activity_IsPersistentConfidentialityRequired" value="None"/>
    <key name="Activity_IsSecureTransportRequired" value="True"/>
    <key name="Initiator_Role" value="Consumption Notification Provider"/>
    <key name="Initiator_RoleDescription" value="The party that creates and sends consumption information to Supplier."/>
    <key name="Initiator_RoleType" value="Organizational"/>
    <key name="Initiator_Service" value="Consumption Notification Provider Service"/>
    <key name="Initiator_ServiceClassification" value="Business Service"/>
    <key name="Initiator_Action" value="Consumption Notification Action"/>
    <key name="Initiator_BusinessDocument_Name" value="Consumption Notification"/>
    <key name="Initiator_BusinessDocument_Description" value="The Consumption Notification contains consumption information includes product identification, quantities; consumption dates, and may include payment reference number and purchase order number."/>
    <key name="Initiator_BusinessDocument_Version" value="V01.00"/>
    <key name="Responder_Role" value="Consumption Notification User"/>
    <key name="Responder_RoleDescription" value="The party that requires consumption information from the customer to manage inventory"/>
    <key name="Responder_RoleType" value="Organizational"/>
    <key name="Responder_Service" value="Consumption Notification Provider Service"/>
    <key name="Responder_ServiceClassification" value="Business Service"/>
    <key name="Responder_Action" value="Consumption Notification Action"/>
    <key name="Responder_BusinessDocument_Name" value="Consumption Notification"/>
    <key name="Responder_BusinessDocument_Description" value="The Consumption Notification contains consumption information includes product identification, quantities; consumption dates, and may include payment reference number and purchase order number."/>
    <key name="Responder_BusinessDocument_Version" value="V01.00"/>
</NameValueCollection>

转载于:https://www.cnblogs.com/upzone/archive/2008/08/27/1277248.html