Results 1 to 7 of 7
  1. #1
    slorde is offline Member
    Join Date
    Mar 2009
    Posts
    3
    Rep Power
    0

    Default Problems to build a Java Client to consume a C# WebService

    Hello Fellows,

    I'm having a big trouble with a WebService written in C#. I made one client in C# and it works fine, I just have to instantiate the objetct CookieContainer and call the Logon method, after this, I can call the other methods with no problems.
    But, whit a Java client, I don't have the object cookieContainer. So I can logon sucessufuly, but I can't call any other methods, because I get a error message that I have to logon first, I realize that the error is because I don't have the cookieContainer, so I can't maintain the session with the WebService.

    There is some object similar to cookieContainer in Java?

  2. #2
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    Yes, you need to find a Web service toolkit for Java. Try Google. Netbeans may have the support built in...

  3. #3
    slorde is offline Member
    Join Date
    Mar 2009
    Posts
    3
    Rep Power
    0

    Default

    Hi,
    The client was build in NetBeans. But I don't know how to maintain the session :(

  4. #4
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    I see what you are getting at. Web services were originally designed to not maintain state. Of course, no one would accept that, so state support has been added in whatever way the server side decided. Apparently, ASP.NET supports state using cookies.

    All I can suggest is that you look at the Java Web Services Reference Implementation site. There is support for session state, but I don't know about compatibility with ASP.NET...

  5. #5
    slorde is offline Member
    Join Date
    Mar 2009
    Posts
    3
    Rep Power
    0

    Default

    Thanks Steve,
    I will take a look at it.

  6. #6
    lorien is offline Member
    Join Date
    Apr 2013
    Posts
    1
    Rep Power
    0

    Smile Re: Problems to build a Java Client to consume a C# WebService - to resolve this

    Set this code prior to call thing the service:

    // Preserve session cookie
    ((BindingProvider) port).getRequestContext().put(BindingProvider.SESS ION_MAINTAIN_PROPERTY, Boolean.TRUE);

  7. #7
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,641
    Rep Power
    7

    Default Re: Problems to build a Java Client to consume a C# WebService

    lorien, welcome to the forums. Please take note of the date of the original post - this is over four years old! What many call a zombie thread which typically - as is the case here - get locked after resurrection.

Similar Threads

  1. Replies: 3
    Last Post: 06-24-2010, 02:38 AM
  2. WebService Client
    By pravin2008 in forum NetBeans
    Replies: 3
    Last Post: 07-23-2008, 02:48 PM
  3. Replies: 0
    Last Post: 05-18-2008, 09:24 PM
  4. create a Java Client to consume WEBSERVICES XML SOAP
    By Felissa in forum Web Frameworks
    Replies: 2
    Last Post: 05-16-2008, 07:42 AM
  5. Writing webservice client
    By javaplus in forum Web Frameworks
    Replies: 0
    Last Post: 12-19-2007, 11:10 AM

Posting Permissions

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