Fw: How to creating concurrent call in batch file

2005-07-08 Thread feilong
Hallo,
I want to write a batch file under windows to call 6 instances concurrently to 
test whether the program is thread-safe. Below is the shell script for linux to 
create parallel call, it works. But if I use the same syntax, i.e.  to 
connect java call in batch file under windows, it only creates serial call, 
not concurrent call. 
How can I write a windows script or a batch file under windows to build 
parallel call.

Best Regards
saarxfk


parallelCall.sh

# set the classpath
export CLASSPATH=
for i in jars/*jar; do export CLASSPATH=$CLASSPATH:$i; done

java WinsServiceClient morganti.pdf morganti.pdf it 
java WinsServiceClient alesi.pdf alesi.pdf it 
java WinsServiceClient morganti2.pdf morganti2.pdf it 
java WinsServiceClient alesi2.pdf alesi2.pdf it 
java WinsServiceClient morganti3.pdf morganti3.pdf it 
java WinsServiceClient alesi3.pdf alesi3.pdf it


Best Regards
Feilong

Re: Soap under Tomcat

2004-11-15 Thread feilong
Hallo, aka_sergio
Thanks for your reply. My problem looks like the following now:
D:\Programs\jakarta-tomcat-4.1.30\webapps\soap\WEB-INF\classesjava
onjava.CalcC
lient 98 96
I am called!
The call failed:
Fault Code   = SOAP-ENV:Server.Exception:
Fault String = onjava/CalcService (wrong name: CalcService)

I follow each step from this tutorial. I put my CalcService.java and
CalcClient.java in
tomcat_Home\webapps\soap\WEB-INF\classes\onjava
The all code are compiled(surely). I think that I needn't edit anything in
web.xml and server.xml,
because we have DeploymentDescriptor.xml, which defined the path, the urn
for the servlet.
Tomcat is smart enough to find CalcService.java. I consider that the request
from client is not transfered to the server,
That means that Tomcat hasn't found CalcService.java while client runs. I
don't why, I can deploy and undeploy this webservice,
all the code are copied from this tutorial, I don't know why?


Best
Feilong
- Original Message - 
From: sven morales [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, November 15, 2004 2:39 PM
Subject: RE: Soap under Tomcat


 Exception in thread main [SOAPException:
 faultCode=SOAP-ENV:Protocol; msg=Unsupported response
 content type quot;text/html;
 charset=ISO-8859-1quot;, must be :
 quot;text/xmlquot;. Response was:
 lt;htmlgt;lt;headgt;lt;titlegt;Apache
 Tomcat/4.1.30 - Error reportlt;/tit

 Your error seems to point to the type  text/html.
 Apache SOAP uses POST and type text/xml.  I don't know
 how your program spits out text/html.  I tried same
 tutorial and it works for me.
   Also there is a tool called tcpmon thats very
 helpful in seeing whats being sent (HTTP) towards
 Tomcat and Tomcats HTTP response.

 aka_sergio

 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around
 http://mail.yahoo.com

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Soap under Tomcat

2004-11-15 Thread feilong
Hallo,
I add the context tag in server.xml, i.e.
Context
   path=/soap
   docBase=D:\Programs\jakarta-tomcat-4.1.30\webapps\soap\
   reloadable=true
 /Context
Then this exception is away.

Thanks 
Feilong

- Original Message - 
From: sven morales [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Monday, November 15, 2004 3:20 PM
Subject: Re: Soap under Tomcat


   What did you do to get rid of that text/html
 problem?
 You can list the deployed services via this command:
 
 java org.apache.soap.server.ServiceManagerClient
 http://localhost:8080/soap/servlet/rpcrouter list
 
 or clicking on list button on
 http://localhost:8080/soap/admin/
 
 I the urn:onjava is not listed, then that service is
 not deployed.
 
 I have not have to modify web.xml mappings as the
 rpcrouter is the Servlet responding to deployment and
 listing of services. messagerouter is the other
 Servlet that handles messaging within SOAP.  TCPMON I
 suggested is a very helpful tool, to let you view what
 is being posted to Tomcat.
 
 
 --- feilong [EMAIL PROTECTED] wrote:
 
  Hallo, aka_sergio
  Thanks for your reply. My problem looks like the
  following now:
 
 D:\Programs\jakarta-tomcat-4.1.30\webapps\soap\WEB-INF\classesjava
  onjava.CalcC
  lient 98 96
  I am called!
  The call failed:
  Fault Code   = SOAP-ENV:Server.Exception:
  Fault String = onjava/CalcService (wrong name:
  CalcService)
  
  I follow each step from this tutorial. I put my
  CalcService.java and
  CalcClient.java in
  tomcat_Home\webapps\soap\WEB-INF\classes\onjava
  The all code are compiled(surely). I think that I
  needn't edit anything in
  web.xml and server.xml,
  because we have DeploymentDescriptor.xml, which
  defined the path, the urn
  for the servlet.
  Tomcat is smart enough to find CalcService.java. I
  consider that the request
  from client is not transfered to the server,
  That means that Tomcat hasn't found CalcService.java
  while client runs. I
  don't why, I can deploy and undeploy this
  webservice,
  all the code are copied from this tutorial, I don't
  know why?
  
  
  Best
  Feilong
  - Original Message - 
  From: sven morales [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Monday, November 15, 2004 2:39 PM
  Subject: RE: Soap under Tomcat
  
  
   Exception in thread main [SOAPException:
   faultCode=SOAP-ENV:Protocol; msg=Unsupported
  response
   content type quot;text/html;
   charset=ISO-8859-1quot;, must be :
   quot;text/xmlquot;. Response was:
   lt;htmlgt;lt;headgt;lt;titlegt;Apache
   Tomcat/4.1.30 - Error reportlt;/tit
  
   Your error seems to point to the type  text/html.
   Apache SOAP uses POST and type text/xml.  I don't
  know
   how your program spits out text/html.  I tried
  same
   tutorial and it works for me.
 Also there is a tool called tcpmon thats very
   helpful in seeing whats being sent (HTTP) towards
   Tomcat and Tomcats HTTP response.
  
   aka_sergio
  
   __
   Do You Yahoo!?
   Tired of spam?  Yahoo! Mail has the best spam
  protection around
   http://mail.yahoo.com
  
  
 
 -
   To unsubscribe, e-mail:
  [EMAIL PROTECTED]
   For additional commands, e-mail:
  [EMAIL PROTECTED]
  
  
  
  
 
 -
  To unsubscribe, e-mail:
  [EMAIL PROTECTED]
  For additional commands, e-mail:
  [EMAIL PROTECTED]
  
  
 
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around 
 http://mail.yahoo.com 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Soap under Tomcat

2004-11-14 Thread feilong
Hallo Mark,
Thanks for your reply. I must now see my web.xml file.
I don't know excatly how to edit the web.xml such
Deployment Descriptor file and server.xml such configuration file.

Best
Feilong

- Original Message - 
From: Mark Thomas [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Sent: Sunday, November 14, 2004 12:44 PM
Subject: RE: Soap under Tomcat


 I am not familiar with this particular tutorial but the problem appears to
be
 that your client is requesting /soap/rpcrouter but the servlet mapping in
 web.xml indicates that the webapp is expcting /soap/servlet/rpcrouter.
What the
 root cuase of this mismatch might be I do not know.

 Mark

  -Original Message-
  From: feilong [mailto:[EMAIL PROTECTED]
  Sent: Saturday, November 13, 2004 11:45 PM
  To: [EMAIL PROTECTED]
  Subject: Soap under Tomcat
 
  Hallo all,
  I am a beginner with programming web-service with soap
  protocol under Tomcat web server.
  I find a link
  http://www.onjava.com/pub/a/onjava/2002/02/27/tomcat.html?page=1
  which introduce how to use soap in Tomcat and deploy web
  services and a simple client to call this web service
  I have followed each step what is showed in this article. All
  run succesfully. only the last step
  java onjava.CalcClient 96 95. I get the following exceptions,
  but unfortunately I can not understand such exceptions, I
  hope someone can indicate the reason for me
  ---
  Exception in thread main [SOAPException:
  faultCode=SOAP-ENV:Protocol; msg=Unsu
  pported response content type quot;text/html;
  charset=ISO-8859-1quot;, must be
  : quot;text/xmlquot;. Response was:
  lt;htmlgt;lt;headgt;lt;titlegt;Apache Tomcat/4.1.30 -
  Error reportlt;/tit
  legt;lt;STYLEgt;lt;!--H1{font-family :
  sans-serif,Arial,Tahoma;color : white
  ;background-color : #0086b2;} H3{font-family :
  sans-serif,Arial,Tahoma;color : w
  hite;background-color : #0086b2;} BODY{font-family :
  sans-serif,Arial,Tahoma;col
  or : black;background-color : white;} B{color :
  white;background-color : #0086b2
  ;} HR{color : #0086b2;} --gt;lt;/STYLEgt;
  lt;/headgt;lt;bodygt;lt;h1gt;
  HTTP Status 404 - /soap/rpcrouterlt;/h1gt;lt;HR
  size=quot;1quot; noshadegt
  ;lt;pgt;lt;bgt;typelt;/bgt; Status
  reportlt;/pgt;lt;pgt;lt;bgt;messa
  gelt;/bgt;
  lt;ugt;/soap/rpcrouterlt;/ugt;lt;/pgt;lt;pgt;lt;bgt;descr
  iptionlt;/bgt; lt;ugt;The requested resource
  (/soap/rpcrouter) is not availa
  ble.lt;/ugt;lt;/pgt;lt;HR size=quot;1quot;
  noshadegt;lt;h3gt;Apache To
  mcat/4.1.30lt;/h3gt;lt;/bodygt;lt;/htmlgt;
  ]
  at org.apache.soap.rpc.Call.getEnvelopeString(Call.java:208)
  at org.apache.soap.rpc.Call.invoke(Call.java:255)
  at onjava.CalcClient.main(CalcClient.java:35)
  --
  I put my java servlet classes and source code in
  D:\Programs\jakarta-tomcat-4.1.30\webapps\soap\WEB-INF\classes\onjava
  I can deploy the CalcService servlet in Tomcat Server.
  But when I run the CalcClient, get the error messages above.
  I guess since I didn't add anything in
  \jakarta-tomcat-4.1.30\webapps\soap\WEB-INF\web.xml
  descriptor file. This web.xml is automatic generated by
  soap.war while I run the Tomcat Server first time. I don't
  know how can I edit the
  original web.xml(Deployment Descriptor)if I add new servlet
  class with package onjava in
  webapps\soap\WEB-INF\classes\onjava\.
  Another DeploymentDescriptor.xml identifying soap-service
  under webapps\soap\WEB-INF\classes\onjava\ runs correctly
  since I can deploy this webservice.
  The soap\WEB-INF\web.xml looks like following
  
  ?xml version=1.0 encoding=ISO-8859-1?
 
  !DOCTYPE web-app
  PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
  http://java.sun.com/j2ee/dtds/web-app_2_2.dtd;
 
  web-app
display-nameApache-SOAP/display-name
descriptionno description/description
servlet
  servlet-namerpcrouter/servlet-name
  display-nameApache-SOAP RPC Router/display-name
  descriptionno description/description
 
  servlet-classorg.apache.soap.server.http.RPCRouterServlet/s
 ervlet-class
  init-param
param-namefaultListener/param-name
 
  param-valueorg.apache.soap.server.DOMFaultListener/param-value
  /init-param
/servlet
 
servlet
  servlet-namemessagerouter/servlet-name
  display-nameApache-SOAP Message Router/display-name
 
  servlet-classorg.apache.soap.server.http.MessageRouterServle
 t/servlet-class
  init-param
param-namefaultListener/param-name
 
  param-valueorg.apache.soap.server.DOMFaultListener/param-value
  /init-param
/servlet
 
servlet-mapping
  servlet-namerpcrouter/servlet-name
  url-pattern/servlet/rpcrouter/url-pattern
/servlet-mapping
 
servlet-mapping
  servlet-namemessagerouter/servlet-name
  url-pattern/servlet

Re: Soap under Tomcat

2004-11-14 Thread feilong
Hallo Mark,
My client is requesting  http://localhost:8080/soap/servlet/rpcrouter, and
the servletmapping is exactly same
servlet-mapping
  servlet-namerpcrouter/servlet-name
  url-pattern/servlet/rpcrouter/url-pattern
/servlet-mapping
in soap/WEB-INF/web.xml.
Why do you say that the requesting doesn't match the description in web.xml?
The problem is still there.

Best
Feilong

The source code for CalcClient.java is following:

---
package onjava;

import java.io.*;
import java.net.*;
import java.util.*;
import org.apache.soap.*;
import org.apache.soap.rpc.*;

public class CalcClient {

  public static void main(String[] args) throws Exception {

URL url = new URL (http://localhost:8080/soap/servlet/rpcrouter;);

Integer p1 = new Integer(args[0]);
Integer p2 = new Integer(args[1]);

// Build the call.
Call call = new Call();
call.setTargetObjectURI(urn:onjavaserver);
call.setMethodName(subtract);
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
Vector params = new Vector();
params.addElement(new Parameter(p1, Integer.class, p1, null));
params.addElement(new Parameter(p2, Integer.class, p2, null));
call.setParams (params);

// make the call: note that the action URI is empty because the
// XML-SOAP rpc router does not need this. This may change in the
// future.
Response resp = call.invoke(url,  );

// Check the response.
if ( resp.generatedFault() ) {

  Fault fault = resp.getFault ();
  System.out.println(The call failed: );
  System.out.println(Fault Code   =  + fault.getFaultCode());
  System.out.println(Fault String =  + fault.getFaultString());
}
else {

  Parameter result = resp.getReturnValue();
  System.out.println(result.getValue());
}
  }
}

-




- Original Message - 
From: Mark Thomas [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Sent: Sunday, November 14, 2004 12:44 PM
Subject: RE: Soap under Tomcat


 I am not familiar with this particular tutorial but the problem appears to
be
 that your client is requesting /soap/rpcrouter but the servlet mapping in
 web.xml indicates that the webapp is expcting /soap/servlet/rpcrouter.
What the
 root cuase of this mismatch might be I do not know.

 Mark

  -Original Message-
  From: feilong [mailto:[EMAIL PROTECTED]
  Sent: Saturday, November 13, 2004 11:45 PM
  To: [EMAIL PROTECTED]
  Subject: Soap under Tomcat
 
  Hallo all,
  I am a beginner with programming web-service with soap
  protocol under Tomcat web server.
  I find a link
  http://www.onjava.com/pub/a/onjava/2002/02/27/tomcat.html?page=1
  which introduce how to use soap in Tomcat and deploy web
  services and a simple client to call this web service
  I have followed each step what is showed in this article. All
  run succesfully. only the last step
  java onjava.CalcClient 96 95. I get the following exceptions,
  but unfortunately I can not understand such exceptions, I
  hope someone can indicate the reason for me
  ---
  Exception in thread main [SOAPException:
  faultCode=SOAP-ENV:Protocol; msg=Unsu
  pported response content type quot;text/html;
  charset=ISO-8859-1quot;, must be
  : quot;text/xmlquot;. Response was:
  lt;htmlgt;lt;headgt;lt;titlegt;Apache Tomcat/4.1.30 -
  Error reportlt;/tit
  legt;lt;STYLEgt;lt;!--H1{font-family :
  sans-serif,Arial,Tahoma;color : white
  ;background-color : #0086b2;} H3{font-family :
  sans-serif,Arial,Tahoma;color : w
  hite;background-color : #0086b2;} BODY{font-family :
  sans-serif,Arial,Tahoma;col
  or : black;background-color : white;} B{color :
  white;background-color : #0086b2
  ;} HR{color : #0086b2;} --gt;lt;/STYLEgt;
  lt;/headgt;lt;bodygt;lt;h1gt;
  HTTP Status 404 - /soap/rpcrouterlt;/h1gt;lt;HR
  size=quot;1quot; noshadegt
  ;lt;pgt;lt;bgt;typelt;/bgt; Status
  reportlt;/pgt;lt;pgt;lt;bgt;messa
  gelt;/bgt;
  lt;ugt;/soap/rpcrouterlt;/ugt;lt;/pgt;lt;pgt;lt;bgt;descr
  iptionlt;/bgt; lt;ugt;The requested resource
  (/soap/rpcrouter) is not availa
  ble.lt;/ugt;lt;/pgt;lt;HR size=quot;1quot;
  noshadegt;lt;h3gt;Apache To
  mcat/4.1.30lt;/h3gt;lt;/bodygt;lt;/htmlgt;
  ]
  at org.apache.soap.rpc.Call.getEnvelopeString(Call.java:208)
  at org.apache.soap.rpc.Call.invoke(Call.java:255)
  at onjava.CalcClient.main(CalcClient.java:35)
  --
  I put my java servlet classes and source code in
  D:\Programs\jakarta-tomcat-4.1.30\webapps\soap\WEB-INF\classes\onjava
  I can deploy the CalcService servlet in Tomcat Server.
  But when I run the CalcClient, get the error messages above.
  I guess since I didn't add anything in
  \jakarta-tomcat-4.1.30\webapps\soap\WEB-INF\web.xml
  descriptor file. This web.xml is automatic

Exception in Tomcat under Soap

2004-11-14 Thread feilong
Hallo all,
I am a beginner with programming web-service with soap protocol under Tomcat 
web server. 
I find a link http://www.onjava.com/pub/a/onjava/2002/02/27/tomcat.html?page=1
which introduce how to use soap in Tomcat and deploy web services and a simple 
client to call this web service
I have followed each step what is showed in this article. All run succesfully. 
only the last step
java onjava.CalcClient 96 95. I get the following exceptions, but unfortunately 
I can not understand such exceptions, I hope someone can indicate the reason 
for me  
---
D:\Programs\jakarta-tomcat-4.1.30\webapps\soap\WEB-INF\classesjava 
onjava.CalcClient 98 92
The call failed:
Fault Code   = SOAP-ENV:Server.Exception:
Fault String = onjava/CalcService (wrong name: CalcService)
--
I put my java servlet classes and source code in
D:\Programs\jakarta-tomcat-4.1.30\webapps\soap\WEB-INF\classes\onjava
I can deploy the CalcService servlet in Tomcat Server.
But when I run the CalcClient, get the error messages above.
I didn't edit \jakarta-tomcat-4.1.30\webapps\soap\WEB-INF\web.xml descriptor 
file. This web.xml is automatic generated by soap.war while I run the Tomcat 
Server first time. I don't know how can I edit the
soap\WEB-INF\web.xml in this case, i.e new servlet under package 
soap\WEB-INF\classes\onjava 

Another DeploymentDescriptor.xml identifying soap-service 
under webapps\soap\WEB-INF\classes\onjava\ runs correctly since I can deploy 
this webservice. 
The soap\WEB-INF\web.xml looks like following

?xml version=1.0 encoding=ISO-8859-1?

!DOCTYPE web-app
PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
http://java.sun.com/j2ee/dtds/web-app_2_2.dtd;

web-app
  display-nameApache-SOAP/display-name
  descriptionno description/description
  servlet
servlet-namerpcrouter/servlet-name
display-nameApache-SOAP RPC Router/display-name
descriptionno description/description
   
servlet-classorg.apache.soap.server.http.RPCRouterServlet/servlet-class 
   
 
init-param
  param-namefaultListener/param-name
  param-valueorg.apache.soap.server.DOMFaultListener/param-value
/init-param
  /servlet

  servlet
servlet-namemessagerouter/servlet-name
display-nameApache-SOAP Message Router/display-name

servlet-classorg.apache.soap.server.http.MessageRouterServlet/servlet-class
init-param
  param-namefaultListener/param-name
  param-valueorg.apache.soap.server.DOMFaultListener/param-value
/init-param
  /servlet

  servlet-mapping
servlet-namerpcrouter/servlet-name
url-pattern/servlet/rpcrouter/url-pattern
  /servlet-mapping

  servlet-mapping
servlet-namemessagerouter/servlet-name
url-pattern/servlet/messagerouter/url-pattern
  /servlet-mapping
/web-app
--
I added new context in tomcat/conf/server.xml
 Context path=/soap docBase=soap debug=0 reloadable=true /


Thanks in advance
Feilong


Re: Soap under Tomcat

2004-11-14 Thread feilong
Hallo,
What do you mean that the /soap/rpcrouter is not available?
in web.xml

-
servlet
servlet-namerpcrouter/servlet-name
display-nameApache-SOAP RPC Router/display-name
descriptionno description/description

servlet-classorg.apache.soap.server.http.RPCRouterServlet/servlet-class
init-param
  param-namefaultListener/param-name
  param-valueorg.apache.soap.server.DOMFaultListener/param-value
/init-param
  /servlet

--
The servlet class is in this package org..RPCRouterServlet.
I tried replace servlet-class with onjava.CalcService but it doesn't work.

The current error message is


D:\Programs\jakarta-tomcat-4.1.30\webapps\soap\WEB-INF\classesjava
onjava.CalcC
lient 98 92
I am called!
The call failed:
Fault Code   = SOAP-ENV:Server.Exception:
Fault String = onjava/CalcService (wrong name: CalcService)

-

Thanks again

Best
Feilong




- Original Message - 
From: Mark Thomas [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Sent: Sunday, November 14, 2004 10:00 PM
Subject: RE: Soap under Tomcat


 To quote from the error message from your original post:

 The requested resource (/soap/rpcrouter) is not available.

 Mark

  -Original Message-
  From: feilong [mailto:[EMAIL PROTECTED]
  Sent: Sunday, November 14, 2004 8:18 PM
  To: Tomcat Users List
  Subject: Re: Soap under Tomcat
 
  Hallo Mark,
  My client is requesting
  http://localhost:8080/soap/servlet/rpcrouter, and
  the servletmapping is exactly same
  servlet-mapping
servlet-namerpcrouter/servlet-name
url-pattern/servlet/rpcrouter/url-pattern
  /servlet-mapping
  in soap/WEB-INF/web.xml.
  Why do you say that the requesting doesn't match the
  description in web.xml?
  The problem is still there.
 
  Best
  Feilong
 
  The source code for CalcClient.java is following:
  --
  --
  ---
  package onjava;
 
  import java.io.*;
  import java.net.*;
  import java.util.*;
  import org.apache.soap.*;
  import org.apache.soap.rpc.*;
 
  public class CalcClient {
 
public static void main(String[] args) throws Exception {
 
  URL url = new URL
  (http://localhost:8080/soap/servlet/rpcrouter;);
 
  Integer p1 = new Integer(args[0]);
  Integer p2 = new Integer(args[1]);
 
  // Build the call.
  Call call = new Call();
  call.setTargetObjectURI(urn:onjavaserver);
  call.setMethodName(subtract);
  call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
  Vector params = new Vector();
  params.addElement(new Parameter(p1, Integer.class, p1, null));
  params.addElement(new Parameter(p2, Integer.class, p2, null));
  call.setParams (params);
 
  // make the call: note that the action URI is empty because the
  // XML-SOAP rpc router does not need this. This may change in the
  // future.
  Response resp = call.invoke(url,  );
 
  // Check the response.
  if ( resp.generatedFault() ) {
 
Fault fault = resp.getFault ();
System.out.println(The call failed: );
System.out.println(Fault Code   =  + fault.getFaultCode());
System.out.println(Fault String =  + fault.getFaultString());
  }
  else {
 
Parameter result = resp.getReturnValue();
System.out.println(result.getValue());
  }
}
  }
 
  -
 
 
 
 
  - Original Message - 
  From: Mark Thomas [EMAIL PROTECTED]
  To: 'Tomcat Users List' [EMAIL PROTECTED]
  Sent: Sunday, November 14, 2004 12:44 PM
  Subject: RE: Soap under Tomcat
 
 
   I am not familiar with this particular tutorial but the
  problem appears to
  be
   that your client is requesting /soap/rpcrouter but the
  servlet mapping in
   web.xml indicates that the webapp is expcting
  /soap/servlet/rpcrouter.
  What the
   root cuase of this mismatch might be I do not know.
  
   Mark
  
-Original Message-
From: feilong [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 13, 2004 11:45 PM
To: [EMAIL PROTECTED]
Subject: Soap under Tomcat
   
Hallo all,
I am a beginner with programming web-service with soap
protocol under Tomcat web server.
I find a link
http://www.onjava.com/pub/a/onjava/2002/02/27/tomcat.html?page=1
which introduce how to use soap in Tomcat and deploy web
services and a simple client to call this web service
I have followed each step what is showed in this article. All
run succesfully. only the last step
java onjava.CalcClient 96 95. I get the following exceptions,
but unfortunately I

Soap under Tomcat

2004-11-13 Thread feilong
Hallo all,
I am a beginner with programming web-service with soap protocol under Tomcat 
web server. 
I find a link http://www.onjava.com/pub/a/onjava/2002/02/27/tomcat.html?page=1
which introduce how to use soap in Tomcat and deploy web services and a simple 
client to call this web service
I have followed each step what is showed in this article. All run succesfully. 
only the last step
java onjava.CalcClient 96 95. I get the following exceptions, but unfortunately 
I can not understand such exceptions, I hope someone can indicate the reason 
for me  
---
Exception in thread main [SOAPException: faultCode=SOAP-ENV:Protocol; msg=Unsu
pported response content type quot;text/html; charset=ISO-8859-1quot;, must be
: quot;text/xmlquot;. Response was:
lt;htmlgt;lt;headgt;lt;titlegt;Apache Tomcat/4.1.30 - Error reportlt;/tit
legt;lt;STYLEgt;lt;!--H1{font-family : sans-serif,Arial,Tahoma;color : white
;background-color : #0086b2;} H3{font-family : sans-serif,Arial,Tahoma;color : w
hite;background-color : #0086b2;} BODY{font-family : sans-serif,Arial,Tahoma;col
or : black;background-color : white;} B{color : white;background-color : #0086b2
;} HR{color : #0086b2;} --gt;lt;/STYLEgt; lt;/headgt;lt;bodygt;lt;h1gt;
HTTP Status 404 - /soap/rpcrouterlt;/h1gt;lt;HR size=quot;1quot; noshadegt
;lt;pgt;lt;bgt;typelt;/bgt; Status reportlt;/pgt;lt;pgt;lt;bgt;messa
gelt;/bgt; lt;ugt;/soap/rpcrouterlt;/ugt;lt;/pgt;lt;pgt;lt;bgt;descr
iptionlt;/bgt; lt;ugt;The requested resource (/soap/rpcrouter) is not availa
ble.lt;/ugt;lt;/pgt;lt;HR size=quot;1quot; noshadegt;lt;h3gt;Apache To
mcat/4.1.30lt;/h3gt;lt;/bodygt;lt;/htmlgt;
]
at org.apache.soap.rpc.Call.getEnvelopeString(Call.java:208)
at org.apache.soap.rpc.Call.invoke(Call.java:255)
at onjava.CalcClient.main(CalcClient.java:35)
--
I put my java servlet classes and source code in
D:\Programs\jakarta-tomcat-4.1.30\webapps\soap\WEB-INF\classes\onjava
I can deploy the CalcService servlet in Tomcat Server.
But when I run the CalcClient, get the error messages above.
I guess since I didn't add anything in 
\jakarta-tomcat-4.1.30\webapps\soap\WEB-INF\web.xml descriptor file. This 
web.xml is automatic generated by soap.war while I run the Tomcat Server first 
time. I don't know how can I edit the
original web.xml(Deployment Descriptor)if I add new servlet class with package 
onjava in 
webapps\soap\WEB-INF\classes\onjava\.
Another DeploymentDescriptor.xml identifying soap-service 
under webapps\soap\WEB-INF\classes\onjava\ runs correctly since I can deploy 
this webservice. 
The soap\WEB-INF\web.xml looks like following

?xml version=1.0 encoding=ISO-8859-1?

!DOCTYPE web-app
PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
http://java.sun.com/j2ee/dtds/web-app_2_2.dtd;

web-app
  display-nameApache-SOAP/display-name
  descriptionno description/description
  servlet
servlet-namerpcrouter/servlet-name
display-nameApache-SOAP RPC Router/display-name
descriptionno description/description
servlet-classorg.apache.soap.server.http.RPCRouterServlet/servlet-class
init-param
  param-namefaultListener/param-name
  param-valueorg.apache.soap.server.DOMFaultListener/param-value
/init-param
  /servlet

  servlet
servlet-namemessagerouter/servlet-name
display-nameApache-SOAP Message Router/display-name

servlet-classorg.apache.soap.server.http.MessageRouterServlet/servlet-class
init-param
  param-namefaultListener/param-name
  param-valueorg.apache.soap.server.DOMFaultListener/param-value
/init-param
  /servlet

  servlet-mapping
servlet-namerpcrouter/servlet-name
url-pattern/servlet/rpcrouter/url-pattern
  /servlet-mapping

  servlet-mapping
servlet-namemessagerouter/servlet-name
url-pattern/servlet/messagerouter/url-pattern
  /servlet-mapping
/web-app

Another reason I guess is that I didn't edit anything in 
D:\Programs\jakarta-tomcat-4.1.30\conf\server.xml while new webapplicatin soap 
comes. I can't edit such configuration files. How can I learn to write and edit 
such Deployment Descriptor file and server configuration files. 
The server.xml looks like:
---
!-- Example Server Configuration File --
!-- Note that component elements are nested corresponding to their
 parent-child relationships with each other --

!-- A Server is a singleton element that represents the entire JVM,
 which may contain one or more Service instances.  The Server
 listens for a shutdown command on the indicated port.

 Note:  A Server is not itself a Container, so you may not
 define subcomponents such as Valves or Loggers at this level.
 --

Server port=8005 shutdown=SHUTDOWN debug=0


  !--