Monday, January 31, 2011

FTP adapter issue: Unable to receive the file ""

I was working on a client application where I need to receive files from FTP server. The following are main points of this application
·         Based on the history I figured out the maximum size of file could up to 5KB (not to big).
·         A single host instance was created for the host specified as receive handler for FTP adapter.
Problem:
Duplicate files were getting received with the following messages in event log.
Event Type:     Warning
Description:
The adapter "FTP" raised an error message. Details "Unable to receive the file "<FileName>" from the FTP server.  The error that occurred was "A stream read or write operation failed because the stream is in an error state. ". ".
Event Type:     Error
Description:
There was a failure executing the receive pipeline: "Microsoft.BizTalk.DefaultPipelines.PassThruReceive, Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "Pipeline " Receive Port: "<ReceivePortName>" URI: "<URI>" Reason: Unable to receive the file "<FileName>" from the FTP server.  The error that occurred was "A stream read or write operation failed because the stream is in an error state. ".
I noticed that this error is occurring only when the number of files are more than 120 i.e. when the connection need to be opened for some long time. After going through the FTP log it seems as connection was getting terminated before all the files get transferred.
Work around:
After changing the Mode to ‘Passive’ the issue gets resolved.
Possible Cause:
One possible cause of it could be that the firewall is causing this error but I have not investigated the firewall settings yet.

Cheers
Rohit Sharma

Wednesday, January 26, 2011

Problem faced in consuming the orchestration exposed as WCF service in BizTalk server 2010

In BizTalk server 2010 I published an orchestration as WCF service using the ‘BizTalk WCF Service Publishing Wizard’. The orchestration gets published successfully. After configuring and starting the orchestration when trying to consume the WCF service, I was getting following errors:
In the client code consuming the WCF service exception was
The server was unable to process the request due to an internal error.  …
In the event log on the BizTalk machine:
Error:
There was a failure executing the receive pipeline: "Microsoft.BizTalk.DefaultPipelines.XMLReceive, Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Source: "XML disassembler" Receive Port:
The document specification ‘..’  from assembly ‘..’ failed to load. Verify the schema for this document specification is deployed and is in the Global Assembly Cache.
Warning:
The adapter "WCF-WSHttp" raised an error message. Details "System.TimeoutException: The service's security session did not receive a 'close' message from the client within the configured timeout (00:00:10)….
I verified that the assembly containing schema was deployed to GAC and I was facing the same issue after increasing the timeout value for Open,Send and Close for WS-Http receive location.
Solution
Based on the error received in the client code I tried to investigate the WCF service deployment in IIS 7. The actual problem was the application pool used for WCF service was using .Net Framework v2.0.50727 after changing it to v4.0.30319 the issue got resolved.
Cheers
Rohit Sharma

Exception: Root element is missing for a Metadata only endpoint for WCF-Http receive location


In BizTalk 2010 I created a WCF-WSHttp receive location. Then using the BizTalk WCF Service Publishing Wizard I created a meta data only endpoint, based on my WCF-WSHttp receive location and I added the required schema. The WCF service was created successfully. The application Pool used for this WCF service was configured using the identity having access to BizTalk databases.
When I tried to see the WSDL I got the exception: “Root element is missing”.
To resolve this issue I have to do the following two extra steps:
1.  Added the account used for application pool to BizTalk Server Administrators group
2. Added the following line to the Web.Config of WCF services created with the BizTalk WCF Service Publishing Wizard.
<system.web>
          <trust level="Full" originUrl="" />
<system.web>
For additional information refer to this MSDN link.

Cheers
Rohit Sharma