在WSO2业务规则服务器上启用REST

时间:2016-04-08 09:20:43

标签: rest wsdl wso2 business-rules

我正在研究Wso2业务规则管理解决方案(Wso2 brs),并且我已成功完成了创建第一条规则的步骤:https://docs.wso2.com/display/BRS220/Creating+and+Deploying+the+Rule+Service

目前可以使用SOAP协议访问该规则,但我想使用REST。我在文档中看到必须有一种方法可以实现这一点(https://docs.wso2.com/display/BRS220/Features),但我没有找到任何关于如何在BRS上进行此操作的指示。

以下是我的wsdl定义的一些行:

A

我看到有一个“OrderApprovalServiceHttpsEndpoint”和一个“OrderApprovalServiceHttpEndpoint”可以对应一个REST Web服务,但我尝试到达它们的所有尝试都失败了。如果我尝试在POST请求中发送此模型:

input{
  width: 200px;
  //added a smooth transition, need vendor prefixes
  transition: width 0.25s ease-in;
}
input:focus{
 width: 300px;
}

我收到错误500:

<wsdl2:service name="OrderApprovalService" interface="tns:ServiceInterface">
    <wsdl2:endpoint name="OrderApprovalServiceHttpsEndpoint" binding="tns:OrderApprovalServiceHttpBinding" address="https://10.130.3.70:9443/services/OrderApprovalService.OrderApprovalServiceHttpsEndpoint/"/>
    <wsdl2:endpoint name="OrderApprovalServiceHttpSoap12Endpoint" binding="tns:OrderApprovalServiceSoap12Binding" address="http://10.130.3.70:9763/services/OrderApprovalService.OrderApprovalServiceHttpSoap12Endpoint/"/>
    <wsdl2:endpoint name="OrderApprovalServiceHttpsSoap12Endpoint" binding="tns:OrderApprovalServiceSoap12Binding" address="https://10.130.3.70:9443/services/OrderApprovalService.OrderApprovalServiceHttpsSoap12Endpoint/"/>
    <wsdl2:endpoint name="OrderApprovalServiceHttpSoap11Endpoint" binding="tns:OrderApprovalServiceSoap11Binding" address="http://10.130.3.70:9763/services/OrderApprovalService.OrderApprovalServiceHttpSoap11Endpoint/"/>
    <wsdl2:endpoint name="OrderApprovalServiceHttpEndpoint" binding="tns:OrderApprovalServiceHttpBinding" address="http://10.130.3.70:9763/services/OrderApprovalService.OrderApprovalServiceHttpEndpoint/"/>
    <wsdl2:endpoint name="OrderApprovalServiceHttpsSoap11Endpoint" binding="tns:OrderApprovalServiceSoap11Binding" address="https://10.130.3.70:9443/services/OrderApprovalService.OrderApprovalServiceHttpsSoap11Endpoint/"/>
</wsdl2:service>

这里有没有人能够成功做到这一点?或谁知道这是否可能?

谢谢

1 个答案:

答案 0 :(得分:0)

您可以使用TryIt工具为该服务尝试您的方案。 https://docs.wso2.com/display/BRS200/Testing+WSDLs 您可以在那里选择HTTP端点并捕获它生成的消息,并使用curl对端点使用它们并尝试。