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 Lyndon Tiu <lt...@alumni.sfu.ca> on 2004/11/30 00:34:58 UTC

WS-Security?

Hello,

Has anyone here used WS-Security on Axis?

Thanks.

--
Lyndon Tiu

Re: Resolved: RE: Problem generating WSDL from Java

Posted by "Tim K. (Gmane)" <tk...@ugcs.net>.
Which in effect does the same thing, it creates an interface for you 
with only those methods, right?

Personally I prefer defining the interface myself rather than doing it 
via command line options, you get more compile time checking and catch 
mistakes early than deal with sometimes obscure Axis error messages.

Tim


tony.q.weddle@gsk.com wrote:
> 
> You can also specify the methods to expose, using the -m option.
> 
> Tony
> 
> Tim K. wrote on 01/12/2004 19:21:04:
> 
>  > Vy Ho wrote:
>  > > I wonder if you declare an interface for this service, then use it to
>  > > generate wsdl.
>  > >
>  > > This shields you from how you implement your service.
>  > >
>  >
>  > Right, that's the way to do it, just create an interface for only the
>  > methods you want exposed. The class can have a lot more stuff in it that
>  > won't be exposed.
>  >
>  > Tim


Re: Resolved: RE: Problem generating WSDL from Java

Posted by to...@gsk.com.
You can also specify the methods to expose, using the -m option.

Tony

Tim K. wrote on 01/12/2004 19:21:04:

> Vy Ho wrote:
> > I wonder if you declare an interface for this service, then use it to 
> > generate wsdl.
> > 
> > This shields you from how you implement your service.
> > 
> 
> Right, that's the way to do it, just create an interface for only the 
> methods you want exposed. The class can have a lot more stuff in it that 

> won't be exposed.
> 
> Tim

Re: Resolved: RE: Problem generating WSDL from Java

Posted by "Tim K. (Gmane)" <tk...@ugcs.net>.
Vy Ho wrote:
> I wonder if you declare an interface for this service, then use it to 
> generate wsdl.
> 
> This shields you from how you implement your service.
> 

Right, that's the way to do it, just create an interface for only the 
methods you want exposed. The class can have a lot more stuff in it that 
won't be exposed.

Tim


Re: Resolved: RE: Problem generating WSDL from Java

Posted by Vy Ho <st...@drexel.edu>.
I wonder if you declare an interface for this service, then use it to 
generate wsdl.

This shields you from how you implement your service.

Resolved: RE: Problem generating WSDL from Java

Posted by David Song <da...@myeii.com>.
Thanks Tim.  The problem was that I changed some method from "protected"
to "public" so in essence public methods will be turned into Web
Methods.  Since those methods take HTTPServletRequest and MessageContext
as parameters and no custom serializers were written to serialize such
types, therefore the WSDL cannot be dynamically generated.

-David
-----Original Message-----
From: news [mailto:news@sea.gmane.org] On Behalf Of Tim K. (Gmane)
Sent: Tuesday, November 30, 2004 5:53 PM
To: axis-user@ws.apache.org
Subject: Re: Problem generating WSDL from Java

David Song wrote:
> Hi all,
> 
> I am getting the following error from Java2WSDL.  It was working
before,
> I just changed some method signatures.  Many thanks for the help!
> 
> -David
> 
> - The class org.apache.axis.MessageContext does not contain a default
> constructor, which is a requirement for a bean class.  The class
cannot
> be converted into
> an xml schema type.  An xml schema anyType will be used to define this
> class in the wsdl file.
> - The class javax.servlet.ServletContext is defined in a java or javax
> package and cannot be converted into an xml schema type.  An xml
schema
> anyType will be used to define this class in the wsdl file.
> - The class javax.servlet.http.HttpServletRequest is defined in a java
> or javax package and cannot be converted into an xml schema type.  An
> xml schema anyType will be used to define this class in the wsdl file.
> WSDLException: faultCode=OTHER_ERROR: Can't find prefix for
> 'http://http.servlet.javax'. Namespace prefixes must be set on the
> Definition object using the addNamespace(...) method.:
> 

My guess here is that you added some getMessageContext(), 
getServletContext() and getHttpServletRequest() methods somewhere in 
your beans and now Axis is trying to expose these bean properties and it

doesn't know how to serialize these classes. If that's the case just 
rename your methods so that they don't start with "set" or "get" for the

properties you do NOT want exposed.

Double check the methods you changed or added ...

Tim




Re: Problem generating WSDL from Java

Posted by "Tim K. (Gmane)" <tk...@ugcs.net>.
David Song wrote:
> Hi all,
> 
> I am getting the following error from Java2WSDL.  It was working before,
> I just changed some method signatures.  Many thanks for the help!
> 
> -David
> 
> - The class org.apache.axis.MessageContext does not contain a default
> constructor, which is a requirement for a bean class.  The class cannot
> be converted into
> an xml schema type.  An xml schema anyType will be used to define this
> class in the wsdl file.
> - The class javax.servlet.ServletContext is defined in a java or javax
> package and cannot be converted into an xml schema type.  An xml schema
> anyType will be used to define this class in the wsdl file.
> - The class javax.servlet.http.HttpServletRequest is defined in a java
> or javax package and cannot be converted into an xml schema type.  An
> xml schema anyType will be used to define this class in the wsdl file.
> WSDLException: faultCode=OTHER_ERROR: Can't find prefix for
> 'http://http.servlet.javax'. Namespace prefixes must be set on the
> Definition object using the addNamespace(...) method.:
> 

My guess here is that you added some getMessageContext(), 
getServletContext() and getHttpServletRequest() methods somewhere in 
your beans and now Axis is trying to expose these bean properties and it 
doesn't know how to serialize these classes. If that's the case just 
rename your methods so that they don't start with "set" or "get" for the 
properties you do NOT want exposed.

Double check the methods you changed or added ...

Tim


Problem generating WSDL from Java

Posted by David Song <da...@myeii.com>.
Hi all,

I am getting the following error from Java2WSDL.  It was working before,
I just changed some method signatures.  Many thanks for the help!

-David

- The class org.apache.axis.MessageContext does not contain a default
constructor, which is a requirement for a bean class.  The class cannot
be converted into
an xml schema type.  An xml schema anyType will be used to define this
class in the wsdl file.
- The class javax.servlet.ServletContext is defined in a java or javax
package and cannot be converted into an xml schema type.  An xml schema
anyType will be used to define this class in the wsdl file.
- The class javax.servlet.http.HttpServletRequest is defined in a java
or javax package and cannot be converted into an xml schema type.  An
xml schema anyType will be used to define this class in the wsdl file.
WSDLException: faultCode=OTHER_ERROR: Can't find prefix for
'http://http.servlet.javax'. Namespace prefixes must be set on the
Definition object using the addNamespace(...) method.:





Re: WS-Security?

Posted by Davanum Srinivas <da...@gmail.com>.
http://ws.apache.org/ws-fx/wss4j/


On Mon, 29 Nov 2004 15:34:58 -0800, Lyndon Tiu <lt...@alumni.sfu.ca> wrote:
> Hello,
> 
> Has anyone here used WS-Security on Axis?
> 
> Thanks.
> 
> --
> Lyndon Tiu
> 


-- 
Davanum Srinivas - http://webservices.apache.org/~dims/