You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Cyril Vidal <cy...@planetexml.com> on 2002/11/19 12:01:59 UTC
SOAP Apache 2.2 and header blocks.
Hi,
I have problem to set a Header into a SOAP Message with Apache SOAP 2.2
Here's the code to add a header to my message, but unfortunately, it doesn't seem to work.
When I look at the message by example through TunnelGui, I can't see my header.
Does Apache support the Header blocks or not?
Thanks a lot for your help,
Regards,
Cyril.
// create a vector for collecting the header elements
Vector headerElements = new Vector();
// Create a header element in a namespace
org.w3c.dom.Element headerElement =
doc.createElementNS(URI,"jaws:MessageHeader");
headerElement.setAttributeNS(URI,"SOAP-ENV:mustUnderstand","1");
// Create subnodes within the MessageHeader
org.w3c.dom.Element ele = doc.createElement("From");
org.w3c.dom.Text textNode = doc.createTextNode("Me");
org.w3c.dom.Node tempNode = ele.appendChild(textNode);
tempNode = headerElement.appendChild(ele);
ele = doc.createElement("To");
textNode = doc.createTextNode("You");
tempNode = ele.appendChild(textNode);
tempNode = headerElement.appendChild(ele);
ele = doc.createElement("MessageId");
textNode = doc.createTextNode("9999");
tempNode = ele.appendChild(textNode);
tempNode = headerElement.appendChild(ele);
headerElements.add(headerElement);
//Create the SOAP envelope
org.apache.soap.Envelope envelope = new org.apache.soap.Envelope();
//Add the SOAP header element to the envelope
org.apache.soap.Header header = new org.apache.soap.Header();
header.setHeaderEntries(headerElements);
envelope.setHeader(header);
_______________________________
Cyril Vidal
Email: cyril@planetexml.com
Web: http://www.planetexml.com
Re: SOAP Apache 2.2 and header blocks.
Posted by Scott Nichol <sn...@scottnichol.com>.
What do you see if before you call Message#send you do
System.println(env.toString());
Scott Nichol
----- Original Message -----
From: "Cyril Vidal" <cy...@planetexml.com>
To: <so...@xml.apache.org>
Sent: Tuesday, November 19, 2002 6:01 AM
Subject: SOAP Apache 2.2 and header blocks.
Hi,
I have problem to set a Header into a SOAP Message with Apache SOAP 2.2
Here's the code to add a header to my message, but unfortunately, it
doesn't seem to work.
When I look at the message by example through TunnelGui, I can't see my
header.
Does Apache support the Header blocks or not?
Thanks a lot for your help,
Regards,
Cyril.
// create a vector for collecting the header elements
Vector headerElements = new Vector();
// Create a header element in a namespace
org.w3c.dom.Element headerElement =
doc.createElementNS(URI,"jaws:MessageHeader");
headerElement.setAttributeNS(URI,"SOAP-ENV:mustUnderstand","1");
// Create subnodes within the MessageHeader
org.w3c.dom.Element ele = doc.createElement("From");
org.w3c.dom.Text textNode = doc.createTextNode("Me");
org.w3c.dom.Node tempNode = ele.appendChild(textNode);
tempNode = headerElement.appendChild(ele);
ele = doc.createElement("To");
textNode = doc.createTextNode("You");
tempNode = ele.appendChild(textNode);
tempNode = headerElement.appendChild(ele);
ele = doc.createElement("MessageId");
textNode = doc.createTextNode("9999");
tempNode = ele.appendChild(textNode);
tempNode = headerElement.appendChild(ele);
headerElements.add(headerElement);
//Create the SOAP envelope
org.apache.soap.Envelope envelope = new org.apache.soap.Envelope();
//Add the SOAP header element to the envelope
org.apache.soap.Header header = new org.apache.soap.Header();
header.setHeaderEntries(headerElements);
envelope.setHeader(header);
_______________________________
Cyril Vidal
Email: cyril@planetexml.com
Web: http://www.planetexml.com
--
To unsubscribe, e-mail: <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>
Re: SOAP Apache 2.2 and header blocks.
Posted by Scott Nichol <sn...@scottnichol.com>.
Did you see my response?
http://marc.theaimsgroup.com/?l=soap-user&m=103772521700552&w=2
Scott Nichol
----- Original Message -----
From: "Cyril Vidal" <cy...@planetexml.com>
To: <so...@xml.apache.org>
Sent: Wednesday, November 20, 2002 3:42 AM
Subject: Re: SOAP Apache 2.2 and header blocks.
Hi,
I'm sorry to ask this question again. But I just would like to know if
SOAP Apache is
supporting insertion of block headers into the envelope.
I think I've done the right things in my code: first create a Header and
populate it with a Vector, then attach it to the envelope via the
instruction envelope.setHeader(header), but I can't check it.
Thanks a lot for your response,
Regards,
Cyril.
_______________________________
Cyril Vidal
Email: cyril@planetexml.com
Web: http://www.planetexml.com
----- Original Message -----
From: Cyril Vidal
To: soap-user@xml.apache.org
Sent: Tuesday, November 19, 2002 12:01 PM
Subject: SOAP Apache 2.2 and header blocks.
Hi,
I have problem to set a Header into a SOAP Message with Apache SOAP
2.2
Here's the code to add a header to my message, but unfortunately, it
doesn't seem to work.
When I look at the message by example through TunnelGui, I can't see
my header.
Does Apache support the Header blocks or not?
Thanks a lot for your help,
Regards,
Cyril.
// create a vector for collecting the header elements
Vector headerElements = new Vector();
// Create a header element in a namespace
org.w3c.dom.Element headerElement =
doc.createElementNS(URI,"jaws:MessageHeader");
headerElement.setAttributeNS(URI,"SOAP-ENV:mustUnderstand","1");
// Create subnodes within the MessageHeader
org.w3c.dom.Element ele = doc.createElement("From");
org.w3c.dom.Text textNode = doc.createTextNode("Me");
org.w3c.dom.Node tempNode = ele.appendChild(textNode);
tempNode = headerElement.appendChild(ele);
ele = doc.createElement("To");
textNode = doc.createTextNode("You");
tempNode = ele.appendChild(textNode);
tempNode = headerElement.appendChild(ele);
ele = doc.createElement("MessageId");
textNode = doc.createTextNode("9999");
tempNode = ele.appendChild(textNode);
tempNode = headerElement.appendChild(ele);
headerElements.add(headerElement);
//Create the SOAP envelope
org.apache.soap.Envelope envelope = new org.apache.soap.Envelope();
//Add the SOAP header element to the envelope
org.apache.soap.Header header = new org.apache.soap.Header();
header.setHeaderEntries(headerElements);
envelope.setHeader(header);
_______________________________
Cyril Vidal
Email: cyril@planetexml.com
Web: http://www.planetexml.com
--
To unsubscribe, e-mail: <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>
Re: SOAP Apache 2.2 and header blocks.
Posted by Scott Nichol <sn...@scottnichol.com>.
Did you see my response?
http://marc.theaimsgroup.com/?l=soap-user&m=103772521700552&w=2
Scott Nichol
----- Original Message -----
From: "Cyril Vidal" <cy...@planetexml.com>
To: <so...@xml.apache.org>
Sent: Wednesday, November 20, 2002 3:42 AM
Subject: Re: SOAP Apache 2.2 and header blocks.
Hi,
I'm sorry to ask this question again. But I just would like to know if
SOAP Apache is
supporting insertion of block headers into the envelope.
I think I've done the right things in my code: first create a Header and
populate it with a Vector, then attach it to the envelope via the
instruction envelope.setHeader(header), but I can't check it.
Thanks a lot for your response,
Regards,
Cyril.
_______________________________
Cyril Vidal
Email: cyril@planetexml.com
Web: http://www.planetexml.com
----- Original Message -----
From: Cyril Vidal
To: soap-user@xml.apache.org
Sent: Tuesday, November 19, 2002 12:01 PM
Subject: SOAP Apache 2.2 and header blocks.
Hi,
I have problem to set a Header into a SOAP Message with Apache SOAP
2.2
Here's the code to add a header to my message, but unfortunately, it
doesn't seem to work.
When I look at the message by example through TunnelGui, I can't see
my header.
Does Apache support the Header blocks or not?
Thanks a lot for your help,
Regards,
Cyril.
// create a vector for collecting the header elements
Vector headerElements = new Vector();
// Create a header element in a namespace
org.w3c.dom.Element headerElement =
doc.createElementNS(URI,"jaws:MessageHeader");
headerElement.setAttributeNS(URI,"SOAP-ENV:mustUnderstand","1");
// Create subnodes within the MessageHeader
org.w3c.dom.Element ele = doc.createElement("From");
org.w3c.dom.Text textNode = doc.createTextNode("Me");
org.w3c.dom.Node tempNode = ele.appendChild(textNode);
tempNode = headerElement.appendChild(ele);
ele = doc.createElement("To");
textNode = doc.createTextNode("You");
tempNode = ele.appendChild(textNode);
tempNode = headerElement.appendChild(ele);
ele = doc.createElement("MessageId");
textNode = doc.createTextNode("9999");
tempNode = ele.appendChild(textNode);
tempNode = headerElement.appendChild(ele);
headerElements.add(headerElement);
//Create the SOAP envelope
org.apache.soap.Envelope envelope = new org.apache.soap.Envelope();
//Add the SOAP header element to the envelope
org.apache.soap.Header header = new org.apache.soap.Header();
header.setHeaderEntries(headerElements);
envelope.setHeader(header);
_______________________________
Cyril Vidal
Email: cyril@planetexml.com
Web: http://www.planetexml.com
Re: SOAP Apache 2.2 and header blocks.
Posted by Cyril Vidal <cy...@planetexml.com>.
Hi,
I'm sorry to ask this question again. But I just would like to know if SOAP Apache is
supporting insertion of block headers into the envelope.
I think I've done the right things in my code: first create a Header and populate it with a Vector, then attach it to the envelope via the instruction envelope.setHeader(header), but I can't check it.
Thanks a lot for your response,
Regards,
Cyril.
_______________________________
Cyril Vidal
Email: cyril@planetexml.com
Web: http://www.planetexml.com
----- Original Message -----
From: Cyril Vidal
To: soap-user@xml.apache.org
Sent: Tuesday, November 19, 2002 12:01 PM
Subject: SOAP Apache 2.2 and header blocks.
Hi,
I have problem to set a Header into a SOAP Message with Apache SOAP 2.2
Here's the code to add a header to my message, but unfortunately, it doesn't seem to work.
When I look at the message by example through TunnelGui, I can't see my header.
Does Apache support the Header blocks or not?
Thanks a lot for your help,
Regards,
Cyril.
// create a vector for collecting the header elements
Vector headerElements = new Vector();
// Create a header element in a namespace
org.w3c.dom.Element headerElement =
doc.createElementNS(URI,"jaws:MessageHeader");
headerElement.setAttributeNS(URI,"SOAP-ENV:mustUnderstand","1");
// Create subnodes within the MessageHeader
org.w3c.dom.Element ele = doc.createElement("From");
org.w3c.dom.Text textNode = doc.createTextNode("Me");
org.w3c.dom.Node tempNode = ele.appendChild(textNode);
tempNode = headerElement.appendChild(ele);
ele = doc.createElement("To");
textNode = doc.createTextNode("You");
tempNode = ele.appendChild(textNode);
tempNode = headerElement.appendChild(ele);
ele = doc.createElement("MessageId");
textNode = doc.createTextNode("9999");
tempNode = ele.appendChild(textNode);
tempNode = headerElement.appendChild(ele);
headerElements.add(headerElement);
//Create the SOAP envelope
org.apache.soap.Envelope envelope = new org.apache.soap.Envelope();
//Add the SOAP header element to the envelope
org.apache.soap.Header header = new org.apache.soap.Header();
header.setHeaderEntries(headerElements);
envelope.setHeader(header);
_______________________________
Cyril Vidal
Email: cyril@planetexml.com
Web: http://www.planetexml.com
Re: Accessing web service from an applet
Posted by Scott Nichol <sn...@scottnichol.com>.
javadoc should not care what kind of source it's being run on.
Scott Nichol
----- Original Message -----
From: "John Kirksey" <jo...@verizon.net>
To: <so...@xml.apache.org>
Sent: Thursday, November 21, 2002 4:31 PM
Subject: Re: Accessing web service from an applet
> Scott,
>
> Thanks for the advice. I created a servlet to handle my web service
> requests, and it works perfectly! What an education for a Microsoft
geek...
>
> Incidentally, does anyone know if Javadoc should work for applets and
> servlets? I am getting a java.lang.NullPointerException at
> java.util.zip.ZipFile.getInputStream() when I run it. The only common
> denominator I notice is that it only happens on applets and servlets,
but
> not with applications.
>
> Regards,
>
> John Kirksey
>
>
> > ----- Original Message -----
> > From: "Scott Nichol" <sn...@scottnichol.com>
> > To: <so...@xml.apache.org>
> > Sent: Tuesday, November 19, 2002 10:27 AM
> > Subject: Re: Accessing web service from an applet
> >
> >
> > > For security reasons, an applet can only connect to the host from
> > which
> > > is was loaded. See, e.g., http://java.sun.com/sfaq/#socket.
> > >
> > > The two things I have done to get around this are (1) set up a
proxy
> > on
> > > that host or (2) delegate actions to servlets. In your case, you
> > could
> > > also consider writing proxy SOAP service classes. Your applet
would
> > > make SOAP calls to the host from which it was loaded. The
services on
> > > that host would be clients of the real services, forwarding
parameters
> > > received from the applet to the real service, then forwarding
> > responses
> > > from the real service to your applet.
> > >
> > > Scott Nichol
> > >
> > > ----- Original Message -----
> > > From: "John Kirksey" <jo...@verizon.net>
> > > To: <so...@xml.apache.org>
> > > Sent: Tuesday, November 19, 2002 10:03 AM
> > > Subject: Accessing web service from an applet
> > >
> > >
> > > Hello, I am new to Java web services; all of my experience is with
> > > Microsoft's SOAP toolkit.
> > >
> > > Is it possible to access a web service from an applet? I am a part
> > time
> > > Information Systems student, and I want to have an applet that
> > connects
> > > to a stock quote service (among other things).
> > >
> > > I have installed the Apache toolkit and tested the sample stock
quote
> > > client, and it works perfectly. I have even used several other web
> > > services on Xmethods.com, each successfully. When I convert the
code
> > to
> > > an applet, I am now getting:
> > >
> > > java.security.AccessControlException: access denied
> > > (java.net.SocketPermission 66.28.98.121:9090 connect,resolve)
> > >
> > > How can I overcome this?
> > >
> > > Thanks in advance,
> > >
> > > John Kirksey
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@xml.apache.org>
> > For additional commands, e-mail:
<ma...@xml.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>
Re: Accessing web service from an applet
Posted by Scott Nichol <sn...@scottnichol.com>.
javadoc should not care what kind of source it's being run on.
Scott Nichol
----- Original Message -----
From: "John Kirksey" <jo...@verizon.net>
To: <so...@xml.apache.org>
Sent: Thursday, November 21, 2002 4:31 PM
Subject: Re: Accessing web service from an applet
> Scott,
>
> Thanks for the advice. I created a servlet to handle my web service
> requests, and it works perfectly! What an education for a Microsoft
geek...
>
> Incidentally, does anyone know if Javadoc should work for applets and
> servlets? I am getting a java.lang.NullPointerException at
> java.util.zip.ZipFile.getInputStream() when I run it. The only common
> denominator I notice is that it only happens on applets and servlets,
but
> not with applications.
>
> Regards,
>
> John Kirksey
>
>
> > ----- Original Message -----
> > From: "Scott Nichol" <sn...@scottnichol.com>
> > To: <so...@xml.apache.org>
> > Sent: Tuesday, November 19, 2002 10:27 AM
> > Subject: Re: Accessing web service from an applet
> >
> >
> > > For security reasons, an applet can only connect to the host from
> > which
> > > is was loaded. See, e.g., http://java.sun.com/sfaq/#socket.
> > >
> > > The two things I have done to get around this are (1) set up a
proxy
> > on
> > > that host or (2) delegate actions to servlets. In your case, you
> > could
> > > also consider writing proxy SOAP service classes. Your applet
would
> > > make SOAP calls to the host from which it was loaded. The
services on
> > > that host would be clients of the real services, forwarding
parameters
> > > received from the applet to the real service, then forwarding
> > responses
> > > from the real service to your applet.
> > >
> > > Scott Nichol
> > >
> > > ----- Original Message -----
> > > From: "John Kirksey" <jo...@verizon.net>
> > > To: <so...@xml.apache.org>
> > > Sent: Tuesday, November 19, 2002 10:03 AM
> > > Subject: Accessing web service from an applet
> > >
> > >
> > > Hello, I am new to Java web services; all of my experience is with
> > > Microsoft's SOAP toolkit.
> > >
> > > Is it possible to access a web service from an applet? I am a part
> > time
> > > Information Systems student, and I want to have an applet that
> > connects
> > > to a stock quote service (among other things).
> > >
> > > I have installed the Apache toolkit and tested the sample stock
quote
> > > client, and it works perfectly. I have even used several other web
> > > services on Xmethods.com, each successfully. When I convert the
code
> > to
> > > an applet, I am now getting:
> > >
> > > java.security.AccessControlException: access denied
> > > (java.net.SocketPermission 66.28.98.121:9090 connect,resolve)
> > >
> > > How can I overcome this?
> > >
> > > Thanks in advance,
> > >
> > > John Kirksey
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@xml.apache.org>
> > > For additional commands, e-mail:
> > <ma...@xml.apache.org>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@xml.apache.org>
> > For additional commands, e-mail:
<ma...@xml.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>
Re: Accessing web service from an applet
Posted by John Kirksey <jo...@verizon.net>.
Scott,
Thanks for the advice. I created a servlet to handle my web service
requests, and it works perfectly! What an education for a Microsoft geek...
Incidentally, does anyone know if Javadoc should work for applets and
servlets? I am getting a java.lang.NullPointerException at
java.util.zip.ZipFile.getInputStream() when I run it. The only common
denominator I notice is that it only happens on applets and servlets, but
not with applications.
Regards,
John Kirksey
> ----- Original Message -----
> From: "Scott Nichol" <sn...@scottnichol.com>
> To: <so...@xml.apache.org>
> Sent: Tuesday, November 19, 2002 10:27 AM
> Subject: Re: Accessing web service from an applet
>
>
> > For security reasons, an applet can only connect to the host from
> which
> > is was loaded. See, e.g., http://java.sun.com/sfaq/#socket.
> >
> > The two things I have done to get around this are (1) set up a proxy
> on
> > that host or (2) delegate actions to servlets. In your case, you
> could
> > also consider writing proxy SOAP service classes. Your applet would
> > make SOAP calls to the host from which it was loaded. The services on
> > that host would be clients of the real services, forwarding parameters
> > received from the applet to the real service, then forwarding
> responses
> > from the real service to your applet.
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "John Kirksey" <jo...@verizon.net>
> > To: <so...@xml.apache.org>
> > Sent: Tuesday, November 19, 2002 10:03 AM
> > Subject: Accessing web service from an applet
> >
> >
> > Hello, I am new to Java web services; all of my experience is with
> > Microsoft's SOAP toolkit.
> >
> > Is it possible to access a web service from an applet? I am a part
> time
> > Information Systems student, and I want to have an applet that
> connects
> > to a stock quote service (among other things).
> >
> > I have installed the Apache toolkit and tested the sample stock quote
> > client, and it works perfectly. I have even used several other web
> > services on Xmethods.com, each successfully. When I convert the code
> to
> > an applet, I am now getting:
> >
> > java.security.AccessControlException: access denied
> > (java.net.SocketPermission 66.28.98.121:9090 connect,resolve)
> >
> > How can I overcome this?
> >
> > Thanks in advance,
> >
> > John Kirksey
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail: <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
--
To unsubscribe, e-mail: <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>
Re: Accessing web service from an applet
Posted by John Kirksey <jo...@verizon.net>.
Thanks to all for the advice, I'll let you know how it goes!
Regards,
John Kirksey
----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Tuesday, November 19, 2002 10:51 AM
Subject: Re: Accessing web service from an applet
> Information on the Java plug-in is at
> http://java.sun.com/j2se/1.4.1/docs/guide/plugin/developer_guide/overvie
> w.html. As suggested by Alex, you can probably use this and signed
> applets to get around the original applet security restrictions.
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Scott Nichol" <sn...@scottnichol.com>
> To: <so...@xml.apache.org>
> Sent: Tuesday, November 19, 2002 10:27 AM
> Subject: Re: Accessing web service from an applet
>
>
> > For security reasons, an applet can only connect to the host from
> which
> > is was loaded. See, e.g., http://java.sun.com/sfaq/#socket.
> >
> > The two things I have done to get around this are (1) set up a proxy
> on
> > that host or (2) delegate actions to servlets. In your case, you
> could
> > also consider writing proxy SOAP service classes. Your applet would
> > make SOAP calls to the host from which it was loaded. The services on
> > that host would be clients of the real services, forwarding parameters
> > received from the applet to the real service, then forwarding
> responses
> > from the real service to your applet.
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "John Kirksey" <jo...@verizon.net>
> > To: <so...@xml.apache.org>
> > Sent: Tuesday, November 19, 2002 10:03 AM
> > Subject: Accessing web service from an applet
> >
> >
> > Hello, I am new to Java web services; all of my experience is with
> > Microsoft's SOAP toolkit.
> >
> > Is it possible to access a web service from an applet? I am a part
> time
> > Information Systems student, and I want to have an applet that
> connects
> > to a stock quote service (among other things).
> >
> > I have installed the Apache toolkit and tested the sample stock quote
> > client, and it works perfectly. I have even used several other web
> > services on Xmethods.com, each successfully. When I convert the code
> to
> > an applet, I am now getting:
> >
> > java.security.AccessControlException: access denied
> > (java.net.SocketPermission 66.28.98.121:9090 connect,resolve)
> >
> > How can I overcome this?
> >
> > Thanks in advance,
> >
> > John Kirksey
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail: <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
--
To unsubscribe, e-mail: <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>
Re: Accessing web service from an applet
Posted by John Kirksey <jo...@verizon.net>.
Thanks to all for the advice, I'll let you know how it goes!
Regards,
John Kirksey
----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Tuesday, November 19, 2002 10:51 AM
Subject: Re: Accessing web service from an applet
> Information on the Java plug-in is at
> http://java.sun.com/j2se/1.4.1/docs/guide/plugin/developer_guide/overvie
> w.html. As suggested by Alex, you can probably use this and signed
> applets to get around the original applet security restrictions.
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Scott Nichol" <sn...@scottnichol.com>
> To: <so...@xml.apache.org>
> Sent: Tuesday, November 19, 2002 10:27 AM
> Subject: Re: Accessing web service from an applet
>
>
> > For security reasons, an applet can only connect to the host from
> which
> > is was loaded. See, e.g., http://java.sun.com/sfaq/#socket.
> >
> > The two things I have done to get around this are (1) set up a proxy
> on
> > that host or (2) delegate actions to servlets. In your case, you
> could
> > also consider writing proxy SOAP service classes. Your applet would
> > make SOAP calls to the host from which it was loaded. The services on
> > that host would be clients of the real services, forwarding parameters
> > received from the applet to the real service, then forwarding
> responses
> > from the real service to your applet.
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "John Kirksey" <jo...@verizon.net>
> > To: <so...@xml.apache.org>
> > Sent: Tuesday, November 19, 2002 10:03 AM
> > Subject: Accessing web service from an applet
> >
> >
> > Hello, I am new to Java web services; all of my experience is with
> > Microsoft's SOAP toolkit.
> >
> > Is it possible to access a web service from an applet? I am a part
> time
> > Information Systems student, and I want to have an applet that
> connects
> > to a stock quote service (among other things).
> >
> > I have installed the Apache toolkit and tested the sample stock quote
> > client, and it works perfectly. I have even used several other web
> > services on Xmethods.com, each successfully. When I convert the code
> to
> > an applet, I am now getting:
> >
> > java.security.AccessControlException: access denied
> > (java.net.SocketPermission 66.28.98.121:9090 connect,resolve)
> >
> > How can I overcome this?
> >
> > Thanks in advance,
> >
> > John Kirksey
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail: <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
Re: Accessing web service from an applet
Posted by John Kirksey <jo...@verizon.net>.
Scott,
Thanks for the advice. I created a servlet to handle my web service
requests, and it works perfectly! What an education for a Microsoft geek...
Incidentally, does anyone know if Javadoc should work for applets and
servlets? I am getting a java.lang.NullPointerException at
java.util.zip.ZipFile.getInputStream() when I run it. The only common
denominator I notice is that it only happens on applets and servlets, but
not with applications.
Regards,
John Kirksey
> ----- Original Message -----
> From: "Scott Nichol" <sn...@scottnichol.com>
> To: <so...@xml.apache.org>
> Sent: Tuesday, November 19, 2002 10:27 AM
> Subject: Re: Accessing web service from an applet
>
>
> > For security reasons, an applet can only connect to the host from
> which
> > is was loaded. See, e.g., http://java.sun.com/sfaq/#socket.
> >
> > The two things I have done to get around this are (1) set up a proxy
> on
> > that host or (2) delegate actions to servlets. In your case, you
> could
> > also consider writing proxy SOAP service classes. Your applet would
> > make SOAP calls to the host from which it was loaded. The services on
> > that host would be clients of the real services, forwarding parameters
> > received from the applet to the real service, then forwarding
> responses
> > from the real service to your applet.
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "John Kirksey" <jo...@verizon.net>
> > To: <so...@xml.apache.org>
> > Sent: Tuesday, November 19, 2002 10:03 AM
> > Subject: Accessing web service from an applet
> >
> >
> > Hello, I am new to Java web services; all of my experience is with
> > Microsoft's SOAP toolkit.
> >
> > Is it possible to access a web service from an applet? I am a part
> time
> > Information Systems student, and I want to have an applet that
> connects
> > to a stock quote service (among other things).
> >
> > I have installed the Apache toolkit and tested the sample stock quote
> > client, and it works perfectly. I have even used several other web
> > services on Xmethods.com, each successfully. When I convert the code
> to
> > an applet, I am now getting:
> >
> > java.security.AccessControlException: access denied
> > (java.net.SocketPermission 66.28.98.121:9090 connect,resolve)
> >
> > How can I overcome this?
> >
> > Thanks in advance,
> >
> > John Kirksey
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@xml.apache.org>
> > For additional commands, e-mail:
> <ma...@xml.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail: <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
Re: Accessing web service from an applet
Posted by Scott Nichol <sn...@scottnichol.com>.
Information on the Java plug-in is at
http://java.sun.com/j2se/1.4.1/docs/guide/plugin/developer_guide/overvie
w.html. As suggested by Alex, you can probably use this and signed
applets to get around the original applet security restrictions.
Scott Nichol
----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Tuesday, November 19, 2002 10:27 AM
Subject: Re: Accessing web service from an applet
> For security reasons, an applet can only connect to the host from
which
> is was loaded. See, e.g., http://java.sun.com/sfaq/#socket.
>
> The two things I have done to get around this are (1) set up a proxy
on
> that host or (2) delegate actions to servlets. In your case, you
could
> also consider writing proxy SOAP service classes. Your applet would
> make SOAP calls to the host from which it was loaded. The services on
> that host would be clients of the real services, forwarding parameters
> received from the applet to the real service, then forwarding
responses
> from the real service to your applet.
>
> Scott Nichol
>
> ----- Original Message -----
> From: "John Kirksey" <jo...@verizon.net>
> To: <so...@xml.apache.org>
> Sent: Tuesday, November 19, 2002 10:03 AM
> Subject: Accessing web service from an applet
>
>
> Hello, I am new to Java web services; all of my experience is with
> Microsoft's SOAP toolkit.
>
> Is it possible to access a web service from an applet? I am a part
time
> Information Systems student, and I want to have an applet that
connects
> to a stock quote service (among other things).
>
> I have installed the Apache toolkit and tested the sample stock quote
> client, and it works perfectly. I have even used several other web
> services on Xmethods.com, each successfully. When I convert the code
to
> an applet, I am now getting:
>
> java.security.AccessControlException: access denied
> (java.net.SocketPermission 66.28.98.121:9090 connect,resolve)
>
> How can I overcome this?
>
> Thanks in advance,
>
> John Kirksey
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>
Re: Accessing web service from an applet
Posted by Scott Nichol <sn...@scottnichol.com>.
Information on the Java plug-in is at
http://java.sun.com/j2se/1.4.1/docs/guide/plugin/developer_guide/overvie
w.html. As suggested by Alex, you can probably use this and signed
applets to get around the original applet security restrictions.
Scott Nichol
----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Tuesday, November 19, 2002 10:27 AM
Subject: Re: Accessing web service from an applet
> For security reasons, an applet can only connect to the host from
which
> is was loaded. See, e.g., http://java.sun.com/sfaq/#socket.
>
> The two things I have done to get around this are (1) set up a proxy
on
> that host or (2) delegate actions to servlets. In your case, you
could
> also consider writing proxy SOAP service classes. Your applet would
> make SOAP calls to the host from which it was loaded. The services on
> that host would be clients of the real services, forwarding parameters
> received from the applet to the real service, then forwarding
responses
> from the real service to your applet.
>
> Scott Nichol
>
> ----- Original Message -----
> From: "John Kirksey" <jo...@verizon.net>
> To: <so...@xml.apache.org>
> Sent: Tuesday, November 19, 2002 10:03 AM
> Subject: Accessing web service from an applet
>
>
> Hello, I am new to Java web services; all of my experience is with
> Microsoft's SOAP toolkit.
>
> Is it possible to access a web service from an applet? I am a part
time
> Information Systems student, and I want to have an applet that
connects
> to a stock quote service (among other things).
>
> I have installed the Apache toolkit and tested the sample stock quote
> client, and it works perfectly. I have even used several other web
> services on Xmethods.com, each successfully. When I convert the code
to
> an applet, I am now getting:
>
> java.security.AccessControlException: access denied
> (java.net.SocketPermission 66.28.98.121:9090 connect,resolve)
>
> How can I overcome this?
>
> Thanks in advance,
>
> John Kirksey
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>
Re: Accessing web service from an applet
Posted by Scott Nichol <sn...@scottnichol.com>.
For security reasons, an applet can only connect to the host from which
is was loaded. See, e.g., http://java.sun.com/sfaq/#socket.
The two things I have done to get around this are (1) set up a proxy on
that host or (2) delegate actions to servlets. In your case, you could
also consider writing proxy SOAP service classes. Your applet would
make SOAP calls to the host from which it was loaded. The services on
that host would be clients of the real services, forwarding parameters
received from the applet to the real service, then forwarding responses
from the real service to your applet.
Scott Nichol
----- Original Message -----
From: "John Kirksey" <jo...@verizon.net>
To: <so...@xml.apache.org>
Sent: Tuesday, November 19, 2002 10:03 AM
Subject: Accessing web service from an applet
Hello, I am new to Java web services; all of my experience is with
Microsoft's SOAP toolkit.
Is it possible to access a web service from an applet? I am a part time
Information Systems student, and I want to have an applet that connects
to a stock quote service (among other things).
I have installed the Apache toolkit and tested the sample stock quote
client, and it works perfectly. I have even used several other web
services on Xmethods.com, each successfully. When I convert the code to
an applet, I am now getting:
java.security.AccessControlException: access denied
(java.net.SocketPermission 66.28.98.121:9090 connect,resolve)
How can I overcome this?
Thanks in advance,
John Kirksey
Re: Accessing web service from an applet
Posted by Tom Myers <to...@dreamscape.com>.
John Kirksey wrote:
> Is it possible to access a web service from an applet? I am a part time
> Information Systems student, and I want to have an applet that connects
> to a stock quote service (among other things)....
>
> java.security.AccessControlException: access denied
> (java.net.SocketPermission 66.28.98.121:9090 connect,resolve)
If you're not at all concerned about security, you can probably get it
to work by putting your applet jar in your lib/ext directory, which by
default gives it AllPermissions. Note that you may have more than one
lib/ext directory, e.g. one for the JDK and one for the JRE; for play
purposes it may be easier to drop it into all than figure out which
is being used by the browser, but if you're using the Java Plug-In
it's not hard. (On Windows: Start/Settings/Control Panel/Java Plug-In,
click Advanced tab, choose a specific "Java Runtime Environment".)
If you are concerned about security, then the problem with this
solution is that you may then also need to move other jars into the
same directory, e.g. soap.jar and so forth; if they are "below" your
applet's own jar in the classloader hierarchy, then they won't be
seen even though they are on the classpath. Life is difficult; do
you want to give these guys AllPermissions? You can't write a
distributable app that way unless everybody you distribute it to
trusts you completely...but it may be what you want, for now.
Tom Myers
Re: Accessing web service from an applet
Posted by Alex Dovlecel <do...@kbs.twi.tudelft.nl>.
Hi
This is all that I know and in fact I never used applets. So if there is
someone qualified to explain this better...
All I can say is this is related to java architecture. In fact this is the
way it should happen. An appled is runned in a sandbox. That means that you
are not allowed to do certain things like: accessing the local disk, use
internet connections (except to the server where the applet was downloaded
from), access informations from local machine... and so on.
If you HAVE TO create an Applet, you could download the Java Plugin that
allow the applet to run with the jre installed from java (and not default
java machine from the browser) and provide some security mechanisms that
allows trusted applets to access several services (like allow it to open an
internet connection, or access the local information and so on).
there is another posibility... to sign your jar (or cab if for windows)...
but never understood how. :o(((
Hope it (somehow) helps
dovle
> Hello, I am new to Java web services; all of my experience is with
> Microsoft's SOAP toolkit.
>
> Is it possible to access a web service from an applet? I am a part time
> Information Systems student, and I want to have an applet that connects to
> a stock quote service (among other things).
>
> I have installed the Apache toolkit and tested the sample stock quote
> client, and it works perfectly. I have even used several other web services
> on Xmethods.com, each successfully. When I convert the code to an applet, I
> am now getting:
>
> java.security.AccessControlException: access denied
> (java.net.SocketPermission 66.28.98.121:9090 connect,resolve)
>
> How can I overcome this?
>
> Thanks in advance,
>
> John Kirksey
Re: Accessing web service from an applet
Posted by Scott Nichol <sn...@scottnichol.com>.
For security reasons, an applet can only connect to the host from which
is was loaded. See, e.g., http://java.sun.com/sfaq/#socket.
The two things I have done to get around this are (1) set up a proxy on
that host or (2) delegate actions to servlets. In your case, you could
also consider writing proxy SOAP service classes. Your applet would
make SOAP calls to the host from which it was loaded. The services on
that host would be clients of the real services, forwarding parameters
received from the applet to the real service, then forwarding responses
from the real service to your applet.
Scott Nichol
----- Original Message -----
From: "John Kirksey" <jo...@verizon.net>
To: <so...@xml.apache.org>
Sent: Tuesday, November 19, 2002 10:03 AM
Subject: Accessing web service from an applet
Hello, I am new to Java web services; all of my experience is with
Microsoft's SOAP toolkit.
Is it possible to access a web service from an applet? I am a part time
Information Systems student, and I want to have an applet that connects
to a stock quote service (among other things).
I have installed the Apache toolkit and tested the sample stock quote
client, and it works perfectly. I have even used several other web
services on Xmethods.com, each successfully. When I convert the code to
an applet, I am now getting:
java.security.AccessControlException: access denied
(java.net.SocketPermission 66.28.98.121:9090 connect,resolve)
How can I overcome this?
Thanks in advance,
John Kirksey
--
To unsubscribe, e-mail: <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>
Re: Accessing web service from an applet
Posted by Alex Dovlecel <do...@kbs.twi.tudelft.nl>.
Hi
This is all that I know and in fact I never used applets. So if there is
someone qualified to explain this better...
All I can say is this is related to java architecture. In fact this is the
way it should happen. An appled is runned in a sandbox. That means that you
are not allowed to do certain things like: accessing the local disk, use
internet connections (except to the server where the applet was downloaded
from), access informations from local machine... and so on.
If you HAVE TO create an Applet, you could download the Java Plugin that
allow the applet to run with the jre installed from java (and not default
java machine from the browser) and provide some security mechanisms that
allows trusted applets to access several services (like allow it to open an
internet connection, or access the local information and so on).
there is another posibility... to sign your jar (or cab if for windows)...
but never understood how. :o(((
Hope it (somehow) helps
dovle
> Hello, I am new to Java web services; all of my experience is with
> Microsoft's SOAP toolkit.
>
> Is it possible to access a web service from an applet? I am a part time
> Information Systems student, and I want to have an applet that connects to
> a stock quote service (among other things).
>
> I have installed the Apache toolkit and tested the sample stock quote
> client, and it works perfectly. I have even used several other web services
> on Xmethods.com, each successfully. When I convert the code to an applet, I
> am now getting:
>
> java.security.AccessControlException: access denied
> (java.net.SocketPermission 66.28.98.121:9090 connect,resolve)
>
> How can I overcome this?
>
> Thanks in advance,
>
> John Kirksey
--
To unsubscribe, e-mail: <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>
Re: Accessing web service from an applet
Posted by Tom Myers <to...@dreamscape.com>.
John Kirksey wrote:
> Is it possible to access a web service from an applet? I am a part time
> Information Systems student, and I want to have an applet that connects
> to a stock quote service (among other things)....
>
> java.security.AccessControlException: access denied
> (java.net.SocketPermission 66.28.98.121:9090 connect,resolve)
If you're not at all concerned about security, you can probably get it
to work by putting your applet jar in your lib/ext directory, which by
default gives it AllPermissions. Note that you may have more than one
lib/ext directory, e.g. one for the JDK and one for the JRE; for play
purposes it may be easier to drop it into all than figure out which
is being used by the browser, but if you're using the Java Plug-In
it's not hard. (On Windows: Start/Settings/Control Panel/Java Plug-In,
click Advanced tab, choose a specific "Java Runtime Environment".)
If you are concerned about security, then the problem with this
solution is that you may then also need to move other jars into the
same directory, e.g. soap.jar and so forth; if they are "below" your
applet's own jar in the classloader hierarchy, then they won't be
seen even though they are on the classpath. Life is difficult; do
you want to give these guys AllPermissions? You can't write a
distributable app that way unless everybody you distribute it to
trusts you completely...but it may be what you want, for now.
Tom Myers
--
To unsubscribe, e-mail: <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>
Accessing web service from an applet
Posted by John Kirksey <jo...@verizon.net>.
Hello, I am new to Java web services; all of my experience is with Microsoft's SOAP toolkit.
Is it possible to access a web service from an applet? I am a part time Information Systems student, and I want to have an applet that connects to a stock quote service (among other things).
I have installed the Apache toolkit and tested the sample stock quote client, and it works perfectly. I have even used several other web services on Xmethods.com, each successfully. When I convert the code to an applet, I am now getting:
java.security.AccessControlException: access denied (java.net.SocketPermission 66.28.98.121:9090 connect,resolve)
How can I overcome this?
Thanks in advance,
John Kirksey
Accessing web service from an applet
Posted by John Kirksey <jo...@verizon.net>.
Hello, I am new to Java web services; all of my experience is with Microsoft's SOAP toolkit.
Is it possible to access a web service from an applet? I am a part time Information Systems student, and I want to have an applet that connects to a stock quote service (among other things).
I have installed the Apache toolkit and tested the sample stock quote client, and it works perfectly. I have even used several other web services on Xmethods.com, each successfully. When I convert the code to an applet, I am now getting:
java.security.AccessControlException: access denied (java.net.SocketPermission 66.28.98.121:9090 connect,resolve)
How can I overcome this?
Thanks in advance,
John Kirksey
Re: SOAP Apache 2.2 and header blocks.
Posted by Cyril Vidal <cy...@planetexml.com>.
Hi,
I'm sorry to ask this question again. But I just would like to know if SOAP Apache is
supporting insertion of block headers into the envelope.
I think I've done the right things in my code: first create a Header and populate it with a Vector, then attach it to the envelope via the instruction envelope.setHeader(header), but I can't check it.
Thanks a lot for your response,
Regards,
Cyril.
_______________________________
Cyril Vidal
Email: cyril@planetexml.com
Web: http://www.planetexml.com
----- Original Message -----
From: Cyril Vidal
To: soap-user@xml.apache.org
Sent: Tuesday, November 19, 2002 12:01 PM
Subject: SOAP Apache 2.2 and header blocks.
Hi,
I have problem to set a Header into a SOAP Message with Apache SOAP 2.2
Here's the code to add a header to my message, but unfortunately, it doesn't seem to work.
When I look at the message by example through TunnelGui, I can't see my header.
Does Apache support the Header blocks or not?
Thanks a lot for your help,
Regards,
Cyril.
// create a vector for collecting the header elements
Vector headerElements = new Vector();
// Create a header element in a namespace
org.w3c.dom.Element headerElement =
doc.createElementNS(URI,"jaws:MessageHeader");
headerElement.setAttributeNS(URI,"SOAP-ENV:mustUnderstand","1");
// Create subnodes within the MessageHeader
org.w3c.dom.Element ele = doc.createElement("From");
org.w3c.dom.Text textNode = doc.createTextNode("Me");
org.w3c.dom.Node tempNode = ele.appendChild(textNode);
tempNode = headerElement.appendChild(ele);
ele = doc.createElement("To");
textNode = doc.createTextNode("You");
tempNode = ele.appendChild(textNode);
tempNode = headerElement.appendChild(ele);
ele = doc.createElement("MessageId");
textNode = doc.createTextNode("9999");
tempNode = ele.appendChild(textNode);
tempNode = headerElement.appendChild(ele);
headerElements.add(headerElement);
//Create the SOAP envelope
org.apache.soap.Envelope envelope = new org.apache.soap.Envelope();
//Add the SOAP header element to the envelope
org.apache.soap.Header header = new org.apache.soap.Header();
header.setHeaderEntries(headerElements);
envelope.setHeader(header);
_______________________________
Cyril Vidal
Email: cyril@planetexml.com
Web: http://www.planetexml.com
Re: SOAP Apache 2.2 and header blocks.
Posted by Scott Nichol <sn...@scottnichol.com>.
What do you see if before you call Message#send you do
System.println(env.toString());
Scott Nichol
----- Original Message -----
From: "Cyril Vidal" <cy...@planetexml.com>
To: <so...@xml.apache.org>
Sent: Tuesday, November 19, 2002 6:01 AM
Subject: SOAP Apache 2.2 and header blocks.
Hi,
I have problem to set a Header into a SOAP Message with Apache SOAP 2.2
Here's the code to add a header to my message, but unfortunately, it
doesn't seem to work.
When I look at the message by example through TunnelGui, I can't see my
header.
Does Apache support the Header blocks or not?
Thanks a lot for your help,
Regards,
Cyril.
// create a vector for collecting the header elements
Vector headerElements = new Vector();
// Create a header element in a namespace
org.w3c.dom.Element headerElement =
doc.createElementNS(URI,"jaws:MessageHeader");
headerElement.setAttributeNS(URI,"SOAP-ENV:mustUnderstand","1");
// Create subnodes within the MessageHeader
org.w3c.dom.Element ele = doc.createElement("From");
org.w3c.dom.Text textNode = doc.createTextNode("Me");
org.w3c.dom.Node tempNode = ele.appendChild(textNode);
tempNode = headerElement.appendChild(ele);
ele = doc.createElement("To");
textNode = doc.createTextNode("You");
tempNode = ele.appendChild(textNode);
tempNode = headerElement.appendChild(ele);
ele = doc.createElement("MessageId");
textNode = doc.createTextNode("9999");
tempNode = ele.appendChild(textNode);
tempNode = headerElement.appendChild(ele);
headerElements.add(headerElement);
//Create the SOAP envelope
org.apache.soap.Envelope envelope = new org.apache.soap.Envelope();
//Add the SOAP header element to the envelope
org.apache.soap.Header header = new org.apache.soap.Header();
header.setHeaderEntries(headerElements);
envelope.setHeader(header);
_______________________________
Cyril Vidal
Email: cyril@planetexml.com
Web: http://www.planetexml.com