Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HttpConnectionURL

 
Amit G Piplani
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
can anyone help me why should i use HttpConnectionURL instead of using SOAP?

Reagrds,
Amit
 
Jayesh Lalwani
Ranch Hand
Posts: 502
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to use HTTPCOonnectionURL is your trying to communicate with non-SOAP servlets. I might be misunderstanding your question. What are you trying to do?
 
William Barnes
Ranch Hand
Posts: 986
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One is a transport and the other is a protocol.
 
Amit G Piplani
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
At my server end, developer has deployed 1 operation as EJB and one Operation as a web service.
So i can SOAP to access WebService, but to access EJB (he is recommending me to use HttpURLConnection).
That too, i have to manually create XML from data Transfer Obejcts and send it to EJB using OutputStream.

Won't sending XML through HttpURLConnection will cause a performance problem as XML is very big and we have to take crae of creating and then parsing response XML?

Any Suggestions.

Amit
 
William Barnes
Ranch Hand
Posts: 986
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> At my server end, developer has deployed 1 operation as EJB and one Operation as a web service.

Well that isn't very nice.

> Won't sending XML through HttpURLConnection will cause a performance problem as XML is very big and we have to take crae of creating and then parsing response XML?

Not sure how HttpUrlConnection with XML would be any slower than using a socket connection and SOAP.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the service is exposed as an HTTP transport with a url that starts "http://" then you will be using HttpURLConnection automatically. See the java.net.URLConnection and related classes docs.
So the only question is whether you create the connection in your own code or let the SOAP toolkit do it. There will be no difference - SOAP has no magic method for sending XML.
Bill
 
Jayesh Lalwani
Ranch Hand
Posts: 502
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having trouble understanding this. Why can't he just give you the EJB remote stub for you to call? I've never heard anyone call an EJB by passing XML over HTTP. Maybe that's something new that I don't know about

Second, a SOAP message is XML that is sent over HTTP. The SOAP message has to be parsed using XML. You may not be doing it, but the SOAP library will do the parsing for you. So, everything else being equal, SOAP shouldn't be slower or faster than XML over HTTP (unless the SOAP message is much larger than the XML, ofcourse). In fact SOAP is commonly called as XML over HTTP
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic