0

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

SteveC
  • 15,808
  • 23
  • 102
  • 173
  • Not sure if you have tried making your inbound orchestration port two way? This will cause your service contract to be two way. However, rather than a string, you will be returning a string wrapped in a message. – tom redfern Jul 11 '11 at 13:41
  • It would seem this is "expected" behaviour. From ... [http://technet.microsoft.com/en-us/library/aa561644%28v=BTS.20%29.aspx] ... _If the request and response operations are the same Web message type, the input parameter becomes a ref and the return type is void_ – SteveC Jul 11 '11 at 15:25
  • This is not the behaviour I have observed when using the WCF service publishing wizard. – tom redfern Jul 11 '11 at 16:01
  • Tracking back down the stack, if I change the `part` in the generated ASMX.CS file `[return: System.Xml.Serialization.XmlElementAttribute(Namespace = null, ElementName = "part")]`, I get return `by val` rather than `by ref` – SteveC Jul 11 '11 at 21:04

3 Answers3

0

I know it's a quite old post, but just in case some else comes to it: I managed to do it as suggested by Tom Redfern above. It works perfectly if your inbound orchestration port is two-way.

In my case I had to expose an orchestration as WCF service where my orchestration receives a domain (e.g. "gmail.com") as input parameter, does some processing and at the end executes a stored procedure that fetches a list of e-mails belonging to that domain. So I had a "Domain" as input and "ListOfUsers" as output. Having my inbound orchestration port as "TWO-WAY" allowed me to receive a message of type "Domain" and output message of type "ListOfUsers".

Afterwards I could use "BizTalk WCF Service Publishing Wizard" and it generates it perfectly. Just had to adjust namespaces, port names, application pool and etc. and all good! Tried using SoapUI and works brilliant!

0

Are you trying to publish an Orchestration as a web service or Schema as a service?

Considerations while using the web service wizard : http://technet.microsoft.com/en-us/library/aa559660(BTS.20).aspx ... for 2006 R2

SteveC
  • 15,808
  • 23
  • 102
  • 173
VModi11
  • 173
  • 2
  • 7
0

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 :-(

SteveC
  • 15,808
  • 23
  • 102
  • 173