0

I'm currently trying to test BizTalk with BizUnit but the documentation is dreadful. At the minute while waiting for a stable service I am looking at the WebServiceStep class.

I was wondering if anyone has an example on how to set up the soap body. I am trying to create the test in code (not xaml) so need to use the WebServiceStep.RequestBody.

I’ve thought about maybe having a class that inherits of DataLoaderBase but I am unsure on how to set up this correctly. Any help would be grateful.

So far i have the following code (minus a few angry coding rants):

  public static void ExecuteSoap(string url, string title, string space)
  {
        var test = new TestCase();
        var step = new WebServiceStep();

        step.ServiceUrl = url;
        step.FailOnError = true;

        step.SoapHeaders = new Collection<SoapHeader>();
        step.SoapHeaders.Add(new SoapHeader() 
        {
            HeaderName = title, 
            HeaderNameSpace = space 
        });

        // Error here because of DataLoaderBase being abstract
        // step.RequestBody = new DataLoaderBase(); 

        test.ExecutionSteps.Add(step);

        Execute(test);
 }

Also it's not important but if anyone has a better alternative to BizUnit I would be interested to here.

Thank you in advance,

Ankou

Ankou
  • 83
  • 1
  • 1
  • 10

1 Answers1

0

Try this:

FileDataLoader fileLoader = new FileDataLoader() { FilePath = "c:\Input\Employee.xml" }; step.RequestBody = fileLoader;

Depending upon your source of input xml, you can specify FileDataLoader, XmlDataLoader

Regards, Bharat Biyani