Re: problem with applet access to web service



so gra.CardWSService is a webservice client in applet:

try { // Call Web Service Operation
gra.CardWSService service = new gra.CardWSService();
gra.CardWS port = service.getCardWSPort();
// TODO process result here
k1 = port.getCard();
k2 = port.getCard();

} catch (Exception ex) {
// TODO handle custom exceptions here
}

CardWs is a very simple webservice,
..getCard() returns int
do you need addtiona info?
do you know how to make an applet to comunicate with webservices on
remote machines??
is this possible?

ballo0

On 29 Mar, 10:35, Nigel Wade <n...@xxxxxxxxxxxx> wrote:
ballo0 wrote:
On 28 Mar, 11:42, Nigel Wade <n...@xxxxxxxxxxxx> wrote:
ballo0 wrote:
I am using java 5. I have a prolem with access to web service by java
applet. When applet is launched as standalone application it works
fine, but when i try to launch applet in my browser as a part of
website it doesn't work. Applet is loading and loading and it can't
finish. I am trying to access web service in init method, when i
comment this part of method everything works fine.

I am using sun AS 9.1, and web service has been tested.

Maybe someone has similar problems. I can also post sources if there
is need.

ballo0

Look in the Java console for your browser to see if there are any
errors/exceptions reported. The applet is most likely failing to start.

--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : n...@xxxxxxxxxxxx
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555

like i have written this is the problem, you are right it is thrown by
init method in applet:

java.lang.ExceptionInInitializerError
at

com.sun.xml.internal.ws.util.xml.XmlUtil.createDefaultCatalogResolver(XmlUtil.java:> 208)
at

com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:> 125)
at

com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:

52)
at javax.xml.ws.Service.<init>(Service.java:57)
at gra.CardWSService.<init>(CardWSService.java:40)
at timon.Applet.init(Applet.java:108)
at sun.applet.AppletPanel.run(AppletPanel.java:417)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.security.AccessControlException: access denied
(java.util.PropertyPermission xml.catalog.ignoreMissing read)
at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:
323)
at
java.security.AccessController.checkPermission(AccessController.java:
546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:
532)
at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:
1285)
at java.lang.System.getProperty(System.java:652)
at

com.sun.org.apache.xml.internal.resolver.CatalogManager.<init>(CatalogManager.java:> 140)
at

com.sun.org.apache.xml.internal.resolver.CatalogManager.<clinit>(CatalogManager.java:

134)
... 8 more

any ideas how to make it work, and what exactly is wrong?

ballo0

No, because I have no idea what gra.CardWSService is, or what it does.

You are throwing a AccessControlException. Presumably because your applet is
trying to access resources which it is not allowed to access. Your applet can
only access resources directly from the host from which the class loader
obtained the code, via something like this.getCodeBase().getHost().

Even if the resources are being accessed from the same physical machine you have
to use the same "host", i.e you can't download the applet via the loopback
address (127.0.0.1) and then access resources via the ethernet interface IP (or
vice versa), or via different IP addresses for multi-homed hosts.

--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : n...@xxxxxxxxxxxx
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555


.



Relevant Pages

  • Re: problem with applet access to web service
    ... When applet is launched as standalone application it works ... Look in the Java console for your browser to see if there are any ... University of Leicester, Leicester, LE1 7RH, UK ... trying to access resources which it is not allowed to access. ...
    (comp.lang.java.help)
  • Re: frame from applet
    ... An applet can get an image easily, ... Openning a Frame is an odd thing to do from ... Why not put that Panel in the center of your Applet? ... In any case, it is usually better to access resources with URL's, ...
    (comp.lang.java.help)
  • Re: problem with applet access to web service
    ... try {// Call Web Service Operation ... // TODO process result here ... My guess would be that you are serving your applet and your webservice on ...
    (comp.lang.java.help)
  • Re: CF Deployment
    ... the MSDN sample (upgrading via a WebService) is nice... ... applet would just need to be written in something other than .NET. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: problem with applet access to web service
    ... When applet is launched as standalone application it works ... but when i try to launch applet in my browser as a part of ... I am using sun AS 9.1, and web service has been tested. ... The applet is signed and your browser is getting it from the web server ...
    (comp.lang.java.help)