使用Azure API Management REST服务URL的WSDL导入因错误请求而失败-DevOPS [英] WSDL import using Azure API Management REST service URL is failing with bad request - DevOPS

查看:55
本文介绍了使用Azure API Management REST服务URL的WSDL导入因错误请求而失败-DevOPS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从WSDL文件自动化API管理API创建的部署过程,但是却不断收到错误请求"消息.错误根级别的数据无效".我正在使用邮递员执行请求并传递 请求正文中的整个XML.

请注意,当通过Azure Portal UI导入时,相同的WSDL可以正常工作.

{
    错误":{
        " code":"ValidationError",
        " message":一个或多个字段包含不正确的值:",
        详细信息":[
            {
                " code":"ValidationError",
                "target":"representation",
                消息":解析错误:行:1,位置1."根级别的数据无效.第1行,位置1.\""
            },
            {
                " code":"ValidationError",
                "target":"representation",
                消息":解析错误:{\事件\":[{\"级别\":\信息\",\事件\":\\ ; ParsingXMLStarted \,\" message \:\" Started 解析XML \},{\"级别\:\"错误\,\"事件\:\" ParsingXMLFailed \,\"消息\:\\ ;行:1,位置1.\\\根目录级别的数据无效.第1行,位置1.\\\"\",\"exception \":\数据 在根级别无效.第1行,位置1.\"}]}"
            }
        ]
    }
}

谢谢

Ashutosh


可爱

解决方案

我相信您正在使用此 这个示例.


I am trying to automate the deployment process for API Management API creation from WSDL file, however constantly getting "Bad Request" with error "Data at the root level is invalid". I am using Postman to execute the request and passing the whole XML in the body of the request. 

Please note that the same WSDL works fine when imported via Azure Portal UI. 

{
    "error": {
        "code": "ValidationError",
        "message": "One or more fields contain incorrect values:",
        "details": [
            {
                "code": "ValidationError",
                "target": "representation",
                "message": "Parsing error(s): Line: 1, Position 1. \"Data at the root level is invalid. Line 1, position 1.\""
            },
            {
                "code": "ValidationError",
                "target": "representation",
                "message": "Parsing error(s): {\"events\":[{\"level\":\"Informational\",\"event\":\"ParsingXMLStarted\",\"message\":\"Started parsing XML\"},{\"level\":\"Error\",\"event\":\"ParsingXMLFailed\",\"message\":\"Line: 1, Position 1. \\\"Data at the root level is invalid. Line 1, position 1.\\\"\",\"exception\":\"Data at the root level is invalid. Line 1, position 1.\"}]}"
            }
        ]
    }
}

Thanks 

Ashutosh


Cute

解决方案

I believe you are using this API.

Based on the error you are seeing, first thought would be that the inline WSDL wasn't escaped properly, especially somewhere under the documentation tag.
If the everything looks good, it would be easier to debug if you could share the body of your request with the WSDL inline if possible.

You could also try to host the WSDL somewhere and reference it from there, as shown in this example.


这篇关于使用Azure API Management REST服务URL的WSDL导入因错误请求而失败-DevOPS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆