HungryForKnowledge
HungryForKnowledge

Reputation: 289

Java client for C++ web service

Recently I came across a question while browsing over the internet which left me perplexed. The question is

Can a Java client talk to C++ Server using Web Service ?

I have seen the other way round, a Java Web service and a C# client for example. But no clue about this one. Also I have heard of gSOAP standard which is the industry standard for C/C++ web services. However, that does not answer my question.

Would like some insight into this.

Thanks Heena

Upvotes: 0

Views: 2585

Answers (3)

Bill Rosmus
Bill Rosmus

Reputation: 3011

SOAP is an industry standard for ALL languages. The document being sent with SOAP is XML which is text, so as long as the language has an XML parser to marshal and unmarshal the XML it will work. Java is well equipped as far as this goes.

In fact, if it is an kind of a programming language you don't even need a built in parser, you can write the parser code yourself if you are game. All it needs is the ability to read a file stream and the ability to access a network socket.

So yes, a Java client can talk to a web service running on a host that has been compiled with C# or C++ or C or whatever. As long as it is a standards based web service.

Java, can also communicate with C/C++ through native calls (via the 'native' Java libary), and can also talk to C/C++ using CORBA.

There are all kinds of options for Java and C/C++ to talk to each other.

Upvotes: 0

wulfgarpro
wulfgarpro

Reputation: 6934

If it's a SOAP based webservice, you can point a tool like wsimport at the services WSDL to generate your client side stubs.

Upvotes: 0

sics
sics

Reputation: 1318

Since nowadays the most so called web services are plattform and language independent - the answer is "yes". A java client can talk to a C++ Server via. Webservice. The most common techniques are

  • SOAP Simple Object Access Protocoll (Based on XML) or a
  • REST based Webservice

both normally use HTTP to manage the connection and the conversation.

Upvotes: 2

Related Questions