将OFBiz的服务暴露为SOAP Web Services

来源:互联网 发布:梦天堂网络 编辑:程序博客网 时间:2024/05/17 18:44

2016.10.18更新

原文如下:

About OFBiz web services

In OFBiz every service can potentialy be invoked as webservice by doing minor modifications to it. You can navigate to service engine application of OFBiz admin to view the services available and other details of the services.

Navigate *http://your_host_name/webtools/control/ServiceList*

There you can find thousands of services in OFBiz.

Navigate and find the appropriate service which you want to export as web service. When you find the particular service say for example “getOrderStatus” , click on it to get the details of the service.

Check Exportable option . If its false make it to true by navigating to the Services.xml file of the particular application. In our case it is /application/order/servicedef/Services.xml . Restart OFBiz

Note: 是加一个export="true"

注意:这里是到服务器硬盘上找到Services.xml 文件,找到服务,修改 export="true",如果没有就增加。例如:找到文件  D:\apache\apache-ofbiz-12.04.04\applications\order\servicedef\Services.xml 修改<service name="getOrderStatus" engine="simple" location="component://order/script/org/ofbiz/order/order/OrderServices.xml"            invoke="getOrderStatus" auth="false" >为<service name="getOrderStatus" engine="simple" location="component://order/script/org/ofbiz/order/order/OrderServices.xml"            invoke="getOrderStatus" auth="false" export="true">        



Now you can view the wsdl file of the servie by navigating to the service engine tools application again and now click on the service name and you can see “Export wsdl” next to the service name . Click on it will display the wsdl

Also you need to get the SOAP link as it is given as end point to the java client to call the web service from outside application.

So the link is usualy available under

http://your_hostname:8080/webtools/control/SOAPService?wsdl




参考:

Calling OFBiz services from Liferay using SOAP

ofbiz services文档


0 0
原创粉丝点击