How to consume WSE 3.0 Secure Web Services in Biztalk 2009

Answered How to consume WSE 3.0 Secure Web Services in Biztalk 2009

  • Tuesday, April 20, 2010 1:36 PM
     
     

    I want to consume a third party WSE 3.0 Secure Web Services in my biztalk project.

     

    Can anybody help me out

    -Saeed


    Saeed

All Replies

  • Tuesday, April 20, 2010 3:34 PM
    Moderator
     
     

    Hi Saeed,

    I think this thread on the forum can help you.


    Regards,

    Steef-Jan Wiggers
    MCTS BizTalk Server
    http://soa-thoughts.blogspot.com/
    If this answers your question please mark it accordingly


    BizTalk
  • Tuesday, April 20, 2010 3:41 PM
     
     

    Thanks,

    Steef-Jan Wiggers

     

    I've seen this thread. This is about VS2008 simple .net project. I need to know this for Biztalk 2009 project.


    Saeed
  • Tuesday, April 20, 2010 5:17 PM
     
     

    Hi Saeed,

    The thread Steef mentioned will be surely enough to reply your query, however to answer your question as far as BizTalk 2009 project, you will have to follow the same steps to add a web reference outlined in the thread.

    Adding a web reference in a simple .net project and a BizTalk Project is one and the same thing in this case.

    Cheers

    Bali

    --------------------------------------------------------

    Mark As Answer or Vote As Helpful if this helps.

  • Tuesday, April 20, 2010 7:20 PM
    Moderator
     
     

    Hi,

    You can use the WCF adapter in BizTalk 2009 to consume WSE 2.0 or WSE 3.0 services. You will need to use a custom binding to provide the configuration for the adapter.

     


    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
  • Wednesday, April 21, 2010 11:46 AM
    Moderator
     
     

    Hi,

    Procedure to follow is best described in Consuming and Hosting WCF Services with Custom Bindings in BizTalk Server. You will as Randal stated need custom binding to consume the webservice, which you will have to configure when setting up send port. You are going to send request to WSE 3.0 enabled service and expect an response. If you want to setup environment to host this service yourself or build WSE enabled service and want to work with WSE and Visual Studio you will to setup a couple things as explained in this post How to use WSE 3.0 and VS 2008.

    HTH,

    Regards,

    Steef-Jan Wiggers
    MCTS BizTalk Server
    http://soa-thoughts.blogspot.com/
    If this answers your question please mark it accordingly

     


    BizTalk
  • Wednesday, April 21, 2010 12:53 PM
     
     

    Extremly Sorry guyes, I'm still unable to unserstand the process. Actually i've successfully call the web service in my VS 2008 VB project. Here are the details.

     I have to consume a third part WSE 3.0 secure web service. I installed WSE 3.0 on my computer. I enabled the WSE 3.0 Extension in my project and then added the web reference.

    I have following config file:

     <?xml version="1.0" encoding="utf-8"?>

    <

     

    configuration>

    <

     

    configSections>

    <

     

    section name="microsoft.web.services3" type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

    <

     

    sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >

    <

     

    section name="WSTest.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />

    </

     

    sectionGroup>

    </

     

    configSections>

     

    <

     

    microsoft.web.services3>

    <

     

    policy fileName="wse3policyCache.config" />

    </

     

    microsoft.web.services3>

     

     

    <

     

    applicationSettings>

    <

     

    WSTest.My.MySettings>

    <

     

    setting name="WSTest_com_abc_xyz_Recv" serializeAs="String">

    <

     

    value>https://third_party/ClientInterface/Recv.asmx</value>

    </

     

    setting>

    </

     

    WSTest.My.MySettings>

    </

     

    applicationSettings>

    </

     

    configuration>

     

    I've the following Policy file

     

    <

     

    policies xmlns="http://schemas.microsoft.com/wse/2005/06/policy">

    <

     

    extensions>

    <

     

    extension name="usernameOverTransportSecurity" type="Microsoft.Web.Services3.Design.UsernameOverTransportAssertion, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

    <

     

    extension name="requireActionHeader" type="Microsoft.Web.Services3.Design.RequireActionHeaderAssertion, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

    </

     

    extensions>

    <

     

    policy name="MyPolicy">

    <

     

    usernameOverTransportSecurity />

    <

     

    requireActionHeader />

    </

     

    policy>

    </

     

    policies>

     

    I've following code on my form.

     

    Private

     

    Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

     

    Dim o As New com_abc_xyz_RecvWse()

     

     

    Dim token As New Microsoft.Web.Services3.Security.Tokens.UsernameToken("uname", "pwdf", Microsoft.Web.Services3.Security.Tokens.PasswordOption.SendPlainText)

    o.SetClientCredential(token)

    o.SetPolicy(

    "MyPolicy")

    o.Timeout = 300000

     

    Dim xmlDoc As New Xml.XmlDocument()

    xmlDoc.Load(

    "C:\WSTest_5_Request.xml")

     

     

    Dim str As String

    str = o.Recv29(

    "xxxxx-xxxxxx-xxxxx-xxxxxxx", xmlDoc.OuterXml)

    TextBox1.Text = str

     

     

    End Sub

    It works perfectly. Actually this a test project. My actual task is to do the same work in one of my Biztalk Interface.

    Here are the points that are confusing my.

    1. How to create UsernameToken in WCF-Custom adopter and

    2. How to assign the policy to the Adapter.

     

    Thanks

     

    -Saeed

     

     

     

     


    Saeed
  • Wednesday, April 21, 2010 1:07 PM
    Answerer
     
     Answered

    WSE 3.0 and WCF are compatible across the wire. They both implement the same WS-Security protocols.

    The first thing you need to establish is what WS-Security protocols are being used by the third party web services e.g. Are they using transport or message security or both. What type of authentication is being used?  etc... The third party should provide a specification with this information.

    Once you have established this info you can use the WCF-Custom adapter, with appropriate bindings. If they are using WS-FederatedSecurity (SAML tokens, possibly), things get interesting but it this should still be workable. Check out this white paper: http://www.microsoft.com/downloads/details.aspx?familyid=a976dc7d-2296-4f88-be4d-0d314fca9e59&displaylang=en&tm

    You would have a similar issue if the third party used Java to construct their web services. You don't have to implement the same code stack on both ends, just use the same wire protocols.

    • Marked As Answer by Saeed Kamal Monday, April 26, 2010 11:46 AM
    •  
  • Wednesday, April 21, 2010 4:34 PM
     
     

    OK, i created the custom binding and getting the following error

     

    <soap:Fault xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Code><soap:Value xmlns:q0="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">q0:Security</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="en">Header http://schemas.xmlsoap.org/ws/2004/08/addressing:Action for ultimate recipient is required but not present in the message.</soap:Text></soap:Reason><soap:Node>https://thirdparty.com/ClientInterface/Recv.asmx</soap:Node></soap:Fault>

    Here is my custom binding

    <?

     

    xml version="1.0" encoding="utf-8"?>

    <

     

    configuration>

    <

     

    system.serviceModel>

    <

     

    client>

    <

     

    endpoint address=https://thirdparty.com/ClientInterface/Recv.asmx binding="customBinding" bindingConfiguration="RecvADTSoap12" contract="BizTalk" name="WcfSendPort_RecvADT_RecvADTSoap12" />

    </

     

    client>

    <

     

    bindings>

    <

     

    customBinding>

    <

     

    binding name="RecvADTSoap12">

    <

     

    textMessageEncoding messageVersion="Soap12">

    <

     

    readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />

    </

     

    textMessageEncoding>

    <

     

    security authenticationMode="UserNameOverTransport">

    <

     

    secureConversationBootstrap />

    </

     

    security>

    <

     

    httpsTransport />

    </

     

    binding>

    </

     

    customBinding>

    </

     

    bindings>

    </

     

    system.serviceModel>

    </

     

    configuration>


    Saeed
  • Thursday, June 03, 2010 9:40 PM
     
     

    Randal

    Based on your response, if I understand it correctly, you are suggesting that we CAN consume WSE 2.0 service from BizTalk 2009. Reason, I am asking this because we tried consuming WSE 2.0 service from BizTalk 2009 project in Visual Studio 2008 using various options like;

    1. Add Web Reference.

    2. Add Service Reference.

    3. Add Generated Items and then Consume WCF service

    And all the options failed at different level. Add web reference failed while adding the reference and the other 2 options failed at compile time. Wondering if we are missing some pre-requisite.

    Also, would really appreciate if you could suggest what binding would you use in Custom WCF adapter, at run time to call WSE 2.0 or WSE 3.0 service.

    Regards

    Vineet.