What I did here was use xfire's url for serving out the wsdl, but override
the way that it works by extending XFireConfigurableServlet. I then set a
property in my service spring configuration to point to the wsdl.
My reason for doing this - when the wsdl is set in the xfire spring config
via the wsdlURL, xfire use's the wsdl to generate the service however it
seems to ignore actions etc, so I set a property to the location of my wsdl
and serve it out.
Is this a bug anyone - the fact that when wsdlURL is set that no actions are
loaded up? I have overridden the AnnotationServiceFactory to add in the
addressing operations as suggested else where on this forum, however this is
never called when wsdlURL is set.
/**
* Hack to serve out our wsdl - we could user the wsldurl property in
* service however when this is set the service is loaded up from the
* specified wsdl, this causes problems with actions as they are not
loaded!
*
*/
public XFireServletController createController() throws ServletException
{
return new XFireServletController(xfire, getServletContext())
{
protected void generateWSDL(HttpServletResponse response, String
service) throws ServletException,
IOException
{
Service userService =
getXFire().getServiceRegistry().getService(service);
InputStream is = null;
String wsdl = (String) userService.getProperty("
ext.wsdl.location");
if(wsdl != null)
{
is = getClass().getResourceAsStream(wsdl);
}
try
{
if (is != null)
{
OutputStream os = response.getOutputStream();
if (is != null)
{
byte[] buf = new byte[1024];
int read = 0;
while ((read = is.read(buf)) != -1)
{
os.write(buf, 0, read);
}
}
response.setStatus(200);
response.setContentType("text/xml");
}
else
{
super.generateWSDL(response, service);
}
}
finally
{
if (is != null)
{
is.close();
}
}
}
};
}
On 3/14/07, Andres Bernasconi <[EMAIL PROTECTED]> wrote:
Thanks Zarar for the (fast) response. I was actually thinking something
tweakable through configuration. Before creating a new class I prefer
modifying XFire's class (or extending, whatever) that is currently not
checking for secure WSDLs.
Tomek / Dan, do you think this would be fixed sometime soon?
Cheers
AB
On 3/14/07, Zarar Siddiqi < [EMAIL PROTECTED]> wrote:
>
> So you want to have a different URL for the WSDL and a different one
> for the service. You can do that but you might need to go underneath
> the good and tweak how XFire processes HTTP requests. You'll need to
> replace the XFireServletController with your own implementation by
> extending some of the methods in it. Go here to see how you can
> create a CustomXFireServletController:
>
>
http://arsenalist.com/2007/03/01/web-service-versioning-with-endpoints-using-xfire/
>
>
> Once you do that, you can make your URLs map to anything you want by
> overriding methods like doService(..) etc.
>
>
>
> On 3/13/07, Andres Bernasconi < [EMAIL PROTECTED]> wrote:
> > Hi everyone,
> >
> > I am having some problems related to the XFIRE-832 issue. I was
> wondering if
> > there was any way to add security to web services invocations only and
> not
> > when clients want to see the WSDL (Since the ?WSDL is a query string
> the
> > address for getting the WSDL and for posting messages is the same. )
> Can I
> > publish de WSDL in another address? (but that address should NOT
> handle web
> > service requests) ¿?. Or is there any way to make the client avoid
> calling
> > the WSDL when it is created with configuration (of course, it is an
> XFire
> > client).
> >
> > Can you think of any other solution that does not involve modifying
> XFire's
> > code?
> >
> > If not, I will modify XFire's code and post a "possible" solution.
> Please
> > respond as this is becoming quite a problem to my team.
> >
> > Thanks a lot!
> > Regards
> > Andres B.
> >
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
> http://xircles.codehaus.org/manage_email
>
>