Re: Web Services Testing

145 views
Skip to first unread message

kantharaja t

unread,
Nov 7, 2012, 6:36:02 PM11/7/12
to LR-Loa...@googlegroups.com
Web service testing should be done thru Web Service protocol.

Take the end point URL and SOAP message import it and run

On Wed, Nov 7, 2012 at 3:26 PM, rahul sinha <rahulsi...@gmail.com> wrote:
Hello Everyone,
I am testing a web service by creating a web_custom_request in web http/html protocol. The WSDl is not being accepted by the web service protocol so i decided to use web_custom_request.
The issue i am facing is that i get a 401  (Invalid Session ID or Session Expired) error every time i play my script. I have spoken to the developer and they say that there is no need to send a certficate or header with the request.
 
I have used the web_set_user function to tackle this issue but still get the same error and have tried everything else possible by reading material online.
 
FYI: The request i am sending works with the same credentials works in soapUI and gives me a response as well.
 
Any suggestions would be greatly appreciated.
 
Thanks

--
 
 



--
Thanks and Regards
 Kantharaja

Pramod Phophalia

unread,
Nov 7, 2012, 10:41:04 PM11/7/12
to LR-Loa...@googlegroups.com
Hi Rahul,

You need to create a web_submit_data request and you need to transmit that XML to End point URL.So need to have all the headers and request XML in place.;

You need to add headers using web_add_header() function  which you could get from SOAP UI.

Let me know if you have break through it!!!

Thanks
Pramod

--
 
 

James Pulley

unread,
Nov 8, 2012, 7:28:05 AM11/8/12
to LR-Loa...@googlegroups.com
Web services are embedded inside I the http protocol for communications.   If you are conversant with the web virtual user them you can use them for we services as well.  

If you ask the protocol advisor it may also suggest winsock and DCOM, both of which would be onerous to UAE for web services 
--
 
 

Abhishek Banginwar

unread,
Nov 10, 2012, 3:37:40 AM11/10/12
to LR-Loa...@googlegroups.com

Can turn on advanced log and trace and paste it here?
Of course mask the data and sensitive information.
On Nov 10, 2012 5:36 AM, "rahul sinha" <rahulsi...@gmail.com> wrote:
>
> Hi Pramod,
> Thank You for reply i did try this along with the web_add_header function and web_set_security function but keep getting the same error.

> --
>  
>  

Abhishek Banginwar

unread,
Nov 11, 2012, 7:44:46 PM11/11/12
to LR-Loa...@googlegroups.com
it looks like header is missing; you try one of two things
1. try to get exact xml from interface server log.
2. if you have altova xml spy, you can check what exactly you are sending.


On Mon, Nov 12, 2012 at 4:51 AM, rahul sinha <rahulsi...@gmail.com> wrote:
Hi Abhishek,
Thanks for your reply. Here are the logs:
I can see a Invalid session ID or session expired in there but dont know how to fix this as there are no cookies involved.

 ></CustomerReferences><ContentRecords /></RequestedPackageLineItems><ShipTimestamp>2012-09
Action.c(19):     -12T07:27:49.406Z</ShipTimestamp></Request></xxxxxxxxShipment></ShipmentRequest></DataArea></
Action.c(19):     ProcessShipmentRequest></soap:Body></soap:Envelope>
Action.c(19): t=2598ms: 285-byte response headers for "http://webservices-test.b2b.xxxxxxxxxx.com/shipment/xxxxxxxxShippingService" (RelFrameId=1, Internal ID=1)
Action.c(19):     HTTP/1.1 401 Invalid Session ID or Session Expired\r\n
Action.c(19):     Date: Sun, 11 Nov 2012 20:32:52 GMT\r\n
Action.c(19):     Content-Type: text/xml; charset=UTF-8\r\n
Action.c(19):     WWW-Authenticate: Basic realm="Integration Server"\r\n
Action.c(19):     Content-Length: 859\r\n
Action.c(19):     Keep-Alive: timeout=5, max=100\r\n
Action.c(19):     Connection: Keep-Alive\r\n
Action.c(19):     X-Pad: avoid browser bug\r\n
Action.c(19):     \r\n
Action.c(19): t=2631ms: 859-byte response body for "http://webservices-test.b2b.xxxxxxxx.com/shipment/xxxxxxxShippingService" (RelFrameId=1, Internal ID=1)
Action.c(19):     <?xml version="1.0" encoding="UTF-8"?>\n
Action.c(19):     <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="h
Action.c(19):     ttp://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">\n
Action.c(19):       <SOAP-ENV:Header xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"></SOAP-ENV:H
Action.c(19):     eader><SOAP-ENV:Body>\n
Action.c(19):        <SOAP-ENV:Fault>\n
Action.c(19):         <faultcode>SOAP-ENV:Client</faultcode>\n
Action.c(19):         <faultstring>[ISS.0088.9164] Access to WSDescriptor xxxxxxxx.b2b.xxxxxxxShipping.services.
Action.c(19):     business.webServices.atomic.main.provider.xxxxxxxxxShippingService:xxxxxxShippingService denied
Action.c(19):     .</faultstring>\n
Action.c(19):         <faultactor>http://webservices-test.b2b.xxxxxxxx.com/ws/xxxxxx.b2b.fxxxxxxxShipping.service
Action.c(19):     s.business.webServices.atomic.main.provider.xxxxxxShippingService.xxxxxxShippingService/xxxx
Action.c(19):     xShippingService</faultactor>\n
Action.c(19):        </SOAP-ENV:Fault>\n
Action.c(19):       </SOAP-ENV:Body>\n
Action.c(19):     </SOAP-ENV:Envelope>\n
Action.c(19): t=2694ms: Request done "http://webservices-test.b2b.xxxxxxx.com/shipment/xxxxxxxShippingService"      [MsgId: MMSG-26000]
Action.c(19): Error: HTTP status code 401 returned by the server
Action.c(19): Error Exceptions:
Action.c(19): System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.SEHException: External component has thrown an exception.
   at LrWsClientsLib.IWSReplayData.SetRequestBody(Array saBody)
   at Mercury.LR.WS.ProxyBase.LrWsWebRequest.SyncProcessRequest()
   at Mercury.LR.WS.ProxyBase.LrWsWebRequest.OnRequestStreamClosed(MemoryStream stream)
   at Mercury.LR.WS.ProxyBase.WSMemoryStream.Close()
   at Microsoft.Web.Services2.OutputStream.Close()
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at Mercury.LR.NETProxyxxxxxxxShippingService.ProcessShipment(ProcessShipmentRequestType ProcessShipmentRequest)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at Mercury.LR.LrWsNetClient.ProxyCreator.InvokeMethod(String sMethod, IWSMethodParameters mParams, String sAsyncEvent)
   at Mercury.LR.LrWsNetClient.NetReplay.InvokeMethod(String sMethod, IWSMethodParameters mParams, String sAsyncEvent)
Action.c(19): Error: InvokeMethod failure: External component has thrown an exception..
Action.c(19): Error stack trace:    at Mercury.LR.LrWsNetClient.ResultArgExtractor.CreateXmlArgsDoc()
   at Mercury.LR.LrWsNetClient.ResultArgExtractor.ExtractArgAsXml(String sArgPath, ArgumentExtractionType extractionType)
   at Mercury.LR.LrWsNetClient.ResultArgExtractor.ExtractArg(String sArgPath, Boolean IsSaveResultArgumentsAsIs, ArgumentExtractionType extractionType)
   at Mercury.LR.LrWsNetClient.ProxyCreator.ExtractArg(String sArgPath, ArgumentExtractionType extractionType)
   at Mercury.LR.LrWsNetClient.NetReplay.ExtractResultArg(String sArgPath, ArgumentExtractionType extractionType, Array& barrArgValue)
Action.c(19): Error: ExtractResultArg failure: Object reference not set to an instance of an object..
Action.c(19): Error: Web service call "ProcessShipment_101" execution failed
Ending action Action.
Ending iteration 1.
Ending Vuser...
Starting action vuser_end.
--
 
 



--
Abhishek

Message has been deleted

kantharaja t

unread,
Nov 15, 2012, 6:49:41 PM11/15/12
to LR-Loa...@googlegroups.com
Wat did you do? how did the problem got resolved?

On Thu, Nov 15, 2012 at 12:33 PM, rahul sinha <rahulsi...@gmail.com> wrote:

Hello Everyone i was able to create the scripts successfully. Thanks for everyone's help and updates.

On Tuesday, November 13, 2012 10:58:52 AM UTC-5, Selvakr wrote:

Capture the traffic from SOAPUI and compare it with the one sent by your LR script. You can use the capture to create the web service protocol script. You can also try to record by making LR as a proxy between SOAPUI and the application.


On Sunday, 11 November 2012 16:58:33 UTC-8, rahul sinha wrote:
Hi Abhishek,
Thanks for your reply. I did add the header to the script but when i replay my script after adding headers i am getting timeout errors. For encountering this i increased the timeout for STEP & RECEIVE to 240 by using web_set_timeout but the web_service_call will still timeout in spite of increasing the time. I will check what i am exactly sending to the server. Hopefully it gives a solution.

--
 
 
Reply all
Reply to author
Forward
0 new messages