desiboy1974
asked on
SOAP error
can someone help me out here..i keep getting error trying to invoke a web service using axis on apache...
Exception in thread "main" AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.reflect.Invocati onTargetEx ception
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:000372d
java.lang.reflect.Invocati onTargetEx ception
at org.apache.axis.message.SO APFaultBui lder.creat eFault(SOA PFaultBuil der
.java:222)
at org.apache.axis.message.SO APFaultBui lder.endEl ement(SOAP FaultBuild er.
java:129)
at org.apache.axis.encoding.D eserializa tionContex t.endEleme nt(Deseria liz
ationContext.java:1087)
at com.sun.org.apache.xerces. internal.p arsers.Abs tractSAXPa rser.endEl eme
nt(Unknown Source)
at com.sun.org.apache.xerces. internal.i mpl.XMLDoc umentFragm entScanner Imp
l.scanEndElement(Unknown Source)
at com.sun.org.apache.xerces. internal.i mpl.XMLDoc umentFragm entScanner Imp
l$FragmentContentDriver.ne xt(Unknown Source)
at com.sun.org.apache.xerces. internal.i mpl.XMLDoc umentScann erImpl.nex t(U
nknown Source)
at com.sun.org.apache.xerces. internal.i mpl.XMLNSD ocumentSca nnerImpl.n ext
(Unknown Source)
at com.sun.org.apache.xerces. internal.i mpl.XMLDoc umentFragm entScanner Imp
l.scanDocument(Unknown Source)
at com.sun.org.apache.xerces. internal.p arsers.XML 11Configur ation.pars e(U
nknown Source)
at com.sun.org.apache.xerces. internal.p arsers.XML 11Configur ation.pars e(U
nknown Source)
at com.sun.org.apache.xerces. internal.p arsers.XML Parser.par se(Unknown So
urce)
at com.sun.org.apache.xerces. internal.p arsers.Abs tractSAXPa rser.parse (Un
known Source)
at com.sun.org.apache.xerces. internal.j axp.SAXPar serImpl$JA XPSAXParse r.p
arse(Unknown Source)
at javax.xml.parsers.SAXParse r.parse(Un known Source)
at org.apache.axis.encoding.D eserializa tionContex t.parse(De serializat ion
Context.java:227)
at org.apache.axis.SOAPPart.g etAsSOAPEn velope(SOA PPart.java :696)
at org.apache.axis.Message.ge tSOAPEnvel ope(Messag e.java:435 )
at org.apache.axis.transport. http.HTTPS ender.read FromSocket (HTTPSende r.j
ava:796)
at org.apache.axis.transport. http.HTTPS ender.invo ke(HTTPSen der.java:1 44)
at org.apache.axis.strategies .Invocatio nStrategy. visit(Invo cationStra teg
y.java:32)
at org.apache.axis.SimpleChai n.doVisiti ng(SimpleC hain.java: 118)
at org.apache.axis.SimpleChai n.invoke(S impleChain .java:83)
at org.apache.axis.client.Axi sClient.in voke(AxisC lient.java :165)
at org.apache.axis.client.Cal l.invokeEn gine(Call. java:2784)
at org.apache.axis.client.Cal l.invoke(C all.java:2 767)
at org.apache.axis.client.Cal l.invoke(C all.java:2 443)
at org.apache.axis.client.Cal l.invoke(C all.java:2 366)
at org.apache.axis.client.Cal l.invoke(C all.java:1 812)
at emailAccountServices.ws.Em ailAccount ServicesSo apBindingS tub.findEm ail
Accounts(EmailAccountServi cesSoapBin dingStub.j ava:470)
at com.peopletelecom.appservi ces.SwiftS ervices.Te st.main(Te st.java:56 )
Exception in thread "main" AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.reflect.Invocati
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:000372d
java.lang.reflect.Invocati
at org.apache.axis.message.SO
.java:222)
at org.apache.axis.message.SO
java:129)
at org.apache.axis.encoding.D
ationContext.java:1087)
at com.sun.org.apache.xerces.
nt(Unknown Source)
at com.sun.org.apache.xerces.
l.scanEndElement(Unknown Source)
at com.sun.org.apache.xerces.
l$FragmentContentDriver.ne
at com.sun.org.apache.xerces.
nknown Source)
at com.sun.org.apache.xerces.
(Unknown Source)
at com.sun.org.apache.xerces.
l.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.
nknown Source)
at com.sun.org.apache.xerces.
nknown Source)
at com.sun.org.apache.xerces.
urce)
at com.sun.org.apache.xerces.
known Source)
at com.sun.org.apache.xerces.
arse(Unknown Source)
at javax.xml.parsers.SAXParse
at org.apache.axis.encoding.D
Context.java:227)
at org.apache.axis.SOAPPart.g
at org.apache.axis.Message.ge
at org.apache.axis.transport.
ava:796)
at org.apache.axis.transport.
at org.apache.axis.strategies
y.java:32)
at org.apache.axis.SimpleChai
at org.apache.axis.SimpleChai
at org.apache.axis.client.Axi
at org.apache.axis.client.Cal
at org.apache.axis.client.Cal
at org.apache.axis.client.Cal
at org.apache.axis.client.Cal
at org.apache.axis.client.Cal
at emailAccountServices.ws.Em
Accounts(EmailAccountServi
at com.peopletelecom.appservi
What exactly are you trying to do????? in the sense what kind of webservice are u trying to axis and when are u getting ths fault if u can be clear It will be easier for us to help :)
ASKER
this is when i run the client class that invokes the service....so i'm invoking the web service soapbinding implementation class...these classes were created after generating the proxy classes...
so when i run the command
java -cp ....
so when i run the command
java -cp ....
ASKER
so in the client test.java below...i invoke the service emailAccountServices...the error happens on the last line...
emailAccountServices.ws.Em ailAccount AppService sService service =
new emailAccountServices.ws.Em ailAccount AppService sServiceLo cator();
System.out.println("After Make a service");
// Now use the service to get a stub to the service
System.out.println("Before use the service to get a stub to the service");
emailAccountServices.ws.Em ailAccount AppService s _eas = service.getemailAccountSer vices();
System.out.println("After use the service to get a stub to the service");
java.lang.Object[] a = _eas.findEmailAccounts("08 92288950") ;
emailAccountServices.ws.Em
new emailAccountServices.ws.Em
System.out.println("After Make a service");
// Now use the service to get a stub to the service
System.out.println("Before
emailAccountServices.ws.Em
System.out.println("After use the service to get a stub to the service");
java.lang.Object[] a = _eas.findEmailAccounts("08
How did u generate the proxy ??? using WSDL2Java? then what u did ????
U need to use the proxy class instance and invoke a particular operation.
I think u are trying to invoke a findEmailAccounts Operation.
If i am correct then first check is the Web Service up and running. Use some generic client like the open which comes with Eclipse WTP package to check that :)
U need to use the proxy class instance and invoke a particular operation.
I think u are trying to invoke a findEmailAccounts Operation.
If i am correct then first check is the Web Service up and running. Use some generic client like the open which comes with Eclipse WTP package to check that :)
No No !! when u created the client did it generate the proxy class or not????/
Use the proxy class
Use the proxy class
ASKER
yes..i generated the proxy using
java -cp $AXISCLASSPATH org.apache.axis.wsdl.WSDL2 Java -o . -d Session -s -S true -Nurn:emailAccountServices emailAccountServices.ws emailAccountServices.wsdl
yes..the webservice is up and running...
java -cp $AXISCLASSPATH org.apache.axis.wsdl.WSDL2
yes..the webservice is up and running...
ASKER
WSDL2java generated the stubs....
i'm not sure i understand "when u created the client did it generate the proxy class "...
the proxy classes got generated using the
java -cp $AXISCLASSPATH org.apache.axis.wsdl.WSDL2 Java -o . -d Session -s -S true -Nurn:emailAccountServices emailAccountServices.ws emailAccountServices.wsdl
i'm not sure i understand "when u created the client did it generate the proxy class "...
the proxy classes got generated using the
java -cp $AXISCLASSPATH org.apache.axis.wsdl.WSDL2
Yes there will a Particular class file name ending with the term Proxy just check for that if u find it then create some thing like this.
xxxProxy proxy = new xxxProcy();
proxy.findEmailAccounts("2 323253");
xxxProxy proxy = new xxxProcy();
proxy.findEmailAccounts("2
ASKER
i checked...there is no class file with the name Proxy..when i used the WSDLto java command, it generated a soapbindingimplentation class, servicelocator, soapbindingskeletion and soapbindingstub class...i followed exactly this link...
http://www.resc.rdg.ac.uk/twiki/bin/view/Resc/SimpleGuideToDeployingWebServices
it mentions nothing of a proxy class getting created..
http://www.resc.rdg.ac.uk/twiki/bin/view/Resc/SimpleGuideToDeployingWebServices
it mentions nothing of a proxy class getting created..
ASKER
so when i ran the wsdltojava command, it generated these files
EmailAccountAppServices.cl ass
EmailAccountAppServicesSer viceLocato r.java
EmailAccountServicesSoapBi ndingSkele ton.java
EmailAccountServicesSoapBi ndingStub. java
EmailAccountAppServices.cl
EmailAccountAppServicesSer
EmailAccountServicesSoapBi
EmailAccountServicesSoapBi
Ok got it :) now tell me what all jars are there in you classpath there must be min of 6 jars like
axis.jar, saaj.jar, commos-logging.jar,commons -Diescover y.jar, wsdl4j.jar and finally jaxRpc jaar please chek if commons-Diescovery.jar is missing i think thats the problem.
Your approach is also correct so go ahead and check the jars :)
axis.jar, saaj.jar, commos-logging.jar,commons
Your approach is also correct so go ahead and check the jars :)
ASKER
this is the command that runs...it does include all the jards
java -cp "C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\axis\WEB-INF\l ib;C:\Prog ram Files\Apache Software Foundation\Tomcat 6.0\webapps\axis\WEB-INF\c lasses;C:\ Program Files\Apache Software Foundation\Tomcat 6.0\webapps\axis\WEB-INF\l ib\axis.ja r;C:\Progr am Files\Apache Software Foundation\Tomcat 6.0\webapps\axis\WEB-INF\l ib\jaxrpc. jar;C:\Pro gram Files\Apache Software Foundation\Tomcat 6.0\webapps\axis\WEB-INF\l ib\commons -logging-1 .0.4.jar;C :\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\axis\WEB-INF\l ib\commons -discovery -0.2.jar;C :\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\axis\WEB-INF\l ib\log4j-1 .2.8.jar;C :\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\axis\WEB-INF\l ib\saaj.ja r;C:\Progr am Files\Apache Software Foundation\Tomcat 6.0\webapps\axis\WEB-INF\l ib\wsdl4j- 1.5.1.jar; C:\Program Files\Apac he Software Foundation\Tomcat 6.0\webapps\axis\WEB-INF\l ib\xerces. jar;C:\Pro gram Files\Apache Software Foundation\Tomcat 6.0\webapps\axis\WEB-INF\l ib\tools.j ar;C:\Prog ram Files\Apache Software Foundation\Tomcat 6.0\webapps\axis\WEB-INF\l ib\activat ion.jar;C: \Program Files\Apache Software Foundation\Tomcat 6.0\webapps\axis\WEB-INF\l ib\emailAc countServi ces.jar" Test
java -cp "C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\axis\WEB-INF\l
that fishy every thing seems to be in place.
Actually when u try use the service locater it throws back a throwable just try catching and print it it may help u
http://forum.java.sun.com/thread.jspa?threadID=522422&messageID=2500244
get back with what it says
Actually when u try use the service locater it throws back a throwable just try catching and print it it may help u
http://forum.java.sun.com/thread.jspa?threadID=522422&messageID=2500244
get back with what it says
ASKER
you mean in the soapbindingimplementation class?
If the web service is on the Internet, you might need to authenticate yourself at the HTTP proxy (if you use one) to connect to it.
ASKER
no..its running locally...i am already throwing the exception in the implementation class..the only exception it throws is
java.lang.reflect.Invocati onTargetEx ception
java.lang.reflect.Invocati
Ok desiboy do one thing
Try the other way of invoking the webservice as mentioned in the link you provided.
http://www.resc.rdg.ac.uk/twiki/bin/view/Resc/SimpleGuideToDeployingWebServices
Or else try invoking it via the Eclipse Test webservices client and see if you are able to make a web service call successfully.
Please get back once you are done with it.
Try the other way of invoking the webservice as mentioned in the link you provided.
http://www.resc.rdg.ac.uk/twiki/bin/view/Resc/SimpleGuideToDeployingWebServices
Or else try invoking it via the Eclipse Test webservices client and see if you are able to make a web service call successfully.
Please get back once you are done with it.
ASKER
i tried both methods..exactly the same error?
i am using the xercesImpl.jar instead of the xerces jar..would that make any difference?
Thanks
i am using the xercesImpl.jar instead of the xerces jar..would that make any difference?
Thanks
I don't think so the actual problem is that its not able to find the Invocation target i.e your web service.
You told me that ur webservice is up and running how did u check that ????
You told me that ur webservice is up and running how did u check that ????
ASKER
no thats not sufficient try to make a web service call from eclipse inbuit Web service Client and check. Because i think the exception is occurring at the server end not the client end just check that.
And also if possible check the log of Tomcat for the correct exception.
And also if possible check the log of Tomcat for the correct exception.
ASKER
its really weird..now i get a null pointer exception when processing the deploy.wsdd file..the only change i made was add xml-api.jar to the lib directory..
Processing file emailAccountServices/ws/de ploy.wsdd
Exception: AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.NullPointerExcep tion
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:000372d
i have checked the tomcat logs..nothing at all in that ..
Processing file emailAccountServices/ws/de
Exception: AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.NullPointerExcep
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:000372d
i have checked the tomcat logs..nothing at all in that ..
Ya thats real weird.
By the way you don't need xml-api.jar. Any way now remove that jar and check if ur service is working.
By the way you don't need xml-api.jar. Any way now remove that jar and check if ur service is working.
ASKER
i removed the jar and it still gives me th null pointer exception ..i regenerated the stubs, restarted tomcat..still no change....dont undestand whats going on..
ASKER
i tried creating another web service and go the same null pointer error again?...
is there any other way of processing the deploy.wsdd file to see where the errors occurs?
is there any other way of processing the deploy.wsdd file to see where the errors occurs?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What happend desiboy? I was not in town for three days is you problem resolved?
ASKER
yes..i reinstalled everything fom scratch and it all worked fine..thanks for guiding me..