WSDL - Document / Literal ( SOAP-MSG ) Example

To create a WSDL of type Document / Literal ( SOAP-MSG ), there are a couple of examples in wmusers, here is a simple one.

  1. Choose the folder you want to create the webservice and change the folder permission for Execute ACL to Default(inherited)
  2. Create a Document for input, could be any name (Ex: HelloRequest)
  3. Inside HelloRequest, create a document with the name, namespace prefix:Local name (Ex: nsp:HelloLocal).
  4. For the document nsp:HelloLocal, you need to set the XML namespace in the properties window (Ex: hello.com).
  5. Inside the document nsp:HelloLocal, you can have anything like String or another document (Ex: inputString).
  6. Create a Document for output, could be any name (Ex: HelloResponse).
  7. Inside HelloResponse, create a document with the name, namespace prefix:any name (Ex: nsp:HelloResp).
  8. For the document nsp:HelloResp, you need to set the XML namespace in the properties window (Ex: hello.com).
  9. Inside the document nsp:HelloResp, you can have anything like String or another document (Ex: outputString).
  10. By now you have created the Input Document and the Output Document.
  11. Create a flow service (Ex: Hello).
  12. In the properties window for the Namespace name enter the same namespace as for the documents (Ex: hello.com) for the Local name enter the same Local name entered for the Doc inside the input document (Ex: HelloLocal).
  13. Open the Input/Output tab for the flow and make a specification reference to pub.soap.utils:requestResponseSpec.
  14. Create the flow to extract the contents from the input document and create the output document.
  15. In the flow to convert documentToXMLString, the nsDecls input should be set to the namespace (Ex: nsp:hello.com)
  16. To create the WSDL, goto Tools - Generate WSDL
  17. Select Protocol: SOAP-MSG, Input: Document Type, select HelloRequest Output: Document Type, select HelloResponse
  18. Click Ok and save the WSDL.
  19. To test the WSDL, select a folder and create a Web Service Connector from the saved WSDL.
  20. Run the Webservice - in this case HelloLocal service.
  21. Pass the inputString a value and enter a WM username/password, you should be able to see the outputString as Hello with the inputString.

Attached is the package zip and WSDL.

Cheers,
Charly Jeganathan.

PS: Thanks to Mark Carlson, his Example really helped. Here is the link to his example.

[URL=“wmusers.com”][B]wmusers.com

HelloLocal.wsdl (3.18 KB)
DocLiteralWebServiceExample.zip (13.9 KB)

1 Like