none
Error Posting idocs from Biztalk to SAP After migrating from NON-WCF SAP Adapter to WCF Adapter RRS feed

  • Question

  • Here is how it went in NON-WCF SAP adapter when i used to post to SAP if the field lenghh allowed is lets say 100 and the actual field contains more than 100 lets say 120 it would truncate it to 100 and post to SAP. But after migrating to WCF SAP adapter the truncation is not done automatically and it is throwing an error

    Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException: The length of the value for the field exceeds the allowed value. Value: 100  Field: BELNR Allowed value: 70

    Server stack trace:
       at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
       at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
       at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
       at System.ServiceModel.Channels.ServiceChannel.EndRequest(IAsyncResult result)

    Exception rethrown at [0]:
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at System.ServiceModel.Channels.IRequestChannel.EndRequest(IAsyncResult result)
       at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result)

    i can truncate this using a functiod in Biztalk map but my concern is i cannot do it for each and every field as its going to be unimaginable working on each and every field.

    My other question is

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

      <xs:annotation>
      <xs:documentation>IDOC document number</xs:documentation>
      <xs:appinfo>
      <fieldInfo pad_char="0x20" pad_char_type="hex" justification="left" pos_offset="0" pos_length="35" xmlns="http://schemas.microsoft.com/BizTalk/2003" sequence_number="16" />
      </xs:appinfo>
      </xs:annotation>
      </xs:element>

    How is the length 35 being defined and how it is truncated in NON-WCF SAP Adapter and why it is not truncating in WCF SAP Adapter is there a way to make it automatic like earlier. Please let me know if anyone got the solution or need further information from me.

    Regards,

    Venkat.

    Wednesday, June 9, 2010 4:14 PM

Answers

  • The WCF-SAP adapter doesn't truncate the the data.

    The old adapter used the flat-file assembler pipeline to convert the IDOC into flat-file.  It used to send the incoming flat-file as-is to the SAP system  by calling  IDOC_INBOUND_ASYNCHRONOUS on the SAP system and passing the incoming flat file as parameter.

    The flat- file assembler pipeline component seems to truncate the fields excedding the allowed length.

    The same can  be acheived with the WCF-SAP adapter by using the generic idoc send operation.

    This MSDN tutorial can help in migrating the old SAP IDOC projects to WCF-SAP adapter without the need of regenrating the schemas-

    http://msdn.microsoft.com/en-us/library/cc185213(v=BTS.10).aspx

    Wednesday, June 9, 2010 5:01 PM