Web Service Considerations for Data Types and Variable Names
A published business service class is the foundation for creating a web service. The web services description language (WSDL) is an XML-based language that describes a web service. The WSDL describes all methods of the published business service as well as the input and output value objects for these methods. All classes that make up the highest-level value object are included in the WSDL description. For example, for the Procurement Manager web service, the operations that the WSDL exposes are processPurchaseOrder, getPurchaseOrder, and processPurchaseOrderAcknowledge. All value object classes that are associated with these operations are defined in the WSDL as well.
All classes that are used within a published business service must have a unique name, which you should consider when you reuse value objects across published business services. Member variable names within the published business service value object class must be unique if they are of different object types. For example, the hierarchy of ProcessPurchaseOrder contains two classes representing financial data—one at the header level and one at the detail level. The header and detail are represented by unique classes because they are structured differently. Because both header and detail belong under the interface ProcessPurchaseOrder, the variable name referencing these object types must be unique; for example, financial and financialDetail.
The requirement for using unique variable names applies only to classes that have the same parent value object. You are not required to use unique variable names across value object classes. For example, both ProcessPurchaseOrder and ProcessPurchaseOrderAcknowledge have a header class, but the header classes are structured differently. Both of the member variables representing these classes can use the name header because they belong to different parent value objects. Classes that can be reused, such as PurchaseOrderKey, can have the same variable name across value objects.
The following examples show uniquely named classes that have member variables that are named the same:
Type |
Member Variable Name |
---|---|
ProcessPurchaseOrder PurchaseOrderHeader PurchaseOrderKey Integer String String UserReservedData String Integer BigDecimal Calendar PurchaseOrderFinancial PurchaseOrderDetail PurchaseOrderFinancialDetail |
header purchaseOrderKey documentNumber documentCompany documentType userReservedData userReservedCode userReservedNumber userReservedAmount userReservedDate financial detail financialDetail |
Type |
Member Variable Name |
---|---|
ConfirmProcessPurchaseOrder ConfirmPurchaseOrderHeader PurchaseOrderKey Integer String String UserReservedData String Integer BigDecimal Calendar ConfirmPurchaseOrderFinancial ConfirmPurchaseOrderDetail ConfirmPurchaseOrderFinancialDetail |
header purchaseOrderKey documentNumber documentCompany documentType userReservedData userReservedCode userReservedNumber userReservedAmount userReservedDate financial detail financialDetail |
Type |
Member Variable Name |
---|---|
ProcessPurchaseOrderAcknowledge PurchaseOrderAcknowledgeHeader PurchaseOrderKey Integer String String UserReservedData String Integer BigDecimal Calendar PurchaseOrderAcknowledgeFinancial PurchaseOrderAcknowledgeDetail PurchaseOrderAcknowledgeFinancialDetail |
header purchaseOrderKey documentNumber documentCompany documentType userReservedData userReservedCode userReservedNumber userReservedAmount userReservedDate financial detail financialDetail |
Type |
Member Variable Name |
---|---|
GetPurchaseOrder PurchaseOrderGetHeader PurchaseOrderKey Integer String String UserReservedData String Integer BigDecimal Calendar PurchaseOrderGetFinancial PurchaseOrderGetDetail PurchaseOrderGetFinancialDetail |
purchaseOrderGetHeader purchaseOrderKey documentNumber documentCompany documentType userReservedData userReservedCode userReservedNumber userReservedAmount userReservedDate financial detail financialDetail |
Type |
Member Variable Name |
---|---|
ShowPurchaseOrder PurchaseOrderShowHeader PurchaseOrderKey Integer String String UserReservedData String Integer BigDecimal Calendar PurchaseOrderShowFinancial PurchaseOrderShowDetail PurchaseOrderShowFinancialDetail |
header purchaseOrderKey documentNumber documentCompany documentType userReservedData userReservedCode userReservedNumber userReservedAmount userReservedDate financial detail financialDetail |