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 CrystalCracker <su...@gmail.com> on 2007/06/01 23:58:07 UTC
Webservice with security
First of all, I am sorry that I am fairly new to Web Service, though not to
Java/J2EE. This is my first experience with Web service, and the problem
that I is more of conceptual.
I am provided with a secure service endpoint like:
http://test.test.com:8888/services/SID123
Using axis, I generated the client codes. The ant script that i used for it
is a modified version of
http://xmlgateway.its.utexas.edu/docs/java_ex_wsdl.html
The files that were generated were:
1. TestServiceInterface.java extends java.rmi.Remote
2. TestWS.java extends javax.xml.rpc.Service
3. TestWSBindingStub.java extends org.apache.axis.client.Stub implements
TestServiceInterface
4. TestWSLocator.java extends org.apache.axis.client.Service implements
TestWS
The other that were generated were serializable java classes.
Now I wrote my client application and instantiated the Stub, set the
username, password and end point and called the interface methods, but I got
a remote exception saying "Invalid Username or Password".
My questions are:
1. Since I am invoking secure endpoints, are there any client codes to be
generated for that?
2. Where is my Impl class?
3. Is the build file that I am refereing to complete?
Any suggestions will be highly appreciated.
CrystalCracker
--
View this message in context: http://www.nabble.com/Webservice-with-security-tf3854680.html#a10921165
Sent from the Axis - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Webservice with security
Posted by CrystalCracker <su...@gmail.com>.
Thanks Dimuthu.
Now I got unsecure endpoints to experiment with and here is what I did after
creating stubs:
stub = new TestWSBindingStub();
stub.setUsername("portal");
stub.setPassword("portal");
stub._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY,
"http://test.com:8888/TestWS/TestWS?WSDL");
TestInterface ts= (TestInterface) stub;
stub.getTestData();
This is what I did, but I get java.net.SocketTimeoutException: Read timed
out.
Am I missing something? This is my first time and I have no idea what is
going on.
Thanks a lot.
Dimuthu wrote:
>
> Hi,
>
> Are you using Axis2 with Rampart? Or Axis with wss4j?
>
> How did you set the username and password? Did you use a password
> callback class?
>
> If you are using wss4j, this link will help
> http://ws.apache.org/wss4j/package.html
>
> If you are using Rampart, this link will hep
> http://wso2.org/library/240
>
> If you are using Rampart, security policy can be used for enforcing
> security. These samples are available in samples/policy/sample01.
>
> Cheers,
> Dimuthu
>
>
> On Sun, 2007-06-03 at 20:20 -0700, CrystalCracker wrote:
>>
>>
>> CrystalCracker wrote:
>> >
>> > First of all, I am sorry that I am fairly new to Web Service, though
>> not
>> > to Java/J2EE. This is my first experience with Web service, and the
>> > problem that I is more of conceptual.
>> >
>> > I am provided with a secure service endpoint like:
>> > http://test.test.com:8888/services/SID123
>> >
>> > Using axis, I generated the client codes. The ant script that i used
>> for
>> > it is a modified version of
>> > http://xmlgateway.its.utexas.edu/docs/java_ex_wsdl.html
>> > The files that were generated were:
>> >
>> > 1. TestServiceInterface.java extends java.rmi.Remote
>> > 2. TestWS.java extends javax.xml.rpc.Service
>> > 3. TestWSBindingStub.java extends org.apache.axis.client.Stub
>> implements
>> > TestServiceInterface
>> > 4. TestWSLocator.java extends org.apache.axis.client.Service implements
>> > TestWS
>> >
>> > The other that were generated were serializable java classes.
>> >
>> > Now I wrote my client application and instantiated the Stub, set the
>> > username, password and end point and called the interface methods, but
>> I
>> > got a remote exception saying "Invalid Username or Password".
>> >
>> > My questions are:
>> > 1. Since I am invoking secure endpoints, are there any client codes to
>> be
>> > generated for that?
>> > 2. Where is my Impl class?
>> > 3. Is the build file that I am refereing to complete?
>> >
>> > Any suggestions will be highly appreciated.
>> >
>> > CrystalCracker
>> >
>> >
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Webservice-with-security-tf3854680.html#a10976971
Sent from the Axis - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Webservice with security
Posted by Dimuthu <mu...@apache.org>.
Hi,
Are you using Axis2 with Rampart? Or Axis with wss4j?
How did you set the username and password? Did you use a password
callback class?
If you are using wss4j, this link will help
http://ws.apache.org/wss4j/package.html
If you are using Rampart, this link will hep
http://wso2.org/library/240
If you are using Rampart, security policy can be used for enforcing
security. These samples are available in samples/policy/sample01.
Cheers,
Dimuthu
On Sun, 2007-06-03 at 20:20 -0700, CrystalCracker wrote:
>
>
> CrystalCracker wrote:
> >
> > First of all, I am sorry that I am fairly new to Web Service, though not
> > to Java/J2EE. This is my first experience with Web service, and the
> > problem that I is more of conceptual.
> >
> > I am provided with a secure service endpoint like:
> > http://test.test.com:8888/services/SID123
> >
> > Using axis, I generated the client codes. The ant script that i used for
> > it is a modified version of
> > http://xmlgateway.its.utexas.edu/docs/java_ex_wsdl.html
> > The files that were generated were:
> >
> > 1. TestServiceInterface.java extends java.rmi.Remote
> > 2. TestWS.java extends javax.xml.rpc.Service
> > 3. TestWSBindingStub.java extends org.apache.axis.client.Stub implements
> > TestServiceInterface
> > 4. TestWSLocator.java extends org.apache.axis.client.Service implements
> > TestWS
> >
> > The other that were generated were serializable java classes.
> >
> > Now I wrote my client application and instantiated the Stub, set the
> > username, password and end point and called the interface methods, but I
> > got a remote exception saying "Invalid Username or Password".
> >
> > My questions are:
> > 1. Since I am invoking secure endpoints, are there any client codes to be
> > generated for that?
> > 2. Where is my Impl class?
> > 3. Is the build file that I am refereing to complete?
> >
> > Any suggestions will be highly appreciated.
> >
> > CrystalCracker
> >
> >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Webservice with security
Posted by CrystalCracker <su...@gmail.com>.
CrystalCracker wrote:
>
> First of all, I am sorry that I am fairly new to Web Service, though not
> to Java/J2EE. This is my first experience with Web service, and the
> problem that I is more of conceptual.
>
> I am provided with a secure service endpoint like:
> http://test.test.com:8888/services/SID123
>
> Using axis, I generated the client codes. The ant script that i used for
> it is a modified version of
> http://xmlgateway.its.utexas.edu/docs/java_ex_wsdl.html
> The files that were generated were:
>
> 1. TestServiceInterface.java extends java.rmi.Remote
> 2. TestWS.java extends javax.xml.rpc.Service
> 3. TestWSBindingStub.java extends org.apache.axis.client.Stub implements
> TestServiceInterface
> 4. TestWSLocator.java extends org.apache.axis.client.Service implements
> TestWS
>
> The other that were generated were serializable java classes.
>
> Now I wrote my client application and instantiated the Stub, set the
> username, password and end point and called the interface methods, but I
> got a remote exception saying "Invalid Username or Password".
>
> My questions are:
> 1. Since I am invoking secure endpoints, are there any client codes to be
> generated for that?
> 2. Where is my Impl class?
> 3. Is the build file that I am refereing to complete?
>
> Any suggestions will be highly appreciated.
>
> CrystalCracker
>
>
--
View this message in context: http://www.nabble.com/Webservice-with-security-tf3854680.html#a10943293
Sent from the Axis - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org