IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#TechXchangePresenter
 View Only
Expand all | Collapse all

Calling WebService in WebMethods from a NET Client with Basic Authentication

  • 1.  Calling WebService in WebMethods from a NET Client with Basic Authentication

    Posted Thu March 16, 2006 07:45 PM

    Hi,
    I have a IS webService exposed to a third party and need to do basic authentication before we accept request. Other party use .Net.

    We have created our custom SOAP handler for authentication as desribed in webMethods documentation.

    I don’t know .Net, if anyone has any sample of sending authentication information while executing webService from .Net will be very helpful. Need to test if it work with IS. My webService and SOAP processor has given TNPartner ACL.

    Thanks
    Bibek


    #soa
    #webMethods
    #API-Management


  • 2.  RE: Calling WebService in WebMethods from a NET Client with Basic Authentication

    Posted Thu March 16, 2006 08:47 PM

    You didn’t mention which .Net language was being used to consume your web service.

    For C# you would instantiate a NetworkCredential and use it on your web service call. This C# code fragment shows how to create a NetworkCredentials object and add it to a CredentialCache associated with two different URLs (soapEndpoints when you are working with web services).

    [highlight=c#]
    NetworkCredential myCred = new NetworkCredential(
    SecurelyStoredUserName,SecurelyStoredPassword,SecurelyStoredDomain);

    CredentialCache myCache = new CredentialCache();

    myCache.Add(new Uri(“www.contoso.com”), “Basic”, myCred);
    myCache.Add(new Uri(“app.contoso.com”), “Basic”, myCred);

    [/highlight]

    Once you have created your CredentialCache you need to add it to your web service stub. If your web service stub was called “ws”, the following code would do that:


    ws.Credentials = myCred
    ws.PreAuthenticate = True


    #API-Management
    #soa
    #webMethods


  • 3.  RE: Calling WebService in WebMethods from a NET Client with Basic Authentication

    Posted Mon March 20, 2006 07:50 PM

    Hi,

    We are using VB.NET for this and now we are getting the exception:

    We did all the steps for authentication described as in :
    SOAP_Developers_Guide_6.5.pdf – Chapter - 7

    We gave TNPartner ACL to both to our SOAP processor and service.

    But our partner says they get the exception and we also see it in server log as:

    [ISS.0088.9134] Exception occurred while processing the body of the message

    We change “watt.server.SOAP.enforceMsgPartNS=false” according to some old service request in advantage but no luck. We are using Integration Server V-6.5 in IBM AIX 5.3.


    #soa
    #webMethods
    #API-Management


  • 4.  RE: Calling WebService in WebMethods from a NET Client with Basic Authentication

    Posted Mon March 20, 2006 10:13 PM

    You should see some other error message in the error or server log that indicates what exception is occuring. It could be simply a authentication issue in which case you should see an “access denied” error in the IS server or error log.

    It could also be that your authentication is working fine but the Flow service is throwing some type of exception.

    Does the service work when you set the ACL for your custom soap processor to Anonymous?

    Have you taken the very basic troubleshooting step of capturing the request and reply soap messages using a tool like PocketSoap TCPTrace?

    If so, the SOAP response message will contain additional error details in the soap fault element.

    Mark


    #webMethods
    #API-Management
    #soa


  • 5.  RE: Calling WebService in WebMethods from a NET Client with Basic Authentication

    Posted Tue March 21, 2006 08:46 AM

    Hi,
    The service work fine with Anonymous ACL. Interestingly when I try from our internal network using the VS .Net 2005 it works. But it does not with 2003.


    #webMethods
    #soa
    #API-Management


  • 6.  RE: Calling WebService in WebMethods from a NET Client with Basic Authentication

    Posted Tue March 21, 2006 02:34 PM

    Well, that would seem to point to how the client is calling your service rather than an issue with the ACL or the service itself.

    Capture the soap request including the HTTP headers to see what is being sent.

    Mark


    #soa
    #webMethods
    #API-Management


  • 7.  RE: Calling WebService in WebMethods from a NET Client with Basic Authentication

    Posted Tue March 21, 2006 02:48 PM

    Hi,
    It worked today. The WS client is not working properly and they are not using the new soap rpc processor. This is the reason why it was not working.

    Thanks


    #soa
    #webMethods
    #API-Management


  • 8.  RE: Calling WebService in WebMethods from a NET Client with Basic Authentication

    Posted Tue March 21, 2006 02:55 PM

    So, they were using an incorrect URL and not pointing to your custom soap processor?


    #webMethods
    #soa
    #API-Management


  • 9.  RE: Calling WebService in WebMethods from a NET Client with Basic Authentication

    Posted Thu February 14, 2008 05:21 AM

    Does anyone know if wm 7.1 is going to make every service callable from .NET withot creating a wrapper?


    #webMethods
    #soa
    #API-Management


  • 10.  RE: Calling WebService in WebMethods from a NET Client with Basic Authentication

    Posted Thu February 14, 2008 10:37 PM

    Is your question related to the webMethods Microsoft Package or to the original topic of this thread which was calling IS-provided web services from a .Net consumer?

    Mark


    #webMethods
    #API-Management
    #soa


  • 11.  RE: Calling WebService in WebMethods from a NET Client with Basic Authentication

    Posted Thu February 14, 2008 11:56 PM

    The latter.

    Only yesterday did I figure out that to call a webservice from .NET with Basic HTTP auth i had to create a SOAP processor.


    #soa
    #API-Management
    #webMethods


  • 12.  RE: Calling WebService in WebMethods from a NET Client with Basic Authentication

    Posted Fri February 15, 2008 04:57 AM

    Can you provide more details? Are you using doc/lit or soap/rpc? What .Net language and version? Did you set the pre-authenticate = “true”?


    #API-Management
    #soa
    #webMethods


  • 13.  RE: Calling WebService in WebMethods from a NET Client with Basic Authentication

    Posted Tue February 19, 2008 12:41 AM

    I got it working, by setting up a custom SOAP processor as described in the SOAP Dev guide.

    I was using C#, .NET 2.0, soap/rpc. PreAuth = true. All works fine.

    My point is that it won’t work out of the box. You must create a special SOAP processor on the IS, for it to work with .NET & Authentication.


    #webMethods
    #soa
    #API-Management


  • 14.  RE: Calling WebService in WebMethods from a NET Client with Basic Authentication

    Posted Wed June 02, 2010 09:31 PM

    Guys,
    I am also facing same problem. I tried Mark’s suggestion, but Credentials method is not there for the stub. So not able to do "ws.Credentials = myCred ".

    jtu100,
    Could you please tell me what to put in the SOAP processor. What logic is required out there.

    C# client call works for Anonymous ACL. I am using Visual studio 2008 and webMethods 7.12.

    Thanks,
    Sid

    It’s done. I fgured out the process.
    In visual studio 2008, way to add web reference is changed. Add service reference, Click Advance…, click Add web Reference. this will add web reference in the project.

    Add following to call a webservice,
    Creete stub
    ICredentials icred = new NetworkCredential(uerid,password);
    obj.Credentials = icred;
    Console.WriteLine(stub.method name());
    Console.ReadKey();

    In webMethods 7.x, wrapper/ Custom SOAP processor is not required to handle authentication from .net based clients.

    Thanks,
    Sid


    #soa
    #webMethods
    #API-Management