[Dev] webservice recording TestMaker 4.3.1
Joseph Ribin Roy
josephr at aztecsoft.com
Fri Jun 8 03:34:33 PDT 2007
Hi William,
This is what I wanted to send with the request body.
<env:Body>
<n1:getNews xmlns:n1="http://www.pushtotest.com/weblogic8.1/sushiboats"><GetNews><keyword>technology</keyword><articlecount>5</articlecount></GetNews></n1:getNews>
</env:Body>
Where getNews is my web service method.
I had done a scripting like this.
self.xmlns1 = "http://www.pushtotest.com/weblogic8.1/sushiboat"
self.elZero = Element( "getNews",self.xmlns1)
") self.elOne = Element( "GetNews
) self.elZero.addContent( self.elOne
self.elkeyword = Element( "keyword")
self.elkeyword.addContent( "technology")
) self.elOne.addContent( self.elkeyword
") self.elAcount = Element( "articlecount
") self.elAcount.addContent( "5
) self.elOne.addContent( self.elAcount
self.doc = Document( self.elZero)
self.body.setDocument( self.doc)
self.response = self.protocol.connect(
This will create the following document ... some what similar
<?xml version="1.0" encoding="UTF-8"?>
<<getNews xmlns="http://www.pushtotest.com/weblogic8.1/sushiboats"
GetNews xmlns=""><keyword>technology</keyword><articlecount>5</articlecount></GetNews></getNews>>
But running this script I am getting an error from server
Service response=
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema>"
<env:Body>
<env:Fault>
<faultcode>env:Server</faultcode>
<faultstring>Exception during processing: javax.ejb.EJBException: Unexpected exception in com.pushtotest.soaperfkit.sushiboats.ejb.NewsServiceEJB.getNews():javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]Message: only whitespace content allowed before start tag and not t at com.bea.xml.stream.MXParser.parseProlog(MXParser.java:1815) at com.bea.xml.stream.MXParser.nextImpl(MXParser.java:1717) at com.bea.xml.stream.MXParser.next(MXParser.java:1180) at com.pushtotest.soaperfkit.sushiboats.blogic.StAXService.getNextStartElement(StAXService.java:72) at com.pushtotest.soaperfkit.sushiboats.blogic.StAXService.getRequestValues(StAXService.java:86) at com.pushtotest.soaperfkit.sushiboats.blogic.StAXService.getNews(StAXService.java:190) at com.pushtotest.soaperfkit.sushiboats.ejb.NewsServiceEJB.getNews(NewsServiceEJB.java:45) at com.pushtotest.soaperfkit.sushiboats.ejb.NewsService_z17kot_ELOImpl.getNews(NewsService_z17kot_ELOImpl.java:46) at sun.reflect.GeneratedMethodAccessor68.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at weblogic.webservice.component.slsb.SLSBInvocationHandler.invoke(SLSBInvocationHandler.java:88) at weblogic.webservice.core.handler.InvokeHandler.handleRequest(InvokeHandlerjava:104) at weblogic.webservice.core.HandlerChainImpl.handleRequest(HandlerChainImpl.java:143) at weblogic.webservice.core.DefaultOperation.process(DefaultOperation.java:549) at weblogic.webservice.server.Dispatcher.process(Dispatcher.java:204) at weblogic.webservice.server.Dispatcher.doDispatch(Dispatcher.java:176) at weblogic.webservice.server.Dispatcher.dispatch(Dispatcher.java:96) at weblogic.webservice.server.WebServiceManager.dispatch(WebServiceManager.java:100) at weblogic.webservice.server.servlet.WebServiceServlet.serverSideInvoke(WebServiceServlet.java:297) at weblogic.webservice.server.servlet.ServletBase.doPost(ServletBase.java:485) at weblogic.webservice.server.servlet.WebServiceServlet.doPost(WebServiceServlet.java:267) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1072) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6981) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3892) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2766) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183); nested exception is: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]Message: only whitespace content allowed before start tag and not t (see Fault Detail for stacktrace)
</faultstring>
<detail>
......
...
..
.
</detail>
</env:Fault>
</env:Body>
</env:Envelope>
done
William I have few more questions...
-->For recording any webservice which has to go through proxyServer do I have to do any proxy setting? As we have to do it for recording web pages, where do I do it?
-->Can I record only WSDL based webservice through Test Maker? Say if I have a JMS service in my SOA based application is it possible to record it?
-----Original Message-----
From: dev-bounces at lists.pushtotest.com [mailto:dev-bounces at lists.pushtotest.com] On Behalf Of William Martínez Pomares
Sent: Thursday, June 07, 2007 6:04 AM
To: PushToTest TestMaker Developers List
Subject: RE: [Dev] webservice recording TestMaker 4.3.1
Sorry, Joseph, I didn't answer before. Had had a lot of work lately.
Yes, you cannot use addParameter since it is for RPC. Please note the attached PY file, it has an example of how to use the document style.
You need to create the XML using SAX and Element. Hope this example clarifies it.
Let me know if you have any question.
William.
The information contained in, or attached to, this e-mail, contains confidential information and is intended solely for the use of the individual or entity to whom they are addressed and is subject to legal privilege. If you have received this e-mail in error you should notify the sender immediately by reply e-mail, delete the message from your system and notify your system manager. Please do not copy it for any purpose, or disclose its contents to any other person. The views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of the company. The recipient should check this e-mail and any attachments for the presence of viruses. The company accepts no liability for any damage caused, directly or indirectly, by any virus transmitted in this email.
www.aztecsoft.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cake.pushtotest.com/pipermail/dev/attachments/20070608/4c88211b/attachment-0001.htm
More information about the Dev
mailing list