tags:

views:

294

answers:

3

One of my co-workers is developing SOAP API for php application and he is wondering if CamelCaps names are some kind of convention for SOAP methods?

Our current API has lower_caps_and_underscores, but it seems somewhat strange when compared with random subset of other SOAP APIs, and we wouldn't really want to annoy consumers of API with our wrong convention.

+2  A: 

In almost all standard SOAP API, I have seen, had CamelCaps. You may want to look standard SOAP API. i.e. google SOAP api

I think so Underscore may annoy users. You can follow either of them however more important is to follow any single standard naming conventions.

Other important thing to consider for naming a service is, naming should clearly establish a meaning and a context of the what service will do in a particular context.

i.e.

GetCustomerHistoryById = Get a single customers history by id
GetCustomersHistory = Get all customer's history

Sun
+1  A: 

What language are you developing in (not that it matters)?

From my experience lower_with_underscores seems to be the preferred style for PHP development, but CamelCase seems to be more generally used.

Just a thought

Greg B
A: 

For SOAP, you see either Pascal Casing or Camel Casing. The SOAP namespace is Pascal Cased (soap:Envelope anyone). I guess what you use depends on where you draw the line.

In general, I use Pascal Casing for Methods and Properties. These two elements embody the framework of the contract. Bearing this in mind, I would likely have SOAP elements that correspond to Methods and Properties Pascal Cased.

As for parameters and return values, I would have to think about breaking the Pascal casing rule and using camel casing there. Fortunatley, I am not building a SOAP API right now, so I have time to think about it.

I would not go with something outside of Pascal or Camel casing, however, as it is non standard. Not that I think people would say "I am not using YOUR API because it uses non-standard naming", but just as a matter of convention. But, then, people who buck convention often come up with the next new trend in development. ;-)

Gregory A Beamer