The source of GetCountApp.java is:
package javasoap.book.ch4;
import java.net.*;
import org.apache.soap.*;
import org.apache.soap.rpc.*;
public class GetCountApp {
public static void main(String[] args)
throws Exception {
URL url =
new URL(
"http://localhost:8080/soap/servlet/rpcrouter");
Call call = new Call();
call.setTargetObjectURI("urn:CallCounterService");
call.setMethodName("getCount");
try {
Response resp = call.invoke(url, "");
Parameter ret = resp.getReturnValue();
Object value = ret.getValue(); *\this is line 19
System.out.println("Result is " + value);
}
catch (SOAPException e) {
System.err.println("Caught SOAPException (" +
e.getFaultCode() + "): " +
e.getMessage());
}
}
}
The source of MethodCounter is:
package javasoap.book.ch4;
public class MethodCounter {
int _counter;
public MethodCounter() {
_counter = 0;
}
public int getCount() {
return _counter;
}
public boolean doSomething() {
_counter += 1;
return true;
}
}
----- Original Message -----
From: "Scott Nichol" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 11, 2004 5:34 PM
Subject: Re: problem with ServiceManagerClient and another problem
What is line 19 of GetCountApp.java?
What is the source for MethodCounter?
Scott Nichol
Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message -----
From: "Francesco Dipalo" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 11, 2004 11:13 AM
Subject: Re: problem with ServiceManagerClient and another problem
> I have done as you tell and now when I try:
> java javasoap.book.ch4.GetCountApp
> I receive this exception:
> Exception in thread "main" java.lang.NullPointerException at
> javasoap.book.ch4.GetCountApp.main(GetCountApp.java:19)
> Why?
> Thanks for the helps!!!!!
> ----- Original Message -----
> From: "Scott Nichol" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, June 11, 2004 3:17 PM
> Subject: Re: problem with ServiceManagerClient and another problem
>
>
> This rather generic exception is masking an underlying exception.
Undeploy,
> change CallCounterService.dd
> , re-deploy and try again to see a better exception. The change to
> CallCounterService.dd is to remove whitespace from faultListener, i.e.
> change
>
> <isd:faultListener>
> org.apache.soap.server.DOMFaultListener
> </isd:faultListener>
>
> to
>
>
>
<isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListene
> r>
>
> Scott Nichol
>
> Do not send e-mail directly to this e-mail address,
> because it is filtered to accept only mail from
> specific mail lists.
> ----- Original Message -----
> From: "Francesco Dipalo" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, June 11, 2004 3:57 AM
> Subject: Re: problem with ServiceManagerClient and another problem
>
>
> > Thank for the solution Scott but now I have another problem:
> >
> > I want to deploy a service. I executed the following operations:
> >
> > - deploying with Apache SOAP using a deployment descriptor file named
> > CallCounterService.dd
> >
> > <isd:service
> > xmlns:isd="http://xml.apache.org/xml-soap/deployment"
> > id="urn:CallCounterService">
> >
> > <isd:provider type="java"
> > scope="Application"
> > methods="doSomething getCount">
> > <isd:java class="javasoap.book.ch4.MethodCounter"
> > static="false"/>
> > </isd:provider>
> > <isd:faultListener>
> > org.apache.soap.server.DOMFaultListener
> > </isd:faultListener>
> > <isd:mappings>
> > </isd:mappings>
> > </isd:service>
> >
> > - invoking the getCount method using this java file named CallCounterApp
> >
> > package javasoap.book.ch4;
> > import java.net.*;
> > import org.apache.soap.*;
> > import org.apache.soap.rpc.*;
> > public class GetCountApp {
> > public static void main(String[] args)
> > throws Exception {
> >
> > URL url =
> > new URL(
> > "http://localhost:8080/soap/servlet/rpcrouter");
> >
> > Call call = new Call();
> > call.setTargetObjectURI("urn:CallCounterService");
> > call.setMethodName("getCount");
> > try {
> > Response resp = call.invoke(url, "");
> > Parameter ret = resp.getReturnValue();
> > Object value = ret.getValue();
> > System.out.println("Result is " + value);
> > }
> > catch (SOAPException e) {
> > System.err.println("Caught SOAPException (" +
> > e.getFaultCode() + "): " +
> > e.getMessage());
> > }
> > }
> > }
> >
> > but I received this exception:
> >
> > Caught SOAPException (SOAP-ENV:Protocol): Unsupported response content
> type
> > &quo
> > t;text/html; charset=ISO-8859-1", must be: "text/xml".
> > Response w
> > as:
> > <html><head><title>Apache Tomcat/4.1.30 - Error
> > report</tit
> > le><STYLE><!--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;} --></STYLE>
> > </head><body><h1>
> > HTTP Status 500 - </h1><HR size="1"
> > noshade><p><b
> > >type</b> Exception
> > report</p><p><b>message</b>
> > <u></u></p><p><b>description</b>
> > <u>T
> > he server encountered an internal error () that prevented it from
> fulfilling
> > thi
> > s request.</u></p><p><b>exception</b>
> > <pre>j
> > avax.servlet.ServletException: Error building response envelope:
> > java.lang.NullP
> > ointerException
> > at
> > org.apache.soap.server.http.RPCRouterServlet.doPost(RPCRouterServlet.
> > java:418)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > at
> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
> > icationFilterChain.java:247)
> > at
> > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
> > ilterChain.java:193)
> > at
> > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
> > alve.java:256)
> > at
> > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
> > t.invokeNext(StandardPipeline.java:643)
> > at
> > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
> > a:480)
> > at
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> >
> > at
> > org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
> > alve.java:191)
> > at
> > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
> > t.invokeNext(StandardPipeline.java:643)
> > at
> > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
> > a:480)
> > at
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> >
> > at
> > org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
> > 2422)
> > at
> > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
> > ava:180)
> > at
> > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
> > t.invokeNext(StandardPipeline.java:643)
> > at
> > org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche
> > rValve.java:171)
> > at
> > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
> > t.invokeNext(StandardPipeline.java:641)
> > at
> > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
> > ava:163)
> > at
> > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
> > t.invokeNext(StandardPipeline.java:641)
> > at
> > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
> > a:480)
> > at
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> >
> > at
> > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
> > ve.java:174)
> > at
> > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContex
> > t.invokeNext(StandardPipeline.java:643)
> > at
> > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
> > a:480)
> > at
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
> >
> > at
> > org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:19
> > 9)
> > at
> > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
> > :828)
> > at
> > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
> > ssConnection(Http11Protocol.java:700)
> > at
> > org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
> > :584)
> > at
> > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
> > ool.java:683)
> > at java.lang.Thread.run(Thread.java:534)
> > </pre></p><HR size="1"
> noshade><h3>Apache
> > Tomc
> > at/4.1.30</h3></body></html>
> >
> > In the Tomcat window a message appears:
> > SOAP Service Manager: Unable to read 'DeployedServices.ds': assuming
fresh
> > start
> >
> > HOW CAN I RESOLVE THE PROBLEM????
> > ----- Original Message -----
> > From: "Scott Nichol" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Thursday, June 10, 2004 7:34 PM
> > Subject: Re: problem with ServiceManagerClient
> >
> >
> > You do not have an XML parser in the classpath for your client.
> >
> > Scott Nichol
> >
> > Do not send e-mail directly to this e-mail address,
> > because it is filtered to accept only mail from
> > specific mail lists.
> > ----- Original Message -----
> > From: "Francesco Dipalo" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Thursday, June 10, 2004 4:13 AM
> > Subject: problem with ServiceManagerClient
> >
> >
> >
> > My web server is Apache Tomcat 4.1.30 and I have Apache Soap 2.3.1 as
web
> > app. When I try:
> > java org.apache.soap.server.ServiceManagerClient
> > http://localhost:8080/soap/servlet/rpcrouter list
> > I receive this exception:
> >
> > Exception in thread "main" java.lang.NoClassDefFoundError:
> org/w3c/dom/Node
> > at
> >
>
org.apache.soap.server.ServiceManagerClient.<init>(ServiceManagerClient.java
> > :81)
> > at
> >
>
org.apache.soap.server.ServiceManagerClient.main(ServiceManagerClient.java:2
> > 16)
> >
> > Why?
> >
> >
> >
> >
> > --
> > Email.it, the professional e-mail, gratis per te: http://www.email.it/f
> >
> > Sponsor:
> > Vuoi acquistare con sconti esclusivi? Con EmailConto Risparmio puoi
> > scontare fino al 20% i tuoi acquisti!
> > * Prova subito la convenienza cliccando qui.
> > Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?midf7&d-6
> >
> >
> >
> >
> > --
> > Email.it, the professional e-mail, gratis per te: http://www.email.it/f
> >
> > Sponsor:
> > La tua casella di posta ti va "stretta" prova i 100 MB di Email.it PRO
�
> proprio mega!
> > Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=1625&d=11-611-6
> >
>
>
>
>
> --
> Email.it, the professional e-mail, gratis per te: http://www.email.it/f
>
> Sponsor:
> Treccia di Bufala Campana comprala su Terrasolis.com Spedizione Gratis
per spese superiori a 85 Euro
> Clicca qui:
http://adv.email.it/cgi-bin/foclick.cgi?mid=2493&d=11-6click.cgi?mid=2152&d=11-6
>
--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f
Sponsor:
Corsi professionali in aula: Office, sviluppo web e molto altro! Dai subito
un'occhiata senza impegno ai programmi e al calendario dei corsi a cui sei
interessato...
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=2338&d=11-6