Search code examples
web-servicesbiztalkbiztalk2006r2

BizTalk web service to return a value rather than void + ref


Is there anyway to get the web service generated by the BizTalk Web Services Wizard for an orchestration to return a value, rather than it have a void return and it use return by ref ?

I'm trying to emulate an existing web service which is very simple ... the web method takes a string and returns a string ... public string MyTestMethod(string MyVal)

The proxy to the web service from the orchestration works, but the BizTalk wizard generates ... public void MyTestMethod (ref string MyVal)

I've tried the Advanced option, Force Request Response, but that doesn't seem to do anything


Solution

  • The only answer I found was to manually edit the ASMX.CS file that the BizTalk Web Service Publishing Wizard generates ...

    • Change the ElementName on the methods in parameter ... ([XmlElement(Namespace = null, ElementName = "XML")] string part)

    • Completely remove the ... [return: System.Xml.Serialization.XmlElementAttribute ...] attribute

    • Plus adjust the WebService(Name="", Namespace="",...) values to suit

    This of course means that you can't just re-generate with the Wizard :-(