WSO2:“错误连接到后端的错误”测试集成解决方案时
大家好,
我在包括Micro Integator的Kubernetes群集上部署了WSO2 APIM,我本地使用Integration Studio来开发我的第一个集成解决方案。
我遵循以下步骤:
使用APIM的入口地址在Integration Studio中配置了服务目录
- 使用APIM
我在该服务中创建了一个API
错误:当我尝试测试API时,我会收到以下错误“错误连接到后端”
我认为服务URL可能是问题,我尝试使用Ingress Micro集成器的地址,但它不起作用
以下是我的配置:
- metadata.yaml文件
---
key: "HelloWorld-1.0.0"
name : "HelloWorld"
displayName : "HelloWorld"
description: "Sample API"
version: "1.0.0"
serviceUrl: "https://localhost:8290/sample"
definitionType: "OAS3"
securityType: "BASIC"
mutualSSLEnabled: false
- Swagger.yaml文件
openapi: 3.0.1
info:
title: HelloWorld
description: API Definition of HelloWorld
version: 1.0.0
servers:
- url: /sample
paths:
/testing:
get:
responses:
default:
description: Default response
- 和我的API
<?xml version="1.0" encoding="UTF-8"?>
<api context="/sample" name="HelloWorld" xmlns="http://ws.apache.org/ns/synapse">
<resource methods="GET" uri-template="/testing">
<inSequence/>
<outSequence>
<payloadFactory description="name" media-type="json">
<format>
{"name":"$1","role":"$2"}
</format>
<args>
<arg evaluator="json" expression="$.name"/>
<arg evaluator="json" expression="$.role"/>
</args>
</payloadFactory>
</outSequence>
<faultSequence/>
</resource>
</api>
希望有人可以帮助我因为我真的卡住了
Hello everyone,
I deployed WSO2 APIM on a kubernetes cluster which includes the micro integrator, and I used Integration Studio locally to develop my first integration solution.
I followed these steps:
Configured the service catalog in Integration Studio using the ingress address of the APIM
The service appears inside the services tab
I created an API out of that service
Error : When I try testing the API I get the following error "Error Connecting to Back end"
I think the service url may be the problem, I tried using the ingress address for the Micro Integrator but it didn't work
The following is my configuration:
- metadata.yaml file
---
key: "HelloWorld-1.0.0"
name : "HelloWorld"
displayName : "HelloWorld"
description: "Sample API"
version: "1.0.0"
serviceUrl: "https://localhost:8290/sample"
definitionType: "OAS3"
securityType: "BASIC"
mutualSSLEnabled: false
- swagger.yaml file
openapi: 3.0.1
info:
title: HelloWorld
description: API Definition of HelloWorld
version: 1.0.0
servers:
- url: /sample
paths:
/testing:
get:
responses:
default:
description: Default response
- and my API
<?xml version="1.0" encoding="UTF-8"?>
<api context="/sample" name="HelloWorld" xmlns="http://ws.apache.org/ns/synapse">
<resource methods="GET" uri-template="/testing">
<inSequence/>
<outSequence>
<payloadFactory description="name" media-type="json">
<format>
{"name":"$1","role":"$2"}
</format>
<args>
<arg evaluator="json" expression="$.name"/>
<arg evaluator="json" expression="$.role"/>
</args>
</payloadFactory>
</outSequence>
<faultSequence/>
</resource>
</api>
Hope Someone can help me as I'm really stuck
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您尝试通过APIM中包含的控制台进行测试,则可能无法识别入口主机名(我假设Ingress主机映射是在您的本地
/etc/hosts
中完成的)。如果您使用相关的卷发并通过终端调用它,这应该有效。作为替代方案,您可以使用MI部署的服务名称(而不是Intress主机名),并查看是否可以通过APIM的内置控制台调用它。当然,如果您将它们部署在相同的名称空间中。
If you are trying to the testing through the console included in APIM, it might not recognize the Ingress host names (I assume the ingress host mapping is done in your local
/etc/hosts
). This should work if you use get the relevant curl and invoke it through the terminal.As an alternative, you can use the service name (instead of Ingress host name) of the MI deployment and see whether you can invoke it through APIM's inbuilt console. This is of course if you have deployed those in the same namespace.