none
Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException: The length of the value for the field exceeds the allowed valu RRS feed

  • Question

  • Recently we migrated from SAP .NET Connector to BizTalk Adapter Pack 3.0. One of our Web Application uses the adapter. There is a BAPI that sends IDOCs that have a longer than allowed value for one of its attributes. This causes the BizTalk Adapter to fail.

     

    The SAP .NET Connector truncates the value which is different from what BizTalk Adapter Pack is doing now.

     

    Is there a work around to say the BizTalk not to fail or truncates if it receives more than required length for an attribute?

     

    If not what would be the better approach to handle this error?

     

    Thanks

    Gnan

    Monday, October 27, 2008 2:32 PM

All replies

  • What is the error message you are seeing?

    Monday, October 27, 2008 3:32 PM
  • Has someone found a fix to this issue? I am experiencing the same issue alhtough only in certain cases.

    Basically, I have two receive locations that activate an orchestration to send a PORDCR101 IDOC to SAP. One listens at a SOAP adapter for a webservice and the other just monitors a folder for files of *.xml extension. This is the warning I get in the Event viewer.

    The adapter failed to transmit message going to send port "Snd_SAP_Outbound" with URL XXXXXXX. It will be retransmitted after the retry interval specified for this Send Port. Details:"Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException: The length of the value for the field exceeds the allowed value. Value: 7  Field: PRICE_UNIT Allowed value: 6

    This only happens when the webservice is used to supply the xml document. I have checked the restriction on the XSD schema and nowhere does it specify a maximum length for this element. I have used values ranging from 10.00 to 8000000.00 for the folder monitoring and they always work. The webservice only works for values between 0.00 and 999.00. I have even written the value I get from the webservice to file and it is exactly as for the folder receive location.

    Please help!!! I have a project going live very soon and this is a very confusing error to get. Especially when it doesn't logically make sense to me.

    Thanks,
    Jaco

    Monday, February 2, 2009 9:56 PM
  • The adapter doesnot allow you to send values of attribute of length more that the specified values and it doesnot truncate the value, it throws an exception. This is by design.

    A simple solution in biztalk will be to use an outbound map in the port sending the message to biztalk and  use a  functoid to trim out the extra characters from the attribute,  the value of which exceeds the specified value.
    Wednesday, February 4, 2009 9:51 AM
  • hello

    has anyfound a solution for this problem , we are having the same problem in production server, when trying to send IDOCS using SAP Adapter , one file is blowing and the error is

    Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException: The length of the value for the field exceeds the allowed value. Value: 68  Field: SNAME Allowed value: 60

    i checked the schema , the data type is string and there are no restrictions. The only anamoly is the data in the field where this error is occuring is a Surname field and it is having "@" symbol as part of the name for obvious reasons, but still this cant be the reason coz its a string datatype.

    Any information is helpful in this regard.

    Thursday, July 1, 2010 4:34 PM
  • I found the cause for these errors, in biztalk the node properties for SAP schemas are stored in a separate file that comes with each type of schema. This file is referenced in the main schema , so for that reason we cant see the restriction when we right click n see the node properties. To know the restriction, we have to open the node properties file and see for it, in our case

    we had a restriction like below:

    <xs:element minOccurs="0" maxOccurs="1" name="SNAME" nillable="true" type="xs:string">

            <xs:annotation>

              <xs:documentation>Employee's Name (Sortable by LAST NAME FIRST NAME)</xs:documentation>

              <xs:appinfo>

                <fieldInfo pad_char="0x20" pad_char_type="hex" justification="left" pos_offset="0" pos_length="30" xmlns="http://schemas.microsoft.com/BizTalk/2003">

                </fieldInfo>

              </xs:appinfo>

            </xs:annotation>

          </xs:element>

    which clears says that anything above 30 error outs. The data in our case was 35 characters, so it just failed at the adapter stage. i found this in another thread here:

    http://social.msdn.microsoft.com/Forums/en/biztalkr2adapters/thread/49e138be-21b9-4f2d-8336-5b47a191edaa

     

     

    • Proposed as answer by sirukumati Thursday, July 1, 2010 9:33 PM
    Thursday, July 1, 2010 9:32 PM
  • Hi All,

    Little uregent if some once respond: I'm also facing the same problem.

    Error1:

     The adapter failed to transmit message going to send port "SAPReqResponse" with URL "sap://CLIENT=100;LANG=EN;@a/xxx.com/00?GWSERV=sapgw00&ListenerGwServ=sapgw00&RfcSdkTrace=False&AbapDebug=False". It will be retransmitted after the retry interval specified for this Send Port. Details:"Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException: The length of the value for the field exceeds the allowed value. Value: 14  Field: MESTYP Allowed value: 6  :::::::::  

     Details:"Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException: The length of the value for the field exceeds the allowed value. Value: 14  Field: IDOCTYP Allowed value: 8      Value: 24  Field:                

    DATAHEADERCOLUMN_SEGNAM Allowed value: 10

    I DID THIS ---->

     This is the adapter error that is thrown. Then I looked at the SAP and BizTalk downloaded schema there is a difference of data types and lenght.

    Work Aorund: I have downloaded the schema from SAP and using a port map to send the messages and seems to be going well. But at send-rcv port getting the following error not sure what is this:

    The adapter failed to transmit message going to send port "SAPReqResponse" with URL "sap://CLIENT=100;LANG=ENfmdmdmom/00?ListenerGwServ=sapgw00&ListenerGwHost=abc.com&RfcSdkTrace=False&AbapDebug=False". It will be retransmitted after the retry interval specified for this Send Port. Details:"Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException: The Node with [local name = IDOC, namespace = , type = Element, value = ] was not expected. Ensure that your message xml validates against the operation schema.

     

     

     Regards,

     Basharat Ahmed

     Any help,
    Tuesday, November 23, 2010 8:57 PM
  • The difference in datatype lengths can be because .. you generated a different   version of the IDOC .

    Looks like ... you have generated a version 2 IDOC . Try genrating a version 3 IDOC instead and , see if it solves the issue .

     

    Regarding the port map (btw , U should nt be needing this , if you genrate the version 3 IDOC)-

    It looks like the map is not generating the correct XML message. You should try the Test map feature inside Visual studio and then try to validate the instance XML generated  as the output of the map , against the schema of the IDOC.


    Rohit Singh
    Friday, November 26, 2010 1:26 PM
  • Hi Rohit,

    Late to respond. But I did that once I notice that it is looking at Version 3. It worked then I need not use the SAP schema. Another issue is that EDI_DC40 has got all the restrictions where as EDI_DC doesn;t have (version 2)

    Getting into another issue where I can see the IDOCs lying in SAP with status 64. I'm expecting IDOC number back, where as the BizTalk send IDOC just deposits the IDOC in SAP. I need to get the IDOC number back to call another RFC that can trigger the back ground job and submit the IDOC and status chagnes to 53.

    ISSUE: When I make a call send idoc then i can deposit the IDOC in SAP and get the TID back (GUID) .. where as to invoke another RFC I need the IDOC NUMBER rather than GUID that is generated..

    I'm surely misssing something here?

    Regards,

    Ahmed

     

    Monday, December 6, 2010 9:12 PM
  • I think, if you prepopuate the DOCNUM field(I am not sure if you need to do this for just the control record or for every segment) in the the sent IDOC , then SAP uses the SAP IDOC number.  Have you tried using this approach ?
    Rohit Singh
    Tuesday, December 7, 2010 3:04 AM