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 orchestrati开发者_高级运维on 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
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
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 ...]
attributePlus adjust the
WebService(Name="", Namespace="",...)
values to suit
This of course means that you can't just re-generate with the Wizard :-(
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!
精彩评论