SOAP header authentication for Jade web services

Forums for specific tips, techniques and example code
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

SOAP header authentication for Jade web services

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:47 pm

by Bronson Blackmore >> Wed, 29 Oct 2003 23:51:38 GMT

Hi all,

I'm trying to figure out how to implement SOAP header authentication for my jade web services (Jade 6.0.17).

Specifically I am wanting to pass in a username/pw via the SOAP headers and then authenticate this in my Jade code. Has anyone done this?

Thanks,

Bronson

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: SOAP header authentication for Jade web services

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:47 pm

by dcooper@jade.co.nz >> Fri, 31 Oct 2003 1:30:06 GMT

To define SOAP headers in JADE:

Define a class representing the data in a particular SOAP header as a subclass of the JadeWebServiceSoapHeader class. Make sure that the soap header direction is defined an input-output (on the Web Services sheet of the Define Class dialog). Add properties to this class as required; for example, usercode and password.

To process SOAP headers in JADE:

In your Web Service class, add a property reference to the SOAP header class (that you defined above). For each Web Service method that you want the SOAP header to apply to, use the Web Service Options menu item (from the Methods menu) to add the SOAP header to the method.

The generated WSDL will now contain enough information for your web service client to create and process the SOAP headers.

Note that in JADE 6.0.17, the JADE Web Service Client (aka Consumer) is a beta release and does not support the processing of SOAP headers. However if your Web Service (Provider) application receives a SOAP header, a transient instance of the appropriate SOAP header class will be created and the property in your Web Service class that references this header will be set up to refer to this object. Your code only needs to reference this object (making sure you check for a null value) and retrieve the property values of the object in the usual way. If your SOAP header is defined as input-output, then the Web Services framework will also generate the appropriate SOAP headers in the message that is sent back to the client.

You may also want to check out the documentation on using session handling and secure services.

Cheers,
Lather.


Return to “Tips and Techniques”

Who is online

Users browsing this forum: No registered users and 12 guests

cron