Tuesday, August 27, 2013

BizTalk to SAP Connectivity Issue

Error :

Details:"System.ServiceModel.CommunicationObjectFaultedException: The communication object,Microsoft.Adapters.Internal.LayeredChannelBindingElement.LayeredInboundChannel`1[System.ServiceModel.Channels.IReplyChannel], cannot be used for communication because it is in the Faulted state.
   at System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout)
   at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.Close()"
This error occurs when biztalk is trying to connect to a SAP system to receive the IDOC
The reason for this error could be any of the following reasons.
1. There may be a problem with the SAP system. That time this error will coccur.
2. Also some times, if the SAP system is up and everything is fine. then we need to check in BizTalk
That please make sure that the Receive Timeout is given a maximum value.
I have faced an issue eventhough i gave a maximum value of 23:59:59 
After that i have tried it by giving 24.20:31:23.6470000 in this case i am able to connect to SAP and i am able to receive the IDOC

Sunday, August 25, 2013

.Xls as an attachment in BizTalk

How to receive a .xls file and add it as an attachment and to send it to a location ?

Foe that. we can use two methods..

* we can create a multipart message with the boday as a HTML email and the .xls file as an extra part of the  multipart message. The Type should be XmlDocument. Then we can use SMTP adapter and specify the multipart should be sent as attachment. Attach all the parts. we can specify this with the MessagePartsAttachments property -> MessageToBeSent(SMTP.MessagePartsAttachments)=2

*Also we can implement it by using a Custom Pipeline Component too.

But i would prefer to go by the first option. Which is quiet easy to implement.