Please ignore post, I have no idea what I am talking about.
Amit G Piplani
Joined: Jul 21, 2004
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?
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
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