You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by Murali Konnipati <mu...@altair.com> on 2007/09/21 22:15:39 UTC

How to develop a HTTPs-based webservice client

Hi All,

        I am newbie to axisc world. I have a webservice which is deployed in an HTTPS server with server certificate. I have to develop a webservice client, which will use the Server certificate(Server doesn't require client certificate) for authorization. 

         Can anybody please provide me some guide or document, which will explain me  on how to write HTTPS based webservice client(in the code) and do the needful favor.

Thanks & Regards,

Murali Krishna K

re: Re[2]: How to develop a HTTPs-based webservice client

Posted by Royston Day <rd...@mpc-data.co.uk>.
>> The one question I have at the moment is, to use the https-based
>> service, is it just a matter of replacing "http://<web service uri>"
>> with "https://<web service uri>"?
> 
> Yes If you have done as the way above link says it is just a matter of
> replacing http with https given that your service endpoint is https
> based.
 >
 > -Manjula.

Thanks for that, I've got it working now w/ client-side authentication.

Regards,

Royston





---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org


Re: **JUNK** Re[2]: How to develop a HTTPs-based webservice client

Posted by Manjula Peiris <ma...@wso2.com>.
On Tue, 2007-11-20 at 17:30 +0000, Royston Day wrote:
> Hi Dinesh,
> 
> We're currently converting our existing web service to use SSL.
> 
> In response to an earlier thread about https-based web service:
> 
> >   Please refer this link
> >   http://ws.apache.org/axis2/c/docs/axis2c_manual.html#ssl_client
> 
> I've think that I've set everything up now, based on the above
> documentation link.  I've created the necessary certificates and keys
> etc.  I've also configured apache (in httpd.conf) and axis2c (in
> axis2.xml).
> 
> The one question I have at the moment is, to use the https-based
> service, is it just a matter of replacing "http://<web service uri>"
> with "https://<web service uri>"?

Yes If you have done as the way above link says it is just a matter of
replacing http with https given that your service endpoint is https
based.

-Manjula.


> 
> Many thanks,
> 
> Royston
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-user-help@ws.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org


Re[2]: How to develop a HTTPs-based webservice client

Posted by Royston Day <rd...@mpc-data.co.uk>.
Hi Dinesh,

We're currently converting our existing web service to use SSL.

In response to an earlier thread about https-based web service:

>   Please refer this link
>   http://ws.apache.org/axis2/c/docs/axis2c_manual.html#ssl_client

I've think that I've set everything up now, based on the above
documentation link.  I've created the necessary certificates and keys
etc.  I've also configured apache (in httpd.conf) and axis2c (in
axis2.xml).

The one question I have at the moment is, to use the https-based
service, is it just a matter of replacing "http://<web service uri>"
with "https://<web service uri>"?

Many thanks,

Royston


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org


Re: How to develop a HTTPs-based webservice client

Posted by Dinesh Premalal <xy...@gmail.com>.
Murali,
  Please refer this link
  http://ws.apache.org/axis2/c/docs/axis2c_manual.html#ssl_client 

thanks,
Dinesh
"Murali Konnipati" <mu...@altair.com> writes:

> Hi All,
>
>         I am newbie to axisc world. I have a webservice which is deployed in an
> HTTPS server with server certificate. I have to develop a webservice client,
> which will use the Server certificate(Server doesn't require client
> certificate) for authorization.
>
>          Can anybody please provide me some guide or document, which will
> explain me  on how to write HTTPS based webservice client(in the code) and do
> the needful favor.
>
> Thanks & Regards,
>
> Murali Krishna K
>

-- 
Dinesh Premalal
http://xydinesh.wordpress.com/
GPG ID : A255955C
GPG Key Finger Print : C481 E5D4 C27E DC34 9257  0229 4F44 266E A255 955C

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org


Re: How to develop a HTTPs-based webservice client

Posted by Dumindu Pallewela <du...@wso2.com>.
Murali Konnipati wrote:
> Hi Pallewela,
> 
>        Thank you very much for the reply.
>        I have a small doubt, I need to modify the SOAP envelope and send
> some custom messages in the SOAP request. For this, i am planning to use
> the OperationClient.

This should not be a problem for the HTTPS transport. As Dinesh
pointed out earlier, transport is independent from the client api.

> my  webservice. Please check the same and let me know, which method is
> suitable for the webservice invocation.

What are these *methods* that you are referring to?

BTW, you can try it out and see... it's merely a minor change that
you have to do to your client ;)

Regards,
-Dumindu.


RE: How to develop a HTTPs-based webservice client

Posted by Murali Konnipati <mu...@altair.com>.
Hi Pallewela,

       I am referring to "OperationClient" & "ServiceClient"(methods) for webservice invocation.

       I am sending the SOAP message that i have to send it to our .Net based webservice. Please check below, and let me know whether i can use the "ServiceClient" to access the webservice. 

       <s11:Envelope 
  xmlns:s11="http://schemas.xmlsoap.org/soap/envelope"
  xmlns:wsa="http://www.w3.org/2005/08/addressing"
  xmlns:bes-factory="http://schemas.ggf.org/bes/2006/08/bes-factory"
  xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
  xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" >
  <s11:Header>
    <wsse:Security>
      <wsse:UsernameToken xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" >
        <wsse:Username>Bert</wsse:Username>
        <wsse:Password  Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">Ernie</wsse:Password>
      </wsse:UsernameToken>
    </wsse:Security>
    <wsa:Action>
       http://schemas.ggf.org/bes/2006/08/bes-factory/CreateActivity
    </wsa:Action>
    <wsa:To s11:mustUnderstand=1>
        http://www.bes.org/BESFactory
    </wsa:To>
  </s11:Header>
  <s11:Body wsu:Id="TheBody">
        <bes-factory:CreateActivity>
            <bes-factory:ActivityDocument>
                <jsdl:JobDefinition>
                    {Any valid JSDL document}
                </jsdl:JobDefiniton>
            </bes-factory:ActivityDocument>
        </bes-factory:CreateActivity>
  </s11:Body>
</s11:Envelope>	



Thanks & Regards,

Murali Krishna K
 

-----Original Message-----
From: Dumindu Pallewela
To: Apache AXIS C User List
Sent: 9/24/07 5:13 PM
Subject: Re: How to develop a HTTPs-based webservice client

Murali Konnipati wrote:
> Hi Pallewela,
> 
>        Thank you very much for the reply.
>        I have a small doubt, I need to modify the SOAP envelope and
send
> some custom messages in the SOAP request. For this, i am planning to
use
> the OperationClient.

This should not be a problem for the HTTPS transport. As Dinesh
pointed out earlier, transport is independent from the client api.

> my  webservice. Please check the same and let me know, which method is
> suitable for the webservice invocation.

What are these *methods* that you are referring to?

BTW, you can try it out and see... it's merely a minor change that
you have to do to your client ;)

Regards,
-Dumindu.

 <<SMIME.txt>> 

RE: How to develop a HTTPs-based webservice client

Posted by Murali Konnipati <mu...@altair.com>.
Hi Pallewela,

       Thank you very much for the reply.
       I have a small doubt, I need to modify the SOAP envelope and send some custom messages in the SOAP request. For this, i am planning to use the OperationClient.

      I am sending the sample SOAP request message, i need to send it to my  webservice. Please check the same and let me know, which method is suitable for the webservice invocation.

    ==============================
     SOAP Request message
    ==============================

<s11:Envelope 
  xmlns:s11="http://schemas.xmlsoap.org/soap/envelope"
  xmlns:wsa="http://www.w3.org/2005/08/addressing"
  xmlns:bes-factory="http://schemas.ggf.org/bes/2006/08/bes-factory"
  xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
  xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" >
  <s11:Header>
    <wsse:Security>
      <wsse:UsernameToken xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" >
        <wsse:Username>Bert</wsse:Username>
        <wsse:Password  Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">Ernie</wsse:Password>
      </wsse:UsernameToken>
    </wsse:Security>
    <wsa:Action>
       http://schemas.ggf.org/bes/2006/08/bes-factory/CreateActivity
    </wsa:Action>
    <wsa:To s11:mustUnderstand=1>
        http://www.bes.org/BESFactory
    </wsa:To>
  </s11:Header>
  <s11:Body wsu:Id="TheBody">
        <bes-factory:CreateActivity>
            <bes-factory:ActivityDocument>
                <jsdl:JobDefinition>
                    {Any valid JSDL document}
                </jsdl:JobDefiniton>
            </bes-factory:ActivityDocument>
        </bes-factory:CreateActivity>
  </s11:Body>
</s11:Envelope>


Thanks & Regards,

Murali Krishna K

 

  

-----Original Message-----
From: Dumindu Pallewela
To: Apache AXIS C User List
Sent: 9/24/07 2:42 PM
Subject: Re: How to develop a HTTPs-based webservice client

Hi Murali,

If you want to set the properties required for HTTPS transport, in
your client code, please do the following:

axutil_property_t *prop_sc = axutil_property_create(env);
axutil_property_set_value(prop_sc, env, axutil_strdup(env,
"/path/to/server/cert"));
axis2_options_set_property(options, env, "SERVER_CERT", prop_sc);

where *options* is the *axis2_options_t* structure that you set to
the service client using *axis2_svc_client_set_options* function, or
to the operation client using *axis2_op_client_set_options*
function. Refer to the echo sample client's http authentication
section for a sample on similar code fragment [echo.c lines 115-125].

Note that it does not depend on whether the service client or
operation client is used to send the request.

Other properties, if necessary, can be set in an identical manner.
Property names are KEY_FILE and SSL_PASSPHRASE as described in
axis2c manual [1].

HTH,
-Dumindu.

[1] http://ws.apache.org/axis2/c/docs/axis2c_manual.html#ssl_client

Murali Konnipati wrote:
> Thank you Dinesh.
> 
> I will try to submit a small job and let you know, if i face any
issues.
> 
> 
> Thanks & Regards,
> 
> Murali Krishna K
> 
> -----Original Message-----
> From: Dinesh Premalal
> To: axis-c-user@ws.apache.org
> Cc: Dinesh Premalal ; Dinesh Premalal
> Sent: 9/23/07 1:32 AM
> Subject: Re: How to develop a HTTPs-based webservice client
> 
> Murali,
> "Murali Konnipati" <mu...@altair.com> writes:
>>       As i have to modify the SOAP envelope, i am planning to use the
> Operation
>> Client instead of Service Client. Can you please send me any document
> with some
>> examples on https web service client, which can provide some useful
>> information.
> It doesn't matter whether you use svc_client or op_client to send your
> request. HTTPS handled by Axis2/C transport layer which is independent
> from the client api that you use. I'm afraid that I don't have any
> examples in my hand. I think axis2c manual's description is
> descriptive enough.
> 
> thanks,
> Dinesh
> 
> --
> Dinesh Premalal
> http://xydinesh.wordpress.com/
> GPG ID : A255955C
> GPG Key Finger Print : C481 E5D4 C27E DC34 9257  0229 4F44 266E A255
> 955C
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-user-help@ws.apache.org
> 


 <<SMIME.txt>> 

Re: How to develop a HTTPs-based webservice client

Posted by Dumindu Pallewela <du...@wso2.com>.
Hi Murali,

If you want to set the properties required for HTTPS transport, in
your client code, please do the following:

axutil_property_t *prop_sc = axutil_property_create(env);
axutil_property_set_value(prop_sc, env, axutil_strdup(env,
"/path/to/server/cert"));
axis2_options_set_property(options, env, "SERVER_CERT", prop_sc);

where *options* is the *axis2_options_t* structure that you set to
the service client using *axis2_svc_client_set_options* function, or
to the operation client using *axis2_op_client_set_options*
function. Refer to the echo sample client's http authentication
section for a sample on similar code fragment [echo.c lines 115-125].

Note that it does not depend on whether the service client or
operation client is used to send the request.

Other properties, if necessary, can be set in an identical manner.
Property names are KEY_FILE and SSL_PASSPHRASE as described in
axis2c manual [1].

HTH,
-Dumindu.

[1] http://ws.apache.org/axis2/c/docs/axis2c_manual.html#ssl_client

Murali Konnipati wrote:
> Thank you Dinesh.
> 
> I will try to submit a small job and let you know, if i face any issues.
> 
> 
> Thanks & Regards,
> 
> Murali Krishna K
> 
> -----Original Message-----
> From: Dinesh Premalal
> To: axis-c-user@ws.apache.org
> Cc: Dinesh Premalal ; Dinesh Premalal
> Sent: 9/23/07 1:32 AM
> Subject: Re: How to develop a HTTPs-based webservice client
> 
> Murali,
> "Murali Konnipati" <mu...@altair.com> writes:
>>       As i have to modify the SOAP envelope, i am planning to use the
> Operation
>> Client instead of Service Client. Can you please send me any document
> with some
>> examples on https web service client, which can provide some useful
>> information.
> It doesn't matter whether you use svc_client or op_client to send your
> request. HTTPS handled by Axis2/C transport layer which is independent
> from the client api that you use. I'm afraid that I don't have any
> examples in my hand. I think axis2c manual's description is
> descriptive enough.
> 
> thanks,
> Dinesh
> 
> --
> Dinesh Premalal
> http://xydinesh.wordpress.com/
> GPG ID : A255955C
> GPG Key Finger Print : C481 E5D4 C27E DC34 9257  0229 4F44 266E A255
> 955C
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-user-help@ws.apache.org
> 



RE: How to develop a HTTPs-based webservice client

Posted by Murali Konnipati <mu...@altair.com>.
Thank you Dinesh.

I will try to submit a small job and let you know, if i face any issues.


Thanks & Regards,

Murali Krishna K 

-----Original Message-----
From: Dinesh Premalal
To: axis-c-user@ws.apache.org
Cc: Dinesh Premalal ; Dinesh Premalal 
Sent: 9/23/07 1:32 AM
Subject: Re: How to develop a HTTPs-based webservice client

Murali,
"Murali Konnipati" <mu...@altair.com> writes:
>       As i have to modify the SOAP envelope, i am planning to use the
Operation
> Client instead of Service Client. Can you please send me any document
with some
> examples on https web service client, which can provide some useful
> information.
It doesn't matter whether you use svc_client or op_client to send your
request. HTTPS handled by Axis2/C transport layer which is independent
from the client api that you use. I'm afraid that I don't have any
examples in my hand. I think axis2c manual's description is
descriptive enough.

thanks,
Dinesh

-- 
Dinesh Premalal
http://xydinesh.wordpress.com/
GPG ID : A255955C
GPG Key Finger Print : C481 E5D4 C27E DC34 9257  0229 4F44 266E A255
955C

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org

Re: How to develop a HTTPs-based webservice client

Posted by Dinesh Premalal <xy...@gmail.com>.
Murali,
"Murali Konnipati" <mu...@altair.com> writes:
>       As i have to modify the SOAP envelope, i am planning to use the Operation
> Client instead of Service Client. Can you please send me any document with some
> examples on https web service client, which can provide some useful
> information.
It doesn't matter whether you use svc_client or op_client to send your
request. HTTPS handled by Axis2/C transport layer which is independent
from the client api that you use. I'm afraid that I don't have any
examples in my hand. I think axis2c manual's description is
descriptive enough.

thanks,
Dinesh

-- 
Dinesh Premalal
http://xydinesh.wordpress.com/
GPG ID : A255955C
GPG Key Finger Print : C481 E5D4 C27E DC34 9257  0229 4F44 266E A255 955C

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org


RE: How to develop a HTTPs-based webservice client

Posted by Murali Konnipati <mu...@altair.com>.
Hi Dinesh,

      Thank you very much for your reply.
      As i have to modify the SOAP envelope, i am planning to use the Operation Client instead of Service Client. Can you please send me any document with some examples on https web service client, which can provide some useful information.


Thanks & REgards,

Murali K
     


-----Original Message-----
From: Dinesh Premalal
To: axis-c-user@ws.apache.org
Sent: 9/22/07 9:16 PM
Subject: Re: How to develop a HTTPs-based webservice client

Murali,
  Please refer this link
  http://ws.apache.org/axis2/c/docs/axis2c_manual.html#ssl_client 

thanks,
Dinesh
"Murali Konnipati" <mu...@altair.com> writes:

> Hi All,
>
>         I am newbie to axisc world. I have a webservice which is
deployed in an
> HTTPS server with server certificate. I have to develop a webservice
client,
> which will use the Server certificate(Server doesn't require client
> certificate) for authorization.
>
>          Can anybody please provide me some guide or document, which
will
> explain me  on how to write HTTPS based webservice client(in the code)
and do
> the needful favor.
>
> Thanks & Regards,
>
> Murali Krishna K
>

-- 
Dinesh Premalal
http://xydinesh.wordpress.com/
GPG ID : A255955C
GPG Key Finger Print : C481 E5D4 C27E DC34 9257  0229 4F44 266E A255
955C

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org