Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 550
  • Last Modified:

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.InvocationTargetException
 faultActor:
 faultNode:
 faultDetail:
        {http://xml.apache.org/axis/}hostname:000372d

java.lang.reflect.InvocationTargetException
        at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder
.java:222)
        at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.
java:129)
        at org.apache.axis.encoding.DeserializationContext.endElement(Deserializ
ationContext.java:1087)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endEleme
nt(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanEndElement(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l$FragmentContentDriver.next(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(U
nknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next
(Unknown Source)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanDocument(Unknown Source)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(U
nknown Source)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(U
nknown Source)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown So
urce)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Un
known Source)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.p
arse(Unknown Source)
        at javax.xml.parsers.SAXParser.parse(Unknown Source)
        at org.apache.axis.encoding.DeserializationContext.parse(Deserialization
Context.java:227)
        at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
        at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
        at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.j
ava:796)
        at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)

        at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrateg
y.java:32)
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
        at org.apache.axis.client.Call.invoke(Call.java:2767)
        at org.apache.axis.client.Call.invoke(Call.java:2443)
        at org.apache.axis.client.Call.invoke(Call.java:2366)
        at org.apache.axis.client.Call.invoke(Call.java:1812)
        at emailAccountServices.ws.EmailAccountServicesSoapBindingStub.findEmail
Accounts(EmailAccountServicesSoapBindingStub.java:470)
        at com.peopletelecom.appservices.SwiftServices.Test.main(Test.java:56)
0
desiboy1974
Asked:
desiboy1974
  • 15
  • 12
1 Solution
 
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
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 :)
0
 
desiboy1974Author Commented:
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 ....
0
 
desiboy1974Author Commented:
so  in the client test.java below...i invoke the service emailAccountServices...the error happens on the last line...

emailAccountServices.ws.EmailAccountAppServicesService service =
                new emailAccountServices.ws.EmailAccountAppServicesServiceLocator();
        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.EmailAccountAppServices _eas = service.getemailAccountServices();
        System.out.println("After use the service to get a stub to the service");
       
        java.lang.Object[] a = _eas.findEmailAccounts("0892288950");
       
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
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 :)
0
 
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
No No !! when u created the client did it generate the proxy class or not????/

Use the proxy class
0
 
desiboy1974Author Commented:
yes..i generated the proxy using

java -cp $AXISCLASSPATH org.apache.axis.wsdl.WSDL2Java -o . -d Session -s -S true -Nurn:emailAccountServices emailAccountServices.ws emailAccountServices.wsdl

yes..the webservice is up and running...
0
 
desiboy1974Author Commented:
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.WSDL2Java -o . -d Session -s -S true -Nurn:emailAccountServices emailAccountServices.ws emailAccountServices.wsdl

0
 
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
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("2323253");

0
 
desiboy1974Author Commented:
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..
0
 
desiboy1974Author Commented:
so when i ran the wsdltojava command, it generated these files

EmailAccountAppServices.class
EmailAccountAppServicesServiceLocator.java
EmailAccountServicesSoapBindingSkeleton.java
EmailAccountServicesSoapBindingStub.java


0
 
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
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-Diescovery.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 :)

0
 
desiboy1974Author Commented:
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\lib;C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\axis\WEB-INF\classes;C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\axis\WEB-INF\lib\axis.jar;C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\axis\WEB-INF\lib\jaxrpc.jar;C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\axis\WEB-INF\lib\commons-logging-1.0.4.jar;C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\axis\WEB-INF\lib\commons-discovery-0.2.jar;C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\axis\WEB-INF\lib\log4j-1.2.8.jar;C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\axis\WEB-INF\lib\saaj.jar;C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\axis\WEB-INF\lib\wsdl4j-1.5.1.jar;C:\ProgramFiles\Apache Software Foundation\Tomcat 6.0\webapps\axis\WEB-INF\lib\xerces.jar;C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\axis\WEB-INF\lib\tools.jar;C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\axis\WEB-INF\lib\activation.jar;C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\axis\WEB-INF\lib\emailAccountServices.jar"  Test
0
 
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
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

0
 
desiboy1974Author Commented:
you mean in the soapbindingimplementation class?
0
 
Mayank SAssociate Director - Product EngineeringCommented:
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.
0
 
desiboy1974Author Commented:
no..its running locally...i am already throwing the exception in the implementation class..the only exception it throws is

java.lang.reflect.InvocationTargetException



        
0
 
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
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.
0
 
desiboy1974Author Commented:
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
0
 
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
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 ????
0
 
desiboy1974Author Commented:
0
 
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
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.
0
 
desiboy1974Author Commented:
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/deploy.wsdd
Exception: AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: java.lang.NullPointerException
 faultActor:
 faultNode:
 faultDetail:
        {http://xml.apache.org/axis/}hostname:000372d

i have checked the tomcat logs..nothing at all in that ..
0
 
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
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.
0
 
desiboy1974Author Commented:
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..
0
 
desiboy1974Author Commented:
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?
0
 
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
Check you Tomcat logs see whats happening.

so now your webservice is also not running is it????????

If thats the case best way is to start over again instead of trying to debug some unknown Exception.

If you are planning to start over please use Eclipse WTP version there u just need to right ur java class and u can directly expose it as a webservice. And also can generate the client right there.
0
 
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
What happend desiboy? I was not in town for three days is you problem resolved?
0
 
desiboy1974Author Commented:
yes..i reinstalled everything fom scratch and it all worked fine..thanks for guiding me..
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 15
  • 12
Tackle projects and never again get stuck behind a technical roadblock.
Join Now