Stub deployment

LegacyForumLegacyForum Posts: 1,669 ✭✭
edited December 2016 in SOAtest
Hi,
I have created a stub which I will be using instead of the actual web service provider. I am trying to configure the stub to return a particular response, based on the value of a node attribute of the request.
However, these conditions are not being evaluated and the stub returns None of the multiple responses XPath functions or URL parameter matched the request
This is the error that I get:
<?xml version="1.0" encoding="UTF-8"?>

<Error>
<Reason>None of the multiple responses XPath functions or URL parameter matched the request</Reason>
<Response
id="1">
<XPath>/*[local-name(.)="Envelope"]/*[local-name(.)="Body"]/*[local-name(.)="BaggageFileRequest"]/*[local-name(.)="RequestInfo"]/@*[local-name(.)="ApplicationId"]/text()="123"</XPath>
<UrlParameters/>
</Response>
<Response
id="2">
<XPath>/*[local-name(.)="Envelope"]/*[local-name(.)="Body"]/*[local-name(.)="BaggageFileRequest"]/*[local-name(.)="RequestInfo"]/@*[local-name(.)="ApplicationId"]/text()="9876"</XPath>
<UrlParameters/>
</Response>
<Response id="3">
<XPath>/*[local-name(.)="Envelope"]/*[local-name(.)="Body"]/*[local-name(.)="BaggageFileRequest"]/*[local-name(.)="RequestInfo"]/@*[local-name(.)="ApplicationId"]/text()="67"</XPath>
<UrlParameters/>
</Response>
</Error>

How do I go about using multiple responses option in case where I need to decide on the response based on the rrequest Attribute?

Also, is it possible to create stubs in Parasoft, in case of MQ integrations, to mimic the request-response mechanism?

Thanks a lot
Tagged:

Comments

  • LegacyForumLegacyForum Posts: 1,669 ✭✭
    edited December 2016
    Hi Sayana,

    I'll be happy to help wth your question

    It looks like this might just be an issue with the formatting of the XPath expressions. for example, changing the first XPath you list from:
    /*[local-name(.)="Envelope"]/*[local-name(.)="Body"]/*[local-name(.)="BaggageFileRequest"]/*[local-name(.)="RequestInfo"]/@*[local-name(.)="ApplicationId"]/text()="123"
    to one of the following...

    (A)
    /*[local-name(.)="Envelope"]/*[local-name(.)="Body"]/*[local-name(.)="BaggageFileRequest"]/*[local-name(.)="RequestInfo"][@ApplicationId=";123"]/text()
    should accomplish what you're trying to do if the ApplicationID attribute is contained in the RequestInfo tag, or...

    (
    /*[local-name(.)="Envelope"]/*[local-name(.)="Body"]/*[local-name(.)="BaggageFileRequest"]/*[local-name(.)="RequestInfo"]/*[@ApplicationId=";123"]/text()
    should accomplish what you're trying to do if the ApplicationID attribute is contained in a tag one level deeper than the RequestInfo tag.

    To test this yourself, you can install the add-on "XPath Checker" in Firefox. Then, you can open your XML payload in Firefox, right'click the page and click "View XPath". You can then enter your XPath expression node by node to see the resulting XPath, including finding where your XPath may break.

    Please let me know if adjusting your XPath per the parameters above help to resolve your issue.

    Thank you and regards,
  • LegacyForumLegacyForum Posts: 1,669 ✭✭
    edited December 2016
    Hello again,

    Regarding your MQ inquiry, SOAtest stubs can emulate services deployed on IBM WebSphere MQ by configuring the necessary MQ Settings.

    For detains on how to Configure MQ for Stubs, please refer to the SOAtes help documentation under "Parasoft SOAtest User's Guide > Service Virtualization: Creating and Deploying Stubs > Configuring Stub Server Deployment Settings > Configuring MQ for Stubs"

    I hope that answers the MQ question. Please let me know if your questions have been answered satisfactorily.

    Thank you and regards,
  • LegacyForumLegacyForum Posts: 1,669 ✭✭
    Hi,
    Thanks alot. Its working
Sign In or Register to comment.