Peter
nk4um
HowTo Build a SOAP Web-Service on NetKernel
| Poster | Content | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
nk4um Moderator
Posts: 755
|
The shipped version of NKSE 3.3.1 has a bug in the SOAP mode detection of the HTTP bridge. Please use the update service
to install the latest 2.2.4 version of the HTTP transport module.
Peter |
||||||||||||
|
nk4um Moderator
Posts: 755
|
Hi Jos,
Welcome to the forum and sorry for the delay in replying - we have been snowed under with the Architects Weekend and subsequent commitments. You are correct that to auto-generate the WSDL you need to supply the messageIn / messageOut fields. We need to be more polite if they are missing! The WSDL generator is an attempt to provide a helping hand to give a framework for a WSDL service description. It works on the idea of providing an intitial loose coupled service interface. If you need to tighten up the interface constraint then take the generated WSDL description and tighten up the embedded XSD for the message formats. You can then register this as the version to be served for the service description by adding a WSDL tag with the URI to your enhanced version. Hope this helps. Please keep posting questions. Cheers, Peter |
||||||||||||
|
nk4um User
Posts: 1
|
When I used snippits of the code on this page to create my HelloWorld soap interface (mui importante!), it seemed the soapservicemap
needs <messageIn/> and <messageOut/> tags in order for the ?WSDL to /not/ die a horrible death.
Is this a bug or a feature? btw. very interesting stuff, this NK. |
||||||||||||
|
nk4um Moderator
Posts: 755
|
I''ve posted a working module that implements this howto:
http://www.1060.org/resources/howto/soap-service/howto-soap-1.0.0.jar Add this module to your etc/deployedModules.xml and import into your front-end fulcrum as described in the howto. Also included in the resources/ directory in the module is a howto-test-client.idoc that calls the echo service - copy this to your workbench module. |
||||||||||||
|
nk4um Moderator
Posts: 755
|
Hi Carlos. Of course! I''ll package them up and post a link in this thread.
Also you''ve reminded me I should point out that this tutorial assumes the use of the latest mod-ws library v1.1.0 which we posted as an update earlier this week. More information available here: http://www.1060.org/forum/topic/149/1 |
||||||||||||
|
nk4um User
Posts: 54
|
Can you please post all the files for this example? I think they would make a great example of how easy simple web services
are on NK.
Carlos |
||||||||||||
|
nk4um Moderator
Posts: 755
|
HowTo Build a SOAP ServiceThis howto explains the steps to follow to build a SOAP web-service on NetKernel. SpecificationThe service will be exposed at a URL endpoint of: http:/localhost:8080/howto/soap/service The service will have one port that echos back the SOAP message it recieves. The port will have the SOAP action URI: urn:org:ten60:howto:soap:service:echo Recipe
Useful patterns and toolsThis howto shows how to connect an external SOAP service to an internal NetKernel implementation. The typical pattern for the internal implementation is to extract a message body part. Process it. Construct a new SOAP message. Set some body value and issue the message as the service''s response. The mod-ws module provides many utility tools for slicing and dicing SOAP messages without the pain of dealing with the XML directly. See for example wsSOAPGetBody for an ''extract by example'' tool to get at a SOAP body part. Documenting the ServiceIf you make a browser request for http://localhost:8080/howto/soap/service?DOC - you will see an auto-generated service description. When you call the endpoint with a ?DOC query parameter the HTTPBridge knows that this is a request for documentation and so it issues a request for service:wsDocumentation+[....]. Earlier we created a rewrite rule that mappted service:wsDocumentation to the active:wsDocumentation engine. With no arguments, this accessor simply styles the SOAP service map to a human readable HTML form. You can serve human readable documentation for each port by adding a doc tag to the port specification. Like int, this should provide the internal URI request to a script or service that provides an HTML document describing the port. Note this *must* be an active URI since, just like the wsSOAPServer, the wsDocumentation server issues the internal request for the URI but adds the action and endpoint arguments. If you have a strong stomach you can add a WSDL description by adding a ''wsdl'' tag to the main service description tag. This should point to the internal URI of the WSDL document. A request for http://localhost:8080/howto/soap/service?WSDL will serve this WSDL service description for the endpoint. WSDL has the unique distinction amongst standards as being a service metadata format that is invariably neither human nor machine readable - well done. Call me old fashioned but I think that a well written human readable HTML engineering specification can''t be beaten. Manualy configuring the HTTPBridge to use SOAP modeYou might prefer to control the public URL endpoint interface more specifically than relying on the default /soap/ match we used above. Here''s how:
|