{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Adapter for Envoy
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • 日本語コミュニティ
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • General /
This question was closed Jun 30, 2020 at 01:23 AM by Patricia Xia for the following reason: The question is solved.
avatar image
0
Question by Patricia Xia · Jun 26, 2020 at 04:01 AM · 195 Views soapextract variablexpath

Extract Variable Policy XPath in SOAP Preflow Request

Hi Apigeeks

Can someone kindly explain the definition of the xPath for me?

  • local-name(/*)
  • local-name(/*/*[local-name() = 'Body'])
  • namespace-uri(/*)
  • local-name(//*[local-name() = 'Body']/*[1])
<XMLPayload stopPayloadProcessing="false">
    <Variable name="envelope" type="String">
        <XPath>local-name(/*)</XPath>
    </Variable>
    <Variable name="body" type="String">
        <XPath>local-name(/*/*[local-name() = 'Body'])</XPath>
    </Variable>
    <Variable name="envelopeNamespace" type="String">
        <XPath>namespace-uri(/*)</XPath>
    </Variable>
    <Variable name="operation" type="String">
        <XPath>local-name(//*[local-name() = 'Body']/*[1])</XPath>
    </Variable>
</XMLPayload>

In addition, placing ExtractVariable policy in Preflow Request, the extract of variable is the request payload or the response?

Comment
Add comment
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Close

1 Answer

  • Sort: 
avatar image
0
Best Answer

Answer by Dino-at-Google   · Jun 26, 2020 at 06:05 PM

You are asking a question about xpath. This is not specific to Apigee.

I can offer some help.

expression meaning
local-name(/*) the local name of the very first, root element of the XML document. "local" means non-namespace qualified and with no prefix. In a SOAP document, this will return "Envelope".
local-name(/*/*[local-name() = 'Body']) The local name of the child of the root element, which has a local-name of 'Body'. This will always result to "Body" if there is a child of the root element called "Body" in the document.
namespace-uri(/*) the namespace of the root element. In a SOAP document, this will return the soap namespace URI. SOAP 1.1 uses namespace http://schemas.xmlsoap.org/wsdl/soap/
SOAP 1.2 uses namespace http://schemas.xmlsoap.org/wsdl/soap12/
(the final expression you cited) That gives the first child element of <Body>. In a SOAP document, it's the soap request element. This is usually the operation in the WSDL.

If these explanations are not clear, I suggest that you read some documentation and tutorials on xpath. For suggestions, LMGTFY.

placing ExtractVariable policy in Preflow Request, the extract of variable is the request payload or the response?

The ExtractVariables policy takes a Source configuration option. Check the documentation for the policy for details on how it works.

Having said that, if the proxy is in the request preflow, there is no response payload. The proxy hasn't received the response payload yet. The response doesn't exist. So there is no possibility for the ExtractVariables attached to the request preflow to operate on the response. If you tried to configure it that way, it would fail at runtime.

Comment
Add comment Show 2 · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Patricia Xia · Jun 27, 2020 at 05:25 PM 0
Link

Hello @dino-at-google

Thank you for the explanation. The ExtractVariable policy is auto generated when I created the SOAP proxy. That being said, what is the meaning of the policy to be built at preflow request?

avatar image Dino-at-Google ♦♦ Patricia Xia   · Jun 29, 2020 at 01:43 PM 0
Link

I don't understand this

what is the meaning of the policy to be built at preflow request?

I think you are asking, why is the policy in the preflow.

And it's probably designed to extract the Envelope and the Body, to verify that the inbound request is a well-formed soap message. I'm inferring.

Follow this Question

Answers Answers and Comments

54 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Using XPath from a flow variable 1 Answer

Error in WSDL 2 Answers

How can I use ExtractVariables to extract elements from within a CDATA section? 2 Answers

Check for presence of an element in soap body 1 Answer

I want to extract 3 fields from my json response which returns array . 2 Answers

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2021 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Adapter for Envoy
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • 日本語コミュニティ
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Badges