This is a biztalk question but probably an easy question for you C# guru's 
Author Message
 This is a biztalk question but probably an easy question for you C# guru's

I am new to C# and biztalk.... I downloaded the .NET toolkit for biztalk and
am trying the Interchange example that came with it.

When I execute the submit method everything works fine.  But when I try the
submitsync method I get an exception "Specified Cast is not Valid"
Can someone look at this code and tell me what I'm doing wrong.  I am very
grateful for your help.

BTSInterchange interchange = new
BTSInterchange(Microsoft.BizTalk.BTSInterchangeLib.BIZTALK_OPENNESS_TYPE.BIZ
TALK_OPENNESS_TYPE_NOTOPEN,"", "", "", "", "",
"ch_from_an_organization_convert837toECSIFv4", "", "", 0);

string responseDoc = "";
string strDirFilename = "C:\\Program Files\\Microsoft BizTalk Accelerator
for HIPAA\\Samples\\Claims Processing\\TestData\\837I.txt";

// Submit into BizTalk and obtain submission handle
string submissionID = interchange.Submit(CF.readFile(strDirFilename));

If I change this previous line to:
string submissionID = interchange.SubmitSync(CF.readFile(strDirFilename),
ref responseDoc);
then it works so I assume the 'Specified cast is not valid' message refers
to the 'ref responseDoc' .

I tried using
string submissionID = interchange.SubmitSync(CF.readFile(strDirFilename),
out responseDoc);
but this gave me a compiler error:

Here is the C++ and VB syntax from Microsoft:

[C++]
HRESULT SubmitSync(
    BIZTALK_OPENNESS_TYPE lOpenness,
    BSTR Document,
    BSTR DocName,
    BSTR SourceQualifier,
    BSTR SourceID,
    BSTR DestQualifier,
    BSTR DestID,
    BSTR ChannelName,
    BSTR FilePath,
    BSTR EnvelopeName,
    long PassThrough,
    VARIANT* SubmissionHandle,
    VARIANT* ResponseDocument
);
[Visual Basic]
object.SubmitSync( _
    lOpenness As BIZTALK_OPENNESS_TYPE, _
    Document As String, _
    DocName As String, _
    SourceQualifier As String, _
    SourceID As String, _
    DestQualifier As String, _
    DestID As String, _
    ChannelName As String, _
    FilePath As String, _
    EnvelopeName As String, _
    PassThrough As Long, _
    SubmissionHandle As Variant, _
    ResponseDocument As Variant _
)



Sat, 09 Oct 2004 09:04:12 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. probably an easy array, rand() question

2. Probably an easy or dumb question

3. Probably a easy question...

4. NEWBIE QUESTION PROBABLY EASY

5. IO performance C# Versus C++ (For C# GURU's only)

6. Real Fast 'n' Easy Question --

7. question for the guru's about data types

8. Question for the Guru's

9. A few questions for the real guru's

10. Guru's Question

11. A few questions for the real guru's

12. C#: Easy Thread Question !!

 

 
Powered by phpBB® Forum Software