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
|