Results 1 to 3 of 3

Thread: Integrate with WebSphere Web Service in .Net

  1. #1

    Thread Starter
    Hyperactive Member Krokonoster's Avatar
    Join Date
    Jan 2010
    Location
    Cape Town
    Posts
    448

    Integrate with WebSphere Web Service in .Net

    Hi,

    I’m using .Net, C#...the usual.

    Got a client web service to implement (WebSphere, not exposing wsdl, soap…was a total pain to get it working since I know near to nothing of any of these)

    I eventually got to use the service by instead of adding a service reference, adding a web service reference.
    Because the service does not expose its wsdl, but the client supplied me the wsdl file, I specified the file path as service location, and then edited the app config.

    All working fine, until the client had to add security today and I now have to specify a username and password to call their service and I’m clueless.

    A few extract from the client’s IT guy’s mails for what it might help (mostly greek to me):
    • “We are going to secure the services using the industry standard WS-Security User Name Token”
    • “Use the following credentials for the WS-Security UNT”


    All I really can do here is supply my “demo code” which worked before the security have been added on their side:

    App.Config:
    Code:
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <configSections>
            <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
                <section name="ABCD.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
            </sectionGroup>
        </configSections>
        <startup> 
            <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
        </startup>
        <applicationSettings>
            <ABCD_Login.Properties.Settings>
              <setting name="ABCD_Login_AccessControlService_AccessControlService"
                    serializeAs="String">
                <value>https://aaa.bbb.com/something/SecurityFacadeService/AccessControlService</value>
              </setting>
            <ABCD_Login.Properties.Settings>
        </applicationSettings>
    </configuration>
    Program.cs
    Code:
    var client = new AccessControlService();
    bool validUser = client.validate(username, password);
    But now I have no clue where and how to set the username / password for calling the service (not the username / password for the validate method)

    Anyone? Big Please!


  2. #2
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Integrate with WebSphere Web Service in .Net

    Shouldn't they alter their web service to take credentials ? In a server/client environment, its not the client's responsibility to provide security, its the server's.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  3. #3
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,226

    Re: Integrate with WebSphere Web Service in .Net

    This is pretty standard in a lot of ecosystems.

    What happens is that you receive a token string based on your credentials.
    Then you send this token string with every webservice call you make. Your client.validate(username, password); method will return a token. This token will be used for the other calls.

    Ask the client to supply you with a new wsdl, one that accepts tokens and you should be set.
    Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
    save a blobFileStreamDataTable To Text Filemy blog

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width