none
BizTalk WCF-HTTP adapter issues RRS feed

  • Question

  • Hi,

    I have a requirement where I need to post an excel file to an API (HTTP Post). No modifications to be done to the excel file and it needs to be posted as is. I'm using a File receive adapter (pass thorough pipeline) and a subscription on the send port to send it through. If I use HTTP adapter to send it, it succeeds. The issue is, we were asked to use NTLM authentication when posting the message and there is no option on the HTTP send adapter. So, we thought to use WCF-WSHTTP or WCF-BasicHTTP and configure this in Security tab. But when we try to transmit the message (Passthrough pipeline in send adapter as well), it fails with the below error:

    A message sent to adapter "WCF-WSHttp" on send port "SendKPIWCF-WSHttp" with URI "http://ServerName/PerfDashboardV2/IntegratedAPI/FileUploads/PostFile?FileType=0&FileName=FileName.xls" is suspended. 
     Error details: System.Xml.XmlException: Invalid character in the given encoding. Line 1, position 1.
       at System.Xml.XmlTextReaderImpl.Throw(Exception e)
       at System.Xml.XmlTextReaderImpl.InvalidCharRecovery(Int32& bytesCount, Int32& charsCount)
       at System.Xml.XmlTextReaderImpl.GetChars(Int32 maxCharsCount)
       at System.Xml.XmlTextReaderImpl.ReadData()
       at System.Xml.XmlTextReaderImpl.ParseXmlDeclaration(Boolean isTextDecl)
       at System.Xml.XmlTextReaderImpl.Read()
       at System.Xml.XmlReader.MoveToContent()
       at Microsoft.BizTalk.Adapter.Wcf.Runtime.BizTalkBodyWriter.ValidateStreamContainsXml(Stream stream)
       at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfMarshaller.CreateWcfMessage(CreateWcfMessageSettings settings)
       at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.SendRequestMessage(IBaseMessage bizTalkMessage, IRequestChannel channel)
       at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.SendMessage(IBaseMessage bizTalkMessage) 
     MessageId:  {2E63D5FF-AC9B-4921-9AA6-3CFC7E016A24}
     InstanceID: {259579DB-6C70-4DFB-BDE0-7F435782BEF0}

    Can you please help me in understanding this issue? First of all, I'm very unclear on why the XML Exception is thrown when we are trying to use Passthrough on the receive and send sides. Any help is highly appreciated. Thanks.

    Regards,

    Krishna Chaitanya

    Wednesday, February 20, 2013 3:41 AM

Answers

  • Thanks for the response. But is there anyway I can send Excel files (passthrough) not converting them into XML via HTTP POST and NTLM authentication? The HTTP adapter works and none other (WCF-WSHTTP, WCF-BasicHTTP, WCF-Custom) but the HTTP adapter does not have NTLM authentication option.

    And by this, these adapter expects only XML transmissions and no flat file or any other transmits can happen if we use them???

    Regards,

    Krishna Chaitanya

    No, you can't send Excel files (passthrough) not converting them into XML via HTTP POST and NTLM authentication.
    Friday, February 22, 2013 10:39 AM

All replies

  • This is an Adapter error and not a Pipeline Error. The WCF-WSHttp expects valid XML and it seems you are sending invalid XML. 

    If you enable Tracking on the Send Port you should be able to see the "XML" you tried to submit to the Adapter.

    Morten la Cour


    • Edited by la Cour Wednesday, February 20, 2013 9:04 AM
    Wednesday, February 20, 2013 9:03 AM
  • Thanks for the response. But is there anyway I can send Excel files (passthrough) not converting them into XML via HTTP POST and NTLM authentication? The HTTP adapter works and none other (WCF-WSHTTP, WCF-BasicHTTP, WCF-Custom) but the HTTP adapter does not have NTLM authentication option.

    And by this, these adapter expects only XML transmissions and no flat file or any other transmits can happen if we use them???

    Regards,

    Krishna Chaitanya

    Thursday, February 21, 2013 12:05 AM
  • Thanks for the response. But is there anyway I can send Excel files (passthrough) not converting them into XML via HTTP POST and NTLM authentication? The HTTP adapter works and none other (WCF-WSHTTP, WCF-BasicHTTP, WCF-Custom) but the HTTP adapter does not have NTLM authentication option.

    And by this, these adapter expects only XML transmissions and no flat file or any other transmits can happen if we use them???

    Regards,

    Krishna Chaitanya

    No, you can't send Excel files (passthrough) not converting them into XML via HTTP POST and NTLM authentication.
    Friday, February 22, 2013 10:39 AM