If you want to host a service, you just need to create it in AOT and to deploy its service group. AOS itself serves as WCF host.
If you want to consume a web service, the easiest way is to generate a managed proxy for the service - and the easiest way to do so is to use Visual Studio.
From your reply,i got to know that actually my requirement is to consume a web service which i have created and you told that it is necessary to generate a managed proxy.
From a high-level perspective, just create a class library project in Visual Studio, add reference to the web service and use the generated types from X++ via .NET Interop.
Well, of course you can communicate directly with HTTP, create and parse SOAP messages etc. But you would likely need external libraries anyway, so why not to simply call a managed proxy?
If you don’t want Visual Studio, use wsdl.exe - but you should have a really good reason why not to any such tool, they simplify the whole thing a lot. If you don’t want them, be prepared for much more work.
Web service is essentially a wrapper on AIF. Publishing as web service allows the underlying AIF to be called from web (http, soap etc). This way web service is called from disparate systems (ex - non Windows platforms such as Java etc).
AIF by default is file based integration mechanism. This can also be used for integration with disparate systems. But unlike web service, AIF can be used to bring in large volume of data.