Service Virtualization

Expand all | Collapse all

Error while creating SOAP service using CA DevTest

Jump to Best Answer
  • 1.  Error while creating SOAP service using CA DevTest

    Posted 08-03-2017 07:22 AM

    Hi,

    Tried creating simple soap service and used Generic XML payload parser data protocol. Getting error while setting attributes as arguments from Soap request. Please find below the screenshot.

    javax.xml.transform.TransformerException: A location step was expected following the '/' or '//' token.
    at org.apache.xpath.compiler.XPathParser.error(XPathParser.java:610)
    at org.apache.xpath.compiler.XPathParser.RelativeLocationPath(XPathParser.java:1639)
    at org.apache.xpath.compiler.XPathParser.LocationPath(XPathParser.java:1597)
    at org.apache.xpath.compiler.XPathParser.PathExpr(XPathParser.java:1317)
    at org.apache.xpath.compiler.XPathParser.UnionExpr(XPathParser.java:1236)
    at org.apache.xpath.compiler.XPathParser.UnaryExpr(XPathParser.java:1142)
    at org.apache.xpath.compiler.XPathParser.MultiplicativeExpr(XPathParser.java:1063)
    at org.apache.xpath.compiler.XPathParser.AdditiveExpr(XPathParser.java:1005)
    at org.apache.xpath.compiler.XPathParser.RelationalExpr(XPathParser.java:930)
    at org.apache.xpath.compiler.XPathParser.EqualityExpr(XPathParser.java:870)
    at org.apache.xpath.compiler.XPathParser.AndExpr(XPathParser.java:834)
    at org.apache.xpath.compiler.XPathParser.OrExpr(XPathParser.java:807)
    at org.apache.xpath.compiler.XPathParser.Expr(XPathParser.java:790)
    at org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:129)
    at org.apache.xpath.XPath.<init>(XPath.java:178)
    at org.apache.xpath.XPathAPI.eval(XPathAPI.java:277)
    at com.itko.lisa.xml.XMLXPathUtils.executeXPath(XMLXPathUtils.java:77)
    at com.itko.lisa.xml.XPathBuilderPanel.runXPath(XPathBuilderPanel.java:174)
    at com.itko.lisa.xml.XPathBuilderPanel.access$300(XPathBuilderPanel.java:40)
    at com.itko.lisa.xml.XPathBuilderPanel$3.actionPerformed(XPathBuilderPanel.java:117)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)

     

    Please let me know the solution.

     

    Thanks,

    Ganga



  • 2.  Re: Error while creating SOAP service using CA DevTest

    Posted 08-04-2017 12:49 PM

    Seems like there is an issue with the XML namespace.

    I am curious to know:

    1. Why are you using XML Payload parser? Does DevTest is not handling XML Request as is?

    2. What step are you following to Set Operation and attributes? Because as per screenshort you have selected namespace to set it as operation or argument. 

     

    If possible share Request Response pair, I can try to see what could be the issue.

     

    Thanks,

    Monika



  • 3.  Re: Error while creating SOAP service using CA DevTest
    Best Answer

    Posted 08-04-2017 02:58 PM

    Interesting. I am assume any XPath for an element or attribute value below the BookPriceStoreFareRequest element is also failing. 

    You may have uncovered an XPath incompatibility such that Apache's XPathParser does not recognize a URI declaration of "##default".

    I tried the same scenario using a Filter. I got mixed results.

     

    When the xmlns:n12 namespace declaration has a URI value of "##default" and the element contains the namespace (e.g., <ns12:BookPriceStoreFareRequest>), the XPath fails with the message you indicated. 

    The Exception thrown is something like the below:

    com.itko.lisa.xml.FilterXMLXPath - Invalid XPath: A location step was expected following the '/' or '//' token.
    javax.xml.transform.TransformerException: A location step was expected following the '/' or '//' token.
    at org.apache.xpath.compiler.XPathParser.error(XPathParser.java:610)
    at org.apache.xpath.compiler.XPathParser.RelativeLocationPath(XPathParser.java:1639)
    at org.apache.xpath.compiler.XPathParser.LocationPath(XPathParser.java:1597)
    at org.apache.xpath.compiler.XPathParser.PathExpr(XPathParser.java:1317)
    at org.apache.xpath.compiler.XPathParser.UnionExpr(XPathParser.java:1236)
    at org.apache.xpath.compiler.XPathParser.UnaryExpr(XPathParser.java:1142)
    at org.apache.xpath.compiler.XPathParser.MultiplicativeExpr(XPathParser.java:1063)
    at org.apache.xpath.compiler.XPathParser.AdditiveExpr(XPathParser.java:1005)
    at org.apache.xpath.compiler.XPathParser.RelationalExpr(XPathParser.java:930)
    at org.apache.xpath.compiler.XPathParser.EqualityExpr(XPathParser.java:870)
    at org.apache.xpath.compiler.XPathParser.AndExpr(XPathParser.java:834)
    at org.apache.xpath.compiler.XPathParser.OrExpr(XPathParser.java:807)
    at org.apache.xpath.compiler.XPathParser.Expr(XPathParser.java:790)
    at org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:129)
    at org.apache.xpath.XPath.<init>(XPath.java:178)
    at org.apache.xpath.XPathAPI.eval(XPathAPI.java:277)
    at com.itko.lisa.xml.XMLXPathUtils.executeXPath(XMLXPathUtils.java:77)

     

    If the namespace is removed from the element name (e.g., <BookPriceStoreFareRequest>) AND the xmlns:ns12 declaration contains "##default", XPathing the attribute works correctly. 

    If I change the xmlns:ns12 to a valid HTTP looking URI, both XPaths work.

      

    This leads me to believe the implementation of the XPath utilities must consider the "##default" as an invalid URI under certain conditions.



  • 4.  Re: Error while creating SOAP service using CA DevTest

    Posted 08-04-2017 03:01 PM

    Based on the screenshot, It looks like you are trying to set namespace value as an argument instead of the attribute value, please verify once. Also, please let us know which version of DevTest you are using.