You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by Cyril Vidal <cy...@planetexml.com> on 2002/11/11 18:15:29 UTC

soap + javascript

Hi,

I would like to implement a SOAP service in Javascript.
1°) First, I've added bsf.jar and js.jar on my classpath (I've put these two .jar in SDK_HOME/jre/lib/ext).
2°) I've defined the following very simple deployment descriptor for my service, defining the method envoieMessage():
<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment" 

id="urn:bonjourscript">

<isd:provider type="script" scope="Application" methods="envoieMessage">

<isd:script language="javascript">


function envoieMessage(name) 

{

var today = new java.util.Date();

java.lang.System.out.println("Today is " 

+ today.toString());


return "Hello " + name + ", How are 

you?";

} 

</isd:script>

</isd:provider> 

</isd:service>

Unfortunately, when I run my Client application, I receive the following error message:

Fault String: BSF Error: Javascript Error: function envoieMessage not found.

Some of you could help me please?

Thanks in advance,

Cyril.

_______________________________

Cyril Vidal
Email: cyril@planetexml.com
Web: http://www.planetexml.com

Re: soap + javascript

Posted by Cyril Vidal <cy...@planetexml.com>.
Thanks for your response.
It's now running: it was a very strange error message because the root cause
was not a problem of class path but an
error in the javascript code:
java.lang.System.out.println("Today is "
 + today.toString());
For js.jar , the literal was not terminated....

Regards,
Cyril.

_______________________________

Cyril Vidal
Email: cyril@planetexml.com
Web: http://www.planetexml.com
----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Tuesday, November 12, 2002 5:05 PM
Subject: Re: soap + javascript


> Your deployment descriptor works for me.  I have js.jar and bsf.jar in
> $CATALINA_HOME/webapps/soap/WEB-INF/lib, although I am not sure that
> makes any difference.  Something to watch out for: you must restart the
> webapp (e.g. by restarting your servlet container) any time you change
> the JavaScript.  BSF and/or Rhino cache the script.  Undeploying,
> changing the deployment descriptor, and re-deploying will *not* change
> the script.
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Cyril Vidal" <cy...@planetexml.com>
> To: <so...@xml.apache.org>
> Sent: Monday, November 11, 2002 12:15 PM
> Subject: soap + javascript
>
>
> Hi,
>
> I would like to implement a SOAP service in Javascript.
> 1°) First, I've added bsf.jar and js.jar on my classpath (I've put these
> two .jar in SDK_HOME/jre/lib/ext).
> 2°) I've defined the following very simple deployment descriptor for my
> service, defining the method envoieMessage():
> <isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
>
> id="urn:bonjourscript">
>
> <isd:provider type="script" scope="Application" methods="envoieMessage">
>
> <isd:script language="javascript">
>
>
> function envoieMessage(name)
>
> {
>
> var today = new java.util.Date();
>
> java.lang.System.out.println("Today is "
>
> + today.toString());
>
>
> return "Hello " + name + ", How are
>
> you?";
>
> }
>
> </isd:script>
>
> </isd:provider>
>
> </isd:service>
>
> Unfortunately, when I run my Client application, I receive the following
> error message:
>
> Fault String: BSF Error: Javascript Error: function envoieMessage not
> found.
>
> Some of you could help me please?
>
> Thanks in advance,
>
> Cyril.
>
> _______________________________
>
> 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>
>



--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: soap + javascript

Posted by Scott Nichol <sn...@scottnichol.com>.
I know that Apache SOAP supports this, but I do not know about Axis.

Scott Nichol

----- Original Message -----
From: "Robert Dietrick" <rd...@sega.com>
To: <so...@xml.apache.org>
Sent: Tuesday, November 12, 2002 1:08 PM
Subject: Re: soap + javascript


> Excuse my ignorance and slight off-topicness, but am I correct in
gathering from this thread that
> you can write SOAP services in JavaScript and deploy them under Apache
SOAP or AXIS?
>
> Scott Nichol wrote:
> > Your deployment descriptor works for me.  I have js.jar and bsf.jar
in
> > $CATALINA_HOME/webapps/soap/WEB-INF/lib, although I am not sure that
> > makes any difference.  Something to watch out for: you must restart
the
> > webapp (e.g. by restarting your servlet container) any time you
change
> > the JavaScript.  BSF and/or Rhino cache the script.  Undeploying,
> > changing the deployment descriptor, and re-deploying will *not*
change
> > the script.
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "Cyril Vidal" <cy...@planetexml.com>
> > To: <so...@xml.apache.org>
> > Sent: Monday, November 11, 2002 12:15 PM
> > Subject: soap + javascript
> >
> >
> > Hi,
> >
> > I would like to implement a SOAP service in Javascript.
> > 1°) First, I've added bsf.jar and js.jar on my classpath (I've put
these
> > two .jar in SDK_HOME/jre/lib/ext).
> > 2°) I've defined the following very simple deployment descriptor for
my
> > service, defining the method envoieMessage():
> > <isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
> >
> > id="urn:bonjourscript">
> >
> > <isd:provider type="script" scope="Application"
methods="envoieMessage">
> >
> > <isd:script language="javascript">
> >
> >
> > function envoieMessage(name)
> >
> > {
> >
> > var today = new java.util.Date();
> >
> > java.lang.System.out.println("Today is "
> >
> > + today.toString());
> >
> >
> > return "Hello " + name + ", How are
> >
> > you?";
> >
> > }
> >
> > </isd:script>
> >
> > </isd:provider>
> >
> > </isd:service>
> >
> > Unfortunately, when I run my Client application, I receive the
following
> > error message:
> >
> > Fault String: BSF Error: Javascript Error: function envoieMessage
not
> > found.
> >
> > Some of you could help me please?
> >
> > Thanks in advance,
> >
> > Cyril.
> >
> > _______________________________
> >
> > 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>
> >
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@xml.apache.org>
> For additional commands, e-mail:
<ma...@xml.apache.org>
>
>


Re: soap + javascript

Posted by Scott Nichol <sn...@scottnichol.com>.
I know that Apache SOAP supports this, but I do not know about Axis.

Scott Nichol

----- Original Message -----
From: "Robert Dietrick" <rd...@sega.com>
To: <so...@xml.apache.org>
Sent: Tuesday, November 12, 2002 1:08 PM
Subject: Re: soap + javascript


> Excuse my ignorance and slight off-topicness, but am I correct in
gathering from this thread that
> you can write SOAP services in JavaScript and deploy them under Apache
SOAP or AXIS?
>
> Scott Nichol wrote:
> > Your deployment descriptor works for me.  I have js.jar and bsf.jar
in
> > $CATALINA_HOME/webapps/soap/WEB-INF/lib, although I am not sure that
> > makes any difference.  Something to watch out for: you must restart
the
> > webapp (e.g. by restarting your servlet container) any time you
change
> > the JavaScript.  BSF and/or Rhino cache the script.  Undeploying,
> > changing the deployment descriptor, and re-deploying will *not*
change
> > the script.
> >
> > Scott Nichol
> >
> > ----- Original Message -----
> > From: "Cyril Vidal" <cy...@planetexml.com>
> > To: <so...@xml.apache.org>
> > Sent: Monday, November 11, 2002 12:15 PM
> > Subject: soap + javascript
> >
> >
> > Hi,
> >
> > I would like to implement a SOAP service in Javascript.
> > 1°) First, I've added bsf.jar and js.jar on my classpath (I've put
these
> > two .jar in SDK_HOME/jre/lib/ext).
> > 2°) I've defined the following very simple deployment descriptor for
my
> > service, defining the method envoieMessage():
> > <isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
> >
> > id="urn:bonjourscript">
> >
> > <isd:provider type="script" scope="Application"
methods="envoieMessage">
> >
> > <isd:script language="javascript">
> >
> >
> > function envoieMessage(name)
> >
> > {
> >
> > var today = new java.util.Date();
> >
> > java.lang.System.out.println("Today is "
> >
> > + today.toString());
> >
> >
> > return "Hello " + name + ", How are
> >
> > you?";
> >
> > }
> >
> > </isd:script>
> >
> > </isd:provider>
> >
> > </isd:service>
> >
> > Unfortunately, when I run my Client application, I receive the
following
> > error message:
> >
> > Fault String: BSF Error: Javascript Error: function envoieMessage
not
> > found.
> >
> > Some of you could help me please?
> >
> > Thanks in advance,
> >
> > Cyril.
> >
> > _______________________________
> >
> > 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>
> >
>
>
>
> --
> 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: soap + javascript

Posted by Robert Dietrick <rd...@sega.com>.
Excuse my ignorance and slight off-topicness, but am I correct in gathering from this thread that 
you can write SOAP services in JavaScript and deploy them under Apache SOAP or AXIS?

Scott Nichol wrote:
> Your deployment descriptor works for me.  I have js.jar and bsf.jar in
> $CATALINA_HOME/webapps/soap/WEB-INF/lib, although I am not sure that
> makes any difference.  Something to watch out for: you must restart the
> webapp (e.g. by restarting your servlet container) any time you change
> the JavaScript.  BSF and/or Rhino cache the script.  Undeploying,
> changing the deployment descriptor, and re-deploying will *not* change
> the script.
> 
> Scott Nichol
> 
> ----- Original Message -----
> From: "Cyril Vidal" <cy...@planetexml.com>
> To: <so...@xml.apache.org>
> Sent: Monday, November 11, 2002 12:15 PM
> Subject: soap + javascript
> 
> 
> Hi,
> 
> I would like to implement a SOAP service in Javascript.
> 1°) First, I've added bsf.jar and js.jar on my classpath (I've put these
> two .jar in SDK_HOME/jre/lib/ext).
> 2°) I've defined the following very simple deployment descriptor for my
> service, defining the method envoieMessage():
> <isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
> 
> id="urn:bonjourscript">
> 
> <isd:provider type="script" scope="Application" methods="envoieMessage">
> 
> <isd:script language="javascript">
> 
> 
> function envoieMessage(name)
> 
> {
> 
> var today = new java.util.Date();
> 
> java.lang.System.out.println("Today is "
> 
> + today.toString());
> 
> 
> return "Hello " + name + ", How are
> 
> you?";
> 
> }
> 
> </isd:script>
> 
> </isd:provider>
> 
> </isd:service>
> 
> Unfortunately, when I run my Client application, I receive the following
> error message:
> 
> Fault String: BSF Error: Javascript Error: function envoieMessage not
> found.
> 
> Some of you could help me please?
> 
> Thanks in advance,
> 
> Cyril.
> 
> _______________________________
> 
> 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 + javascript

Posted by Cyril Vidal <cy...@planetexml.com>.
Thanks for your response.
It's now running: it was a very strange error message because the root cause
was not a problem of class path but an
error in the javascript code:
java.lang.System.out.println("Today is "
 + today.toString());
For js.jar , the literal was not terminated....

Regards,
Cyril.

_______________________________

Cyril Vidal
Email: cyril@planetexml.com
Web: http://www.planetexml.com
----- Original Message -----
From: "Scott Nichol" <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Tuesday, November 12, 2002 5:05 PM
Subject: Re: soap + javascript


> Your deployment descriptor works for me.  I have js.jar and bsf.jar in
> $CATALINA_HOME/webapps/soap/WEB-INF/lib, although I am not sure that
> makes any difference.  Something to watch out for: you must restart the
> webapp (e.g. by restarting your servlet container) any time you change
> the JavaScript.  BSF and/or Rhino cache the script.  Undeploying,
> changing the deployment descriptor, and re-deploying will *not* change
> the script.
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Cyril Vidal" <cy...@planetexml.com>
> To: <so...@xml.apache.org>
> Sent: Monday, November 11, 2002 12:15 PM
> Subject: soap + javascript
>
>
> Hi,
>
> I would like to implement a SOAP service in Javascript.
> 1°) First, I've added bsf.jar and js.jar on my classpath (I've put these
> two .jar in SDK_HOME/jre/lib/ext).
> 2°) I've defined the following very simple deployment descriptor for my
> service, defining the method envoieMessage():
> <isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
>
> id="urn:bonjourscript">
>
> <isd:provider type="script" scope="Application" methods="envoieMessage">
>
> <isd:script language="javascript">
>
>
> function envoieMessage(name)
>
> {
>
> var today = new java.util.Date();
>
> java.lang.System.out.println("Today is "
>
> + today.toString());
>
>
> return "Hello " + name + ", How are
>
> you?";
>
> }
>
> </isd:script>
>
> </isd:provider>
>
> </isd:service>
>
> Unfortunately, when I run my Client application, I receive the following
> error message:
>
> Fault String: BSF Error: Javascript Error: function envoieMessage not
> found.
>
> Some of you could help me please?
>
> Thanks in advance,
>
> Cyril.
>
> _______________________________
>
> 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 + javascript

Posted by Robert Dietrick <rd...@sega.com>.
Excuse my ignorance and slight off-topicness, but am I correct in gathering from this thread that 
you can write SOAP services in JavaScript and deploy them under Apache SOAP or AXIS?

Scott Nichol wrote:
> Your deployment descriptor works for me.  I have js.jar and bsf.jar in
> $CATALINA_HOME/webapps/soap/WEB-INF/lib, although I am not sure that
> makes any difference.  Something to watch out for: you must restart the
> webapp (e.g. by restarting your servlet container) any time you change
> the JavaScript.  BSF and/or Rhino cache the script.  Undeploying,
> changing the deployment descriptor, and re-deploying will *not* change
> the script.
> 
> Scott Nichol
> 
> ----- Original Message -----
> From: "Cyril Vidal" <cy...@planetexml.com>
> To: <so...@xml.apache.org>
> Sent: Monday, November 11, 2002 12:15 PM
> Subject: soap + javascript
> 
> 
> Hi,
> 
> I would like to implement a SOAP service in Javascript.
> 1°) First, I've added bsf.jar and js.jar on my classpath (I've put these
> two .jar in SDK_HOME/jre/lib/ext).
> 2°) I've defined the following very simple deployment descriptor for my
> service, defining the method envoieMessage():
> <isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
> 
> id="urn:bonjourscript">
> 
> <isd:provider type="script" scope="Application" methods="envoieMessage">
> 
> <isd:script language="javascript">
> 
> 
> function envoieMessage(name)
> 
> {
> 
> var today = new java.util.Date();
> 
> java.lang.System.out.println("Today is "
> 
> + today.toString());
> 
> 
> return "Hello " + name + ", How are
> 
> you?";
> 
> }
> 
> </isd:script>
> 
> </isd:provider>
> 
> </isd:service>
> 
> Unfortunately, when I run my Client application, I receive the following
> error message:
> 
> Fault String: BSF Error: Javascript Error: function envoieMessage not
> found.
> 
> Some of you could help me please?
> 
> Thanks in advance,
> 
> Cyril.
> 
> _______________________________
> 
> 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>
> 



--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: soap + javascript

Posted by Scott Nichol <sn...@scottnichol.com>.
Your deployment descriptor works for me.  I have js.jar and bsf.jar in
$CATALINA_HOME/webapps/soap/WEB-INF/lib, although I am not sure that
makes any difference.  Something to watch out for: you must restart the
webapp (e.g. by restarting your servlet container) any time you change
the JavaScript.  BSF and/or Rhino cache the script.  Undeploying,
changing the deployment descriptor, and re-deploying will *not* change
the script.

Scott Nichol

----- Original Message -----
From: "Cyril Vidal" <cy...@planetexml.com>
To: <so...@xml.apache.org>
Sent: Monday, November 11, 2002 12:15 PM
Subject: soap + javascript


Hi,

I would like to implement a SOAP service in Javascript.
1°) First, I've added bsf.jar and js.jar on my classpath (I've put these
two .jar in SDK_HOME/jre/lib/ext).
2°) I've defined the following very simple deployment descriptor for my
service, defining the method envoieMessage():
<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"

id="urn:bonjourscript">

<isd:provider type="script" scope="Application" methods="envoieMessage">

<isd:script language="javascript">


function envoieMessage(name)

{

var today = new java.util.Date();

java.lang.System.out.println("Today is "

+ today.toString());


return "Hello " + name + ", How are

you?";

}

</isd:script>

</isd:provider>

</isd:service>

Unfortunately, when I run my Client application, I receive the following
error message:

Fault String: BSF Error: Javascript Error: function envoieMessage not
found.

Some of you could help me please?

Thanks in advance,

Cyril.

_______________________________

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 + javascript

Posted by Scott Nichol <sn...@scottnichol.com>.
Your deployment descriptor works for me.  I have js.jar and bsf.jar in
$CATALINA_HOME/webapps/soap/WEB-INF/lib, although I am not sure that
makes any difference.  Something to watch out for: you must restart the
webapp (e.g. by restarting your servlet container) any time you change
the JavaScript.  BSF and/or Rhino cache the script.  Undeploying,
changing the deployment descriptor, and re-deploying will *not* change
the script.

Scott Nichol

----- Original Message -----
From: "Cyril Vidal" <cy...@planetexml.com>
To: <so...@xml.apache.org>
Sent: Monday, November 11, 2002 12:15 PM
Subject: soap + javascript


Hi,

I would like to implement a SOAP service in Javascript.
1°) First, I've added bsf.jar and js.jar on my classpath (I've put these
two .jar in SDK_HOME/jre/lib/ext).
2°) I've defined the following very simple deployment descriptor for my
service, defining the method envoieMessage():
<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"

id="urn:bonjourscript">

<isd:provider type="script" scope="Application" methods="envoieMessage">

<isd:script language="javascript">


function envoieMessage(name)

{

var today = new java.util.Date();

java.lang.System.out.println("Today is "

+ today.toString());


return "Hello " + name + ", How are

you?";

}

</isd:script>

</isd:provider>

</isd:service>

Unfortunately, when I run my Client application, I receive the following
error message:

Fault String: BSF Error: Javascript Error: function envoieMessage not
found.

Some of you could help me please?

Thanks in advance,

Cyril.

_______________________________

Cyril Vidal
Email: cyril@planetexml.com
Web: http://www.planetexml.com