我创建了一个简单的API RAML文件,其中包含一个GET,不需要params,它返回一个简单的有效负载。我在我的项目中正确地使用了w/ Anypoint Studio (最近一次是上周),并在本地创建和运行了这个项目。我在3.8.3前提下有一个骡子运行时,我已经将其归档并成功地部署到其中。我可以在/apps目录w/正确的.txt文件中看到它,并且在Mule Mgmt控制台中看到它是我服务器上部署的应用程序。我只是不能正确地称呼它?您能在mule运行时上执行部署的APIKit项目吗?我的简单设置在下面,并在运行和调试模式下的任意点工作室工作(当然)w。

我调用http://localhost:8081/api/testthis作为我的URL很好,但是当我到我的mulesoft服务器部署它并调用IP http://x.x.x.x:8081/api/testthis来获取有效负载时,它就没有显示侦听器。我一定是错过了一个步骤或配置什么的,我只是不可能搜索他们的文档左右的网站,以找到问题。
任何帮助都是感激的(即使是讽刺!)
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:apikit="http://www.mulesoft.org/schema/mule/apikit" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http
http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/apikit
http://www.mulesoft.org/schema/mule/apikit/current/mule-apikit.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
<http:listener-config name="testapi-httpListenerConfig" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
<apikit:config name="testapi-config" raml="testapi.raml" consoleEnabled="false" doc:name="Router"/>
<flow name="testapi-main">
<http:listener config-ref="testapi-httpListenerConfig" path="/api/*" doc:name="HTTP"/>
<apikit:router config-ref="testapi-config" doc:name="APIkit Router"/>
<exception-strategy ref="testapi-apiKitGlobalExceptionMapping" doc:name="Reference Exception Strategy"/>
</flow>
<flow name="testapi-console">
<http:listener config-ref="testapi-httpListenerConfig" path="/console/*" doc:name="HTTP"/>
<apikit:console config-ref="testapi-config" doc:name="APIkit Console"/>
</flow>
<flow name="get:/testthis:testapi-config">
<set-payload value="[ {"code": "MyCode1", "name" : "My Code 1", "ID" : "1111" }, {"code": "MyCode2", "name" : "My Code 2", "ID" : "2222" } ]" doc:name="Set Payload"/>
</flow>
<apikit:mapping-exception-strategy name="testapi-apiKitGlobalExceptionMapping">
<apikit:mapping statusCode="404">
<apikit:exception value="org.mule.module.apikit.exception.NotFoundException" />
<set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
<set-payload value="{ "message": "Resource not found" }" doc:name="Set Payload"/>
</apikit:mapping>
<apikit:mapping statusCode="405">
<apikit:exception value="org.mule.module.apikit.exception.MethodNotAllowedException" />
<set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
<set-payload value="{ "message": "Method not allowed" }" doc:name="Set Payload"/>
</apikit:mapping>
<apikit:mapping statusCode="415">
<apikit:exception value="org.mule.module.apikit.exception.UnsupportedMediaTypeException" />
<set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
<set-payload value="{ "message": "Unsupported media type" }" doc:name="Set Payload"/>
</apikit:mapping>
<apikit:mapping statusCode="406">
<apikit:exception value="org.mule.module.apikit.exception.NotAcceptableException" />
<set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
<set-payload value="{ "message": "Not acceptable" }" doc:name="Set Payload"/>
</apikit:mapping>
<apikit:mapping statusCode="400">
<apikit:exception value="org.mule.module.apikit.exception.BadRequestException" />
<set-property propertyName="Content-Type" value="application/json" doc:name="Property"/>
<set-payload value="{ "message": "Bad request" }" doc:name="Set Payload"/>
</apikit:mapping>
</apikit:mapping-exception-strategy>
</mule>这里显示了它的部署。

这就是MMC如何将它部署到我们的1 dev服务器上。

我用来创建这个项目的RAML:
#%RAML 0.8
title: mmctest
version: 1.0
/testthis:
get:
queryParameters:
code:
displayName: "Code"
type: string
description: "The code to pass through on a querystring"
required: false
responses:
200:
body:
application/json:
example: |
[ {"code": "MyCode1", "name" : "My Code 1", "ID" : "1111" }, {"code": "MyCode2", "name" : "My Code 2", "ID" : "2222" } ] 我必须要部署的mule-config.xml只是一个shell文件。

发布于 2017-01-12 19:05:51
我的装置出了两件事。所以我为我占用你的时间而向Anirban道歉。
当我做得对的时候,一切都很好。因此,我需要注意这一点,并确保在未使用的有效端口上正确部署。
https://stackoverflow.com/questions/41617559
复制相似问题