Rajeshwar
Rajeshwar

Reputation: 11661

If SOAP is HTTP independant and REST is HTTP Based then Why?

I was just curious , currently the address in my WSDL SOAP File is

 <wsdl:port name="MyPort" binding="tns:MyBinding">
            <soap:address location="http://localhost:87/SomeMethod"/>
 </wsdl:port>

Now since SOAP response is passed along with the HTTP response , Will i have to change the port from 87 to 80 while deploying the service ?? (The reason why i think this should be done because since SOAP is being tagged along with HTTP and HTTP is only available at port 80 I would appreciate it if someone could explain how this would work I know i am wrong here... )

Also Incase of rest i am testing my REST application using

curl http://localhost:6517/JerseyServer/rest/contacts

since REST runs over http ? How is it running over 6517 port ?? Is Tomcat acting as a proxy ? I am using Jersey??

Upvotes: 0

Views: 167

Answers (2)

Kevin Mangold
Kevin Mangold

Reputation: 1155

It is possible to run any service on any port--it's a matter of telling the service/application which port to listen to. 80 is the default port for HTTP. You could run email on ports 12345, HTTP on 443, FTP on 80, and HTTPS on 21... since these are not the default ports for the protocols, you will need to explicitly specify the port to connect to.

As fas mentioned, default ports are just a convention to avoid having to specify what port to go to when visiting google.com (or stackoverflow.com).

Upvotes: 1

fmucar
fmucar

Reputation: 14558

Http is a protocol. You can run it on any available port, it does not have to be 80 but 80 is just the default port used for http.

Upvotes: 4

Related Questions