Article on Web Services in Domino 8 (Wednesday, May 16)

There’s a new Domino Web Services article on developerWorks today: Engineering WS-I compliant Web Services for IBM Lotus Domino V8.

Even if you’re not specifically interested in trying to make your Domino Web Services fully WS-I compliant, there are some great tips and gotchas in there, including:

  • Web Services created on Notes/Domino 8.0 will not work on Domino 7 (however, the D7 Web Services work just fine on D8).
  • Using arrays as method parameters in D7 only works when using the RPC/Encoded format (all formats work properly in D8). They do show a very interesting workaround using imported WSDL, though.
  • Another workaround is to use a custom class as a parameter, with an array as a public member of the custom class (see below). However, in D8 a custom class that has an array as its only member is treated as an array in the WSDL, not as a proper complex data type (there has to be at least one other public member variable).
  • Custom SOAP Fault subclasses are not returned properly in D7 (although they are in D8).
  • Remember to set the server to “Run web agents concurrently” (I always forget that this isn’t default behavior).

Regarding arrays as parameters using custom classes/complex data types, here’s how I like to set that up:

Class PhoneNumbers
    Public phoneNumberArray() As String
    Public count As Integer
End Class

Class DirectoryAssistance
    Public Function reverseLookup (nums As PhoneNumbers) As NameList
    End Function
End Class

I mention this type of setup in one of my web services articles. The nice thing about this structure is that it’s easy for the client to determine whether or not an array that is a return value is empty (count=0) or not — you can decide for yourself if you want to enforce proper “count” values on the server side when accepting the class as a parameter.

Luckily, it also seems to have the fortunate side-effect of making the arrays work properly as method parameters for WSDL formats other than RPC/Encoded. I need to do some more testing to confirm, but I don’t remember having problems before, and the new “WS-I Compliant Web Services” article seems to say that it’s true.

[ permalink ] [ e-mail me ] [ read/add comments ]

Speak Your Mind