none
Call a WCF web service from an orchestration and wait for the result RRS feed

  • Question

  • Hi,

    we want to call a WCF web service from an orchestration and wait for the result and then take different actions for different results.

    Is this possible? I find a lot of discussions about this but the conclusions differ.

    According to this article it's not possible:

    http://www.packtpub.com/article/biztalk-server-standard-message-exchange-patterns-service-types

    Sounds great, right? Unfortunately, the BizTalk WCF adapters do not openly support the WSDualHttpBinding or callback contracts in general. Instead, we need to get creative through the use of dynamic ports or polling strategies to implement a general purpose, cross platform callback patterns and thus you CAN effectively use the WSDualHttpBinding within a BizTalk receive location, which is out of scope of this article.

    According to this article it looks like it is supported:

    http://www.packtpub.com/article/biztalk-server-standard-message-exchange-patterns-service-types  

    In this article the following is configured I'll be sending a request and receiving a response

    And it looks like it processes the result.

    We do have experience with with asmx web service and the result of these web services can be easily processed.

    Thanks,

    René 

     


    rt
    Friday, September 3, 2010 7:31 AM

Answers

  • Hi René,

    With synchronous I mean a webservice that receives a request and returns a response. The implemented webmethod has a return type instead of void, something like this:

    [Webmethod ......
    string MyWebMethod(string request)
    {
    
    }
    
    
    

    So if your webmethod returns something you would need a two way port in your orchestration.

     


    HTH,

    Randal van Splunteren - MVP, MCTS BizTalk Server
    http://biztalkmessages.vansplunteren.net

    Please mark as answered if this answers your question.

    Check out the PowerShell provider for BizTalk: http://psbiztalk.codeplex.com
    • Marked as answer by René Titulaer Wednesday, September 8, 2010 12:36 PM
    Friday, September 3, 2010 9:01 AM
    Moderator

All replies

  • Hi,

    Can you elaborate a little more on what you mean with "different actions for different results". What can you expect to be returned from the webservice? And what kind of actions do you want to do?

    In general I would say yes you can do whatever you want when the response comes back from the webservice.

     

     


    HTH,

    Randal van Splunteren - MVP, MCTS BizTalk Server
    http://biztalkmessages.vansplunteren.net

    Please mark as answered if this answers your question.

    Check out the PowerShell provider for BizTalk: http://psbiztalk.codeplex.com
    Friday, September 3, 2010 8:04 AM
    Moderator
  • Hi, thanks for your response.

    The WCF service can return  true or false. If true the orchestration should follow the success flow within that same orchestration, other wise the false flow.

    The problem we have is that it seems that orchestration calls the web service and then keeps executing the workflow without waiting for the result.

    Thanks,

    René 

     


    rt
    Friday, September 3, 2010 8:12 AM
  • Hi,

    If this is a synchronous webservice you can use a two way port in the orchestration. You connect a send and receive shape to the two way port. In this case the orchestration won't continue until a response is received. After

    If this is an asynchronous webservice (call back) you can use the listen shape. For more information see: http://msdn.microsoft.com/en-us/library/ee253551(BTS.10).aspx

    Does this answer your question?

     


    HTH,

    Randal van Splunteren - MVP, MCTS BizTalk Server
    http://biztalkmessages.vansplunteren.net

    Please mark as answered if this answers your question.

    Check out the PowerShell provider for BizTalk: http://psbiztalk.codeplex.com
    Friday, September 3, 2010 8:17 AM
    Moderator
  • Randel,

     

    what do you mean with: if this is a synchronous web service. In my opinion a web service is not synchronous or asynchronous by it self. The client determines if the service will be called synchronously or not.

    We have created the webservice ourself so we can modify it if needed. Do we need to decorate it with some attributes to support synchronous calls?

    Thanks,

    René


    rt
    Friday, September 3, 2010 8:45 AM
  • Hi René,

    With synchronous I mean a webservice that receives a request and returns a response. The implemented webmethod has a return type instead of void, something like this:

    [Webmethod ......
    string MyWebMethod(string request)
    {
    
    }
    
    
    

    So if your webmethod returns something you would need a two way port in your orchestration.

     


    HTH,

    Randal van Splunteren - MVP, MCTS BizTalk Server
    http://biztalkmessages.vansplunteren.net

    Please mark as answered if this answers your question.

    Check out the PowerShell provider for BizTalk: http://psbiztalk.codeplex.com
    • Marked as answer by René Titulaer Wednesday, September 8, 2010 12:36 PM
    Friday, September 3, 2010 9:01 AM
    Moderator
  • Thanks.

    It works now.

    The problem was that our WCF webservice didn't return anything. Now it does and it works like you said.

    Thanks again.


    rt
    Wednesday, September 8, 2010 12:36 PM