Web Service Styles
The SOAP standard offers a wide selection of various styles and flavors when it comes to the actual encoding of the SOAP message payloads. When a web service is published by Genus, a WSDL supporting the "document/literal wrapped" binding style is generated.
The "document/literal wrapped" binding style is also preferred when consuming an external Web Service. However, for legacy reasons, the "RPC/literal" style is also supported.
See also: Which style of WSDL should I use?
Document / Literal Wrapped Style Web Services
When publishing a web service, certain guidelines should be followed to ensure that the .NET Framework (and other programmable platforms) is able to generate code that is easy to use on the client side.
Guidelines when defining a "document/literal wrapped" XML Schema:
- Prefer using elements over attributes and name the elements using PascalCase, i.e. the first letter in the name and the first letter of each subsequent concatenated word are capitalized. Names should only contain the following characters: a-z, A-Z, 0-9, or _.
- Optional elements are specified by setting minOccurs="0" and keeping maxOccurs to its default value of "1". Additionally, if the referenced type is a complex type or string, set nillable="true". If the client is able to represent simple nullable types, like the .NET Nullable
type, you should also specify nillable="true" for these elements. - When you need to define a collection (containing zero or more instances) you must provide a wrapper element, with attributes as an optional element (see above). This wrapper element must refer to a named type. That type must be defined as a complex type containing a sequence of an element. That inner element must have minOccurs="0", maxOccurs="unbounded". Do not set nillable on this element. When sending or returning XML containing such collections, always include the wrapper element, even if it contains no elements.
RPC/Literal Style Web Services
To consume a web service published with a RPC/Literal style binding, you need to implement some adjustments to the XML schema defined in Genus Studio.
- After configuring a Web Service Reference for the external web service, you can preview the XML schema message definitions generated for the operations.
- Note that each message definition contains the comment: "This XML schema was generated by Genus Apps in order to support handling of RPC/Literal style operations". Genus Apps does not natively support the RPC/Literal style, but you may use this XML schema to communicate with the external Web Service.
- From the message definition preview, export the generated schema to file. Schemas from imported namespaces are included in separate tabs.
- In the Directory tree, click the Schemas folder and create a new schema by importing the file exported in the previous step.
- You should now be able to consume a web service using the Consume a Web Service- effect without specifying the SOAP message encoding.
Web services running RPC/Encoded style (as opposed to RPC/Literal style) is only partially supported.