{ 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 /
  • Edge/API Management /
avatar image
1
Question by shubham singh · Jun 26, 2020 at 02:04 PM · 68 Views extractvariablesxmlxslt

why do all Namespace gets appended when extracted through extract Variable policy for a SOAP xml?

Hi All

I am trying to extract a node from a soap XML through extract variable policy.When extracted the last node which has to be extracted gets appended with all the namespaces present in that SOAP Xml

why is it appending all the namespaces?

ExtractVariables configuration

<ExtractVariables name='EV-1'>
  <Source>something_here</Source>
  <XMLPayload stopPayloadProcessing="false"> 
    <Namespaces> 
      <Namespace prefix="soap">http://www.w3.org/2003/05/soap-envelope</Namespace> 
      <Namespace prefix="c">http://www.docusign.net/API/3.0</Namespace> 
      <Namespace prefix="s">http://webservice.bmc.pharmacy.com</Namespace> 
    </Namespaces> 
    <Variable name="process" type="nodeset"> 
      <XPath>/soap:Envelope/soap:Body/c:Root/c:Name/c:Country/node()</XPath> 
    </Variable> 
  </XMLPayload> 
</ExtractVariables>

SOAP request

<soap:Envelope
    xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:ss="http://schemas.xmlsoap.org/soap/encoding/">
  <soap:Body> 
    <Root xmlns="http://www.docusign.net/API/3.0">
      <Name>
        <Country>
          <Countrycode
              xmlns="http://webservice.bmc.pharmacy.com">
            <Code1>6DCDC360-5339-4028-ACF3-54B639499642</Code1>
            <Code2>2020-05-26T08:52:30</Code2>
            <US>
              <Uscode1>Community and Economic Development Association of Cook County, Inc.</Uscode1>
              <Uscode2>21</Uscode2>
            </US>
          </Countrycode>
        </Country>
      </Name>
    </Root>
  </soap:Body>
</soap:Envelope>


ExtractVariables response

<Countrycode 
    xmlns="http://webservice.bmc.pharmacy.com"
    xmlns:ss="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Code1>6DCDC360-5339-4028-ACF3-54B639499642</Code1>
  <Code2>2020-05-26T08:52:30</Code2> 
  <US> 
    <Uscode1>Community and
    Economic Development Association of Cook County, Inc.</Uscode1>
    <Uscode2>21</Uscode2> 
  </US> 
</Countrycode>

Attaching the details

extractvariable-response.txt

extractvariable-config.txt

sample-req.txt

@Dino-at-Google @Dino @Anil Sagar @ Google

extractvariable-response.txt (522 B)
extractvariable-config.txt (451 B)
sample-req.txt (961 B)
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

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

I don't know why the extraneous namespaces are included there. That seems like an unnecessary side-effect of the ExtractVariables policy.

The XML namespaces do not affect the correctness of the extracted XML, though.

You could remove them with an XSLT if they are bothering you, or causing other problems.

You need the "default" namepace, of course (the pharmacy.com namespace).

Comment
Add comment Show 1 · 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 shubham singh · Jun 29, 2020 at 04:52 AM 0
Link

Yes,XSLT would work and is working,but i wanted to use the predefined policies to extract to avoid the compiling and all process of an xslt...

Yes,I do need the pharmacy namespace while sending the response .

Is there a ticket raised for this bug of extract variable policy?

Follow this Question

Answers Answers and Comments

71 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 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

How to get a Json response by passing input in Headers of PostMan. 1 Answer

Extract Namespace using Extract variable policy 2 Answers

perform XSL Transformation to get a normal XML response, then JSON ? 1 Answer

Using XPath in ExtractVariables policy to obtain multiple values 1 Answer

Error with XSL Transform - XSLT-Transform.xsl failed with reason: "Process instruction target name cannot be xml at line 2(possibly around char 18)" 1 Answer

  • 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