Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Biztalk
|
Biztalk General discussion about Biztalk server.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Biztalk section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 26th, 2008, 01:12 AM
Registered User
 
Join Date: Aug 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Orchestration WS-call with “object” parameter

Hi,

I am working on a project where I need to call a remote WS from an orchestration.

I started out by adding a web reference to my orchestration but received the error “Failed to add Web Refernece”. I did some research about this issue but didn’t find a solution to the problem.

I then took another route by manually creating the proxy class via the wsdl.exe tool which in short gave me the following method signature:

public object Foo(ref string vReturn, object vXML)
{
object[] results = this.Invoke("Method", new object[] {
                    (object)vReturn,
                     vXML});
            vReturn = results[1].ToString();
            return ((object)(results[0]));
  }
}

Next I created a custom pipeline component to construct the multipart message required for the Web Service call

// private component method
IBaseMessage CreateMessage(Stream s, IBaseMessageFactory msgFactory, IBaseMessageContext context)
{
     IBaseMessage msg = msgFactory.CreateMessage();

     IBaseMessagePart part = msgFactory.CreateMessagePart();
     part.Data = s;

      msg.Context = context;

      //vReturn
      IBaseMessagePart vReturn = msgFactory.CreateMessagePart();
      byte[] firstPart =
System.Text.Encoding.UTF8.GetBytes(string.Format(" <string>{0}</string>", ""));
      vReturn.Data = new MemoryStream(firstPart);
      vReturn.Charset = "utf-8";
      vReturn.ContentType = "text/xml";
      msg.AddPart("vReturn", vReturn, false);


      //vXML
       msg.AddPart("vXML", part, true);

      return msg;
 }


I then configured the solicit-response SOAP sendport to use the GACed proxy class.

However I’m now getting the following error:

“Error Description: Failed to serialize the message part "vXML" into the type "Object" using namespace "". Please ensure that the message part stream is created properly.”

Any help to take me further is appreciated!

Regards,

//Ershad





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to INVOKE any WS on server by WS on client ? Abhinavnaresh ASP.NET 2.0 Professional 1 April 4th, 2008 01:09 PM
Using Parameter to call another template mikevn123 XSLT 1 October 27th, 2006 03:08 PM
Sending message to Biztalk Orchestration from WS debsoft Biztalk 0 September 2nd, 2005 05:23 AM
orchestration, dynamic call ivar Biztalk 0 February 14th, 2005 09:57 AM
urgent call exe with parameter from webform jainsaurabh78 Classic ASP Components 0 August 18th, 2004 02:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.