You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Axisboy <va...@gmail.com> on 2011/05/12 12:56:25 UTC
Axis Support for SSL and Access authheader
Hi All ,
I have managed to write Axis web service (server side).
Now I would like support SSL to it.
<soapenv:Header>
<ser:AuthHeader>
<ser:ClientID></ser:ClientID>
<ser:Password></ser:Password>
</ser:AuthHeader>
</soapenv:Header>
Any one having idea to access this fields inside the xxx_skeleton.java ?
Any idea to support SSL in Axis ?
--
View this message in context: http://old.nabble.com/Axis-Support-for-SSL-and-Access-authheader-tp31602015p31602015.html
Sent from the Axis - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org
AW: AW: Axis Support for SSL and Access authheader
Posted by Lu...@Bertelsmann.de.
Hi varun.raj.t,
I am sorry I cannot help there any more. I assume you must put the code at the end of your xxxx_skeleton.java.
Cheerio, Lutz
-----Ursprüngliche Nachricht-----
Von: Axisboy [mailto:varun.raj.t@gmail.com]
Gesendet: Freitag, 13. Mai 2011 18:16
An: axis-user@ws.apache.org
Betreff: Re: AW: Axis Support for SSL and Access authheader
Hi Lutz ,
Thanks for response.
Guess I should have been more clear last time that the solution I require is
on server side.
My wsdl generates - three imp files and other request/response files
-> xxxxx_skeleton.java
-> xxxx_skeleton_interface.java -
-> xxxxxMessageReciverInOut.java
and other request/response POJOS.
not sure where exactly I can access username and password
of the authheader so that I can access and authenticate
and then response to web service client.
Lutz Ebeling wrote:
>
> Hi varun.raj.t,
>
> I used ADBClient with Axis2. Instead of ser: I used wsse, nevertheless
> maybe it helps.
>
> At the End of xxxServiceStub() after the following code
> serviceClient = new org.apache.axis2.client.ServiceClient(
> configurationContext, _service);
>
> _serviceClient.getOptions().setTo(
> new org.apache.axis2.addressing.EndpointReference(
> targetEndpoint));
> _serviceClient.getOptions().setUseSeparateListener(useSeparateListener);
>
> I added code from Erwin Driessen http://www.5341.com/msg/199447.html,
> which works fine.
> wsseUsername and wssePassword you must add: change UsernameToken to your
> ser:ClientID etc
>
>
> OMFactory fac = OMAbstractFactory.getOMFactory();
> OMNamespace omNs = fac.createOMNamespace(
> "http://schemas.xmlsoap.org/ws/2003/06/secext", "wsse");
>
> SOAP11Factory soap11Factory = new SOAP11Factory();
> SOAPHeaderBlock soapHeaderBlock = new SOAP11HeaderBlockImpl("Security",
> omNs, soap11Factory);
> soapHeaderBlock.setMustUnderstand(true);
>
> OMElement usernameTokenElement = fac.createOMElement("UsernameToken",
> omNs);
>
> OMElement usernameElement = fac.createOMElement("Username", omNs);
>
> // OMText omTextUsername = fac.createOMText(usernameElement,
> // getUserName());
> OMText omTextUsername = fac.createOMText(usernameElement, wsseUsername);
> usernameElement.addChild(omTextUsername);
>
> OMElement passwordElement = fac.createOMElement("Password", omNs);
>
> // OMText omTextPassword = fac.createOMText(passwordElement,
> // getPassword());
> OMText omTextPassword = fac.createOMText(passwordElement, wssePassword);
> passwordElement.addChild(omTextPassword);
>
> usernameTokenElement.addChild(usernameElement);
> usernameTokenElement.addChild(passwordElement);
>
> soapHeaderBlock.addChild(usernameTokenElement);
>
> _serviceClient.addHeader(soapHeaderBlock);
>
> Cheerio, Lutz
>
> -----Ursprüngliche Nachricht-----
> Von: Axisboy [mailto:varun.raj.t@gmail.com]
> Gesendet: Donnerstag, 12. Mai 2011 12:56
> An: axis-user@ws.apache.org
> Betreff: Axis Support for SSL and Access authheader
>
>
> Hi All ,
>
> I have managed to write Axis web service (server side).
> Now I would like support SSL to it.
>
> <soapenv:Header>
> <ser:AuthHeader>
> <ser:ClientID></ser:ClientID>
> <ser:Password></ser:Password>
> </ser:AuthHeader>
> </soapenv:Header>
>
> Any one having idea to access this fields inside the xxx_skeleton.java ?
>
> Any idea to support SSL in Axis ?
> --
> View this message in context:
> http://old.nabble.com/Axis-Support-for-SSL-and-Access-authheader-tp31602015p31602015.html
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>
>
--
View this message in context: http://old.nabble.com/Axis-Support-for-SSL-and-Access-authheader-tp31602015p31612846.html
Sent from the Axis - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org
Re: AW: Axis Support for SSL and Access authheader
Posted by Axisboy <va...@gmail.com>.
Hi Lutz ,
Thanks for response.
Guess I should have been more clear last time that the solution I require is
on server side.
My wsdl generates - three imp files and other request/response files
-> xxxxx_skeleton.java
-> xxxx_skeleton_interface.java -
-> xxxxxMessageReciverInOut.java
and other request/response POJOS.
not sure where exactly I can access username and password
of the authheader so that I can access and authenticate
and then response to web service client.
Lutz Ebeling wrote:
>
> Hi varun.raj.t,
>
> I used ADBClient with Axis2. Instead of ser: I used wsse, nevertheless
> maybe it helps.
>
> At the End of xxxServiceStub() after the following code
> serviceClient = new org.apache.axis2.client.ServiceClient(
> configurationContext, _service);
>
> _serviceClient.getOptions().setTo(
> new org.apache.axis2.addressing.EndpointReference(
> targetEndpoint));
> _serviceClient.getOptions().setUseSeparateListener(useSeparateListener);
>
> I added code from Erwin Driessen http://www.5341.com/msg/199447.html,
> which works fine.
> wsseUsername and wssePassword you must add: change UsernameToken to your
> ser:ClientID etc
>
>
> OMFactory fac = OMAbstractFactory.getOMFactory();
> OMNamespace omNs = fac.createOMNamespace(
> "http://schemas.xmlsoap.org/ws/2003/06/secext", "wsse");
>
> SOAP11Factory soap11Factory = new SOAP11Factory();
> SOAPHeaderBlock soapHeaderBlock = new SOAP11HeaderBlockImpl("Security",
> omNs, soap11Factory);
> soapHeaderBlock.setMustUnderstand(true);
>
> OMElement usernameTokenElement = fac.createOMElement("UsernameToken",
> omNs);
>
> OMElement usernameElement = fac.createOMElement("Username", omNs);
>
> // OMText omTextUsername = fac.createOMText(usernameElement,
> // getUserName());
> OMText omTextUsername = fac.createOMText(usernameElement, wsseUsername);
> usernameElement.addChild(omTextUsername);
>
> OMElement passwordElement = fac.createOMElement("Password", omNs);
>
> // OMText omTextPassword = fac.createOMText(passwordElement,
> // getPassword());
> OMText omTextPassword = fac.createOMText(passwordElement, wssePassword);
> passwordElement.addChild(omTextPassword);
>
> usernameTokenElement.addChild(usernameElement);
> usernameTokenElement.addChild(passwordElement);
>
> soapHeaderBlock.addChild(usernameTokenElement);
>
> _serviceClient.addHeader(soapHeaderBlock);
>
> Cheerio, Lutz
>
> -----Ursprüngliche Nachricht-----
> Von: Axisboy [mailto:varun.raj.t@gmail.com]
> Gesendet: Donnerstag, 12. Mai 2011 12:56
> An: axis-user@ws.apache.org
> Betreff: Axis Support for SSL and Access authheader
>
>
> Hi All ,
>
> I have managed to write Axis web service (server side).
> Now I would like support SSL to it.
>
> <soapenv:Header>
> <ser:AuthHeader>
> <ser:ClientID></ser:ClientID>
> <ser:Password></ser:Password>
> </ser:AuthHeader>
> </soapenv:Header>
>
> Any one having idea to access this fields inside the xxx_skeleton.java ?
>
> Any idea to support SSL in Axis ?
> --
> View this message in context:
> http://old.nabble.com/Axis-Support-for-SSL-and-Access-authheader-tp31602015p31602015.html
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>
>
--
View this message in context: http://old.nabble.com/Axis-Support-for-SSL-and-Access-authheader-tp31602015p31612846.html
Sent from the Axis - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org
AW: Axis Support for SSL and Access authheader
Posted by Lu...@Bertelsmann.de.
Hi varun.raj.t,
I used ADBClient with Axis2. Instead of ser: I used wsse, nevertheless maybe it helps.
At the End of xxxServiceStub() after the following code
serviceClient = new org.apache.axis2.client.ServiceClient(
configurationContext, _service);
_serviceClient.getOptions().setTo(
new org.apache.axis2.addressing.EndpointReference(
targetEndpoint));
_serviceClient.getOptions().setUseSeparateListener(useSeparateListener);
I added code from Erwin Driessen http://www.5341.com/msg/199447.html, which works fine.
wsseUsername and wssePassword you must add: change UsernameToken to your ser:ClientID etc
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace(
"http://schemas.xmlsoap.org/ws/2003/06/secext", "wsse");
SOAP11Factory soap11Factory = new SOAP11Factory();
SOAPHeaderBlock soapHeaderBlock = new SOAP11HeaderBlockImpl("Security",
omNs, soap11Factory);
soapHeaderBlock.setMustUnderstand(true);
OMElement usernameTokenElement = fac.createOMElement("UsernameToken",
omNs);
OMElement usernameElement = fac.createOMElement("Username", omNs);
// OMText omTextUsername = fac.createOMText(usernameElement,
// getUserName());
OMText omTextUsername = fac.createOMText(usernameElement, wsseUsername);
usernameElement.addChild(omTextUsername);
OMElement passwordElement = fac.createOMElement("Password", omNs);
// OMText omTextPassword = fac.createOMText(passwordElement,
// getPassword());
OMText omTextPassword = fac.createOMText(passwordElement, wssePassword);
passwordElement.addChild(omTextPassword);
usernameTokenElement.addChild(usernameElement);
usernameTokenElement.addChild(passwordElement);
soapHeaderBlock.addChild(usernameTokenElement);
_serviceClient.addHeader(soapHeaderBlock);
Cheerio, Lutz
-----Ursprüngliche Nachricht-----
Von: Axisboy [mailto:varun.raj.t@gmail.com]
Gesendet: Donnerstag, 12. Mai 2011 12:56
An: axis-user@ws.apache.org
Betreff: Axis Support for SSL and Access authheader
Hi All ,
I have managed to write Axis web service (server side).
Now I would like support SSL to it.
<soapenv:Header>
<ser:AuthHeader>
<ser:ClientID></ser:ClientID>
<ser:Password></ser:Password>
</ser:AuthHeader>
</soapenv:Header>
Any one having idea to access this fields inside the xxx_skeleton.java ?
Any idea to support SSL in Axis ?
--
View this message in context: http://old.nabble.com/Axis-Support-for-SSL-and-Access-authheader-tp31602015p31602015.html
Sent from the Axis - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org