views:

259

answers:

2

I'm trying to get a Silverlight application to connect to a Java webservice using a service reference.

I've come to the conclusion that Silverlight doesn't work the same way as as WPF or ASP.NET with respect to service connectivity.

I've searched the net and all I found for authentication was articles talking about securing the application by user by altering the service to include a webmethod.

I have to use the existing service. I've been using NetworkCredetials in ASP.NET and WPF; what's the equivalent in Silverlight?

Sorry, I should have mentioned that it's an axis service on a JBoss server.

UPDATE: This link seems to indicate that this should be possible http://blogs.msdn.com/coding4fun/archive/2008/02/24/7883342.aspx. They use NetworkCredentials to connect to to the Twitter API.

A: 

Does the web service have a clientaccesspolicy.xml or crossdomain.xml policy file?

http://msdn.microsoft.com/en-us/library/cc197955(VS.95).aspx

KeithMahoney
Yes. I had both in place. I believe they were deployed correctly to the root of the Web server that has the Axis service.I need to satisfy the Axis services need to connection authentication. In ASP or WPF I just used the Network Credentials. I don't see a way to do this with SL WCF.
Fireworks
Connection authentication meaning on the request to the service, not whether the calling SL app can call that Axis service. Basically the Axis service is doing it's own forms authentication style authentication.
Fireworks
A: 

This should definitely be possible. Shouldn't matter what language the service was written in - only the format of the output (SOAP, JSON etc).

Do you have any SSL involved?

Try fully opening your your ClientAccessPolicy (no restrictions) and then try copying that to different roots (root of the server, root of the app, root of the SL app etc) to see if you get any better results.

I think a fully open policy file would look like this:

<?xml version="1.0" encoding="utf-8"?>
<access-policy>
  <cross-domain-access>
    <policy>
      <allow-from http-request-headers="*">
        <domain uri="*"/>
      </allow-from>
      <grant-to>
        <resource path="/" include-subpaths="true"/>
      </grant-to>
    </policy>
  </cross-domain-access>
</access-policy>

HTH,
Mark

Mark Cooper