To create a WSDL of type Document / Literal ( SOAP-MSG ), there are a couple of examples in wmusers, here is a simple one.
- Choose the folder you want to create the webservice and change the folder permission for Execute ACL to Default(inherited)
- Create a Document for input, could be any name (Ex: HelloRequest)
- Inside HelloRequest, create a document with the name, namespace prefix:Local name (Ex: nsp:HelloLocal).
- For the document nsp:HelloLocal, you need to set the XML namespace in the properties window (Ex: hello.com).
- Inside the document nsp:HelloLocal, you can have anything like String or another document (Ex: inputString).
- Create a Document for output, could be any name (Ex: HelloResponse).
- Inside HelloResponse, create a document with the name, namespace prefix:any name (Ex: nsp:HelloResp).
- For the document nsp:HelloResp, you need to set the XML namespace in the properties window (Ex: hello.com).
- Inside the document nsp:HelloResp, you can have anything like String or another document (Ex: outputString).
- By now you have created the Input Document and the Output Document.
- Create a flow service (Ex: Hello).
- 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).
- Open the Input/Output tab for the flow and make a specification reference to pub.soap.utils:requestResponseSpec.
- Create the flow to extract the contents from the input document and create the output document.
- In the flow to convert documentToXMLString, the nsDecls input should be set to the namespace (Ex: nsp:hello.com)
- To create the WSDL, goto Tools - Generate WSDL
- Select Protocol: SOAP-MSG, Input: Document Type, select HelloRequest Output: Document Type, select HelloResponse
- Click Ok and save the WSDL.
- To test the WSDL, select a folder and create a Web Service Connector from the saved WSDL.
- Run the Webservice - in this case HelloLocal service.
- 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)