-Magnus- Super Contributor.
Super Contributor.
2324 views

Signature example?

I'm a n00b on java soap coding and needs to create a signature with soap. I have created the loginRequest w. ssl but I can't handle the signature response...

Is there an example of creating signatures ?

regards
/magnus
Labels (1)
0 Likes
2 Replies
Anonymous_User Absent Member.
Absent Member.

Re: Signature example?

Below is a Java example creating an HTML signature:

{
com.novell.groupwise.ws.CreateSignatureResponse m_SignatureResp = new CreateSignatureResponse();
Signature m_Signature = new Signature();
SignatureData m_SignatureData = new SignatureData();

String gwSignture = new String("This is a new Signature");
byte[] gwByte = new byte[100];

try
{

gwByte = gwSignture.getBytes("UTF8");
m_SignatureData.setData(gwByte);
m_SignatureData.setSize(100);
m_Signature.setPart(m_SignatureData);
m_Signature.setName("SOAP Signature 1");
m_Signature.set_default(Boolean.TRUE);

m_gwMain.getGroupWiseService().createSignatureRequest(m_Signature, m_gwMain.getGroupWiseServiceId(), false);

} catch (Exception ex)
{
ex.printStackTrace();
}
}


Hope this helps.

Tim



>>> On 5/19/2009 at 7:36 AM, in message <magnus.3sfqu6@no-mx.forums.novell.com>, magnus<magnus@no-mx.forums.novell.com> wrote:



I'm a n00b on java soap coding and needs to create a signature with
soap. I have created the loginRequest w. ssl but I can't handle the
signature response...

Is there an example of creating signatures ?

regards
/magnus


--
magnus
------------------------------------------------------------------------
magnus's Profile: http://forums.novell.com/member.php?userid=1603
View this thread: http://forums.novell.com/showthread.php?t=373260
0 Likes
-Magnus- Super Contributor.
Super Contributor.

Re: Signature example?

Tim,
I appreciate your response!
now I understand the trick with setData part.. but a java.lang.NullPointerException is thrown from createSignatureRequest, If I debug, m_Signature and sessionId seems valid to me, nothing is shown in trace... and I cant see what's wrong..

/ Magnus

        {
m_SignatureResp = new CreateSignatureResponse();
Signature m_Signature = new Signature();
SignatureData m_SignatureData = new SignatureData();

String gwSignture = new String("This is a new Signature");
byte[] gwByte = new byte[100];

try {

gwByte = gwSignture.getBytes("UTF8");
m_SignatureData.setData(gwByte);
m_Signature.setId("1");
m_SignatureData.setSize(100);
m_Signature.setPart(m_SignatureData);
m_Signature.setName("SOAP Signature 1");
m_Signature.set_default(Boolean.TRUE);
m_Signature.setGlobal(Boolean.FALSE);

m_service.createSignatureRequest(m_Signature, sessionId, true);

} catch (Exception ex) {
ex.printStackTrace();
}
}
_______
private GroupWisePortType m_service;
_______
public GroupWisePortType getService() {
return m_service;
}

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.