• Post Reply Bookmark Topic Watch Topic
  • New Topic

can we use servlet to webservice instead of (bean,ejb)

 
Kaleeswaran Karuppusamy
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please suggest me can we use servlet class for webservice?.i want to send file to server same time it should be web service.i decided to implement servlet class for file sending using request.getAttribute();if i use ejb or bean class i cannot access HttpRequestObject
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this the same problem you're asking about here?

I'm not sure what benefit you see in making this a web service -maybe you can elaborate on why you think that-, so let me just point out a few things:
  • All common web service stacks (like Metro and Axis2) are implemented as web apps, so they use servlets internally. There's no need for you to implement a servlet in order to use web services.
  • The SAAJ API has a feature called "SOAP Attachments". That can be used to send files through a web service.
  • request.getAttribute() doesn't help with handling files, but since you wouldn't implement a servlet -see the first point above- that point is moot anyway.

  •  
    Kaleeswaran Karuppusamy
    Ranch Hand
    Posts: 155
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Originally posted by Ulf Dittmer:
    Is this the same problem you're asking about here?
  • request.getAttribute() doesn't help with handling files, but since you wouldn't implement a servlet -see the first point above- that point is moot anyway.
  • [/list]


    sorry sir i mentioned wrong not request.getAttribute() its request.getInputStream() using servlet class.

    i will explain in details

    as i mentioned earlier i want to send wave file and doc file to server in same network and web service is mandatory for file sending.from our discussion i come to conclusion that i decided to use servlet for file sending in client side we can use URL class that is i decided to use HTTPS or HTTP protocol.but i should implement it as web service .

    how can we do?

    in my knowledge HTTP protocol is more scalable that why i willing to use it.

    please suggest me good solution for this..


    note :i am also not interested to disturb you with more reply and question.i am only have 2 yrs exp though i got responsibility for designing architecture and choosing right technology.same way i am working lot for this .William Brogden sir said "You appear to be thrashing around with various random ideas" its true i know various ideas and technology with lack of understanding.For this file sending requirement i have come across apache MINA framework ,EJB,RMI,networking,JMS finally i know these technology not suite for my requirement.i thanks to all to reply my question particularly Ulf Dittmer.
     
    Ulf Dittmer
    Rancher
    Posts: 42970
    73
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    web service is mandatory for file sending

    If you had mentioned earlier that using web services was a requirement we could have skipped all the talk about EJB, RMI, file servers and what not. In the future, please make sure to mention such relevant information.

    from our discussion i come to conclusion that i decided to use servlet for file sending in client side we can use URL class that is i decided to use HTTPS or HTTP protocol.but i should implement it as web service.

    So are you thinking about a proper "Web Service", using a web service protocol like JAX-WS, or would an HTTP file upload to a servlet be sufficient?

    in my knowledge HTTP protocol is more scalable that why i willing to use it.

    Please reconsider this. Yes, there is a performance overhead in using HTTPS, but unless you have shown HTTPS to be too slow you should not discard it on the theoretical possibility that it might be. Plus, the security considerations might well outweigh the performance considerations.

    You mentioned earlier that these are medical data files - you will need to take security very seriously, everywhere in the architecture, and you will need to do so right from the beginning, not as an afterthought later.
     
    Kaleeswaran Karuppusamy
    Ranch Hand
    Posts: 155
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    we would like to use web service with HTTPS protocol.

    please suggest right solution or good article to read..
     
    Ulf Dittmer
    Rancher
    Posts: 42970
    73
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    You could start by reading the articles "Transferring files over a web service" and "Sending SOAP attachments using SAAJ" that are linked in the http://faq.javaranch.com/java/WebServicesFaq

    Apart from that I'd start to become familiar with web services in general, install Axis2 or Metro, develop some sample services, etc.
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!