C++ – way to group a set of soap methods logically in a “class” type entity

aircsoapweb services

For our large C++ based project we now have a method to automatically generate code to expose our code as SOAP methods. This works really well, and we are planning to start implementing an RIA based application using Adobe AIR / Flex based on the API's we have exposed.

The question I have is about organizing SOAP webservices. The code I have exposes individual method calls which in our C++ code belong to classes. Thus far I have named the exposed methods by prefixing them with the name of the class which they came from in C++. Ideally however, there would be a way to group methods logically within the SOAP service so that I wouldn't have to take this step and it would be possible to ask for the services in a particular group (AKA class) once you have bound to the SOAP services using the WSDL file in your target language.

I'd really like to be able to reproduce the class structure that lies behind the SOAP layer on the server side in our client applications. Right now, I can see that I could do this by using the method names to determine what class they belong to, but if I could separate them in a cleaner way I would prefer it.

Look forward to hearing what you SOAP gurus know about this matter.

Best Answer

I've spent the afternoon looking into this and it seems I have two options, both of which I have mocked up, and both of which work: I'm just unsure which is best now!

  • Separate the methods in different "services" grouped logically dependent on the class they came from. It is possible to include multiple SOAP "services" in the same WSDL file so they can still be discovered by clients by visiting only one URL.
  • Separate the methods into different "ports" on the same SOAP service.

I'm confused about which to use since according to the spec a port is "an abstract set of operations supported by one or more endpoints", whereas a service is "a collection of related endpoints". This suggests that the correct way to group together operations is by using ports.

Related Topic