{ 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
0
Question by futurexv 2020 · Apr 22, 2019 at 06:55 AM · 205 Views raise fault

Raise Fault copy function does not work anymore

Hi, can anyone help me why my Raise Fault does not work anymore during last few days. Before I deployed in APIGEE Edge UI successfully but now it shows the below message. It seems that APIGEE update XML Schema validation without notice. Thank you.

Error Saving Revision 10
Error occurred while validation of bean xxx.xml. Reason: - Schema validation failed. Cause : unexpected element (uri:"", local:"Header"). Expected elements are <{}Path>,<{}FormParams>,<{}Version>,<{}Headers>,<{}Verb>,<{}ReasonPhrase>,<{}Payload>,<{}QueryParams>,<{}StatusCode>. Line number : 7. Column number : 22. File name : xxx.xml.

My code:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<RaiseFault async="false" continueOnError="false" enabled="true" name="xxx">
    <DisplayName>xxx</DisplayName>
    <Properties/>
    <FaultResponse>
        <Copy source="response">
            <Header/>
            <Body/>
        </Copy>
    </FaultResponse>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
</RaiseFault>
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   · Apr 23, 2019 at 05:23 PM

Hi - that's not a valid use of the policy.

From the documentation, It looks to me that the Copy element supports three child elements:

  • Headers
  • StatusCode
  • ReasonPhrase

your use of Header and Body are not supported; as far as I am aware, they have never been supported as child elements under Copy.

The actual validation message conflicts with the documentation. That message indicates that there are other elements that could be used there. But the doc doesn't say what those things do, so we should assume that they do nothing.

I suggest you correct your policy to something like this:

<RaiseFault async="false" continueOnError="false" enabled="true" name="xxx">
    <DisplayName>xxx</DisplayName>
    <Properties/>
    <FaultResponse>
        <Copy source="response">
            <Headers/>
            <StatusCode/>
            <ReasonPhrase/>
        </Copy>
    </FaultResponse>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
</RaiseFault>
Comment
Add comment Show 5 · 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 futurexv 2020 · Apr 23, 2019 at 10:32 PM 0
Link

Thanks @Dino-at-Google. The thing is my code was copied from APIGEE doc before, the Raise Fault doc was changed too, now it is similar to what you suggested. I think APIGEE changed XML schema validation. I check today and my code works again. APIGEE might have fixed the error I guess.

avatar image Dino-at-Google ♦♦ futurexv 2020   · Apr 23, 2019 at 10:44 PM 0
Link

Yes, it makes sense that Apigee changed the XML Schema validation.

But the doc... I will have to check on that. That seems unlikely. I don't think it ever worked that way.

@Will Witman or @sgilson - do you have any insight? Can you tell me if the RaiseFault doc previously showed an example policy like this?:

<RaiseFault name="xxx">
    <DisplayName>xxx</DisplayName>
    <Properties/>
    <FaultResponse>
        <Copy source="response">
            <Header/> <!-- this -->
            <Body/>   <!-- and this -->
        </Copy>
    </FaultResponse>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
</RaiseFault>

avatar image Will Witman ♦♦ Dino-at-Google ♦♦ · Apr 24, 2019 at 10:19 PM 0
Link

It looks like RaiseFault inherits the same Copy elements as AssignMessage, which means these:


  • <FormParams>
  • <Headers>
  • <Payload>
  • <Path>
  • <QueryParams>
  • <ReasonPhrase>
  • <StatusCode>
  • <Verb>
  • <Version>

I'll verify this and update the docs as needed.


Show more comments

Follow this Question

Answers Answers and Comments

65 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

Related Questions

What is the value flow variable fault.name when error is explicitly generated by Raisefault policy? I see it every time as RaiseFault. 4 Answers

XSL Transformation in Raise Fault 1 Answer

When client views an internal error message in a prod project. What is the first thing that you are going to do? 1 Answer

How to intimate error occurred without using the raise fault policy? 3 Answers

Unable to bring Status 404 . How to apply Raise Fault for an alphanumeric ID to get Status 404 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