WSO2数据服务未绑定输入
我试图创建一个简单的数据服务,在数据库中插入一个具有以下定义的条目:WSO2数据服务未绑定输入,wso2,wso2esb,Wso2,Wso2esb,我试图创建一个简单的数据服务,在数据库中插入一个具有以下定义的条目: <data name="RESTLoggerDataService" serviceNamespace="" transports="http https"> <config id="default"> <property name="driverClassName">com.mi
<data name="RESTLoggerDataService" serviceNamespace="" transports="http https">
<config id="default">
<property name="driverClassName">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
<property name="url">jdbc:sqlserver://SERVER:1433;databaseName=DB</property>
<property name="username">user</property>
<property name="password">pass</property>
</config>
<query id="CreateLog" useConfig="default">
<sql>INSERT INTO Log (Date, Username, ServiceID) VALUES (?,?,?)</sql>
<param name="Date" paramType="SCALAR" sqlType="STRING" type="IN" ordinal="1"/>
<param name="Username" paramType="SCALAR" sqlType="STRING" type="IN" ordinal="2"/>
<param name="ServiceID" paramType="SCALAR" sqlType="STRING" type="IN" ordinal="3"/>
</query>
<resource method="POST" path="Log">
<call-query href="CreateLog">
<with-param name="Date" query-param="Date"/>
<with-param name="Username" query-param="Username"/>
<with-param name="ServiceID" query-param="ServiceID"/>
</call-query>
</resource>
</data>
使用以下XML:
<_postlog>
<Date>2020-09-15 09:06:00.000</Date>
<Username>KIRBJJ</Username>
<ServiceID>WA233</ServiceID>
</_postlog>
2020-09-15 09:06:00.000
基尔布吉
WA233
但要收回以下内容:
curl: (52) Empty reply from server
curl: (52) Empty reply from server
<axis2ns19:DataServiceFault xmlns:axis2ns19="http://ws.wso2.org/dataservice"><axis2ns19:current_params>{Username=null, Date=null, ServiceID=null}</axis2ns19:current_params><axis2ns19:source_data_service><axis2ns19:data_service_name>RESTLoggerDataService</axis2ns19:data_service_name><axis2ns19:description>Exposing the data service as a REST service.</axis2ns19:description><axis2ns19:location>C:\PROGRA~1\WSO2\ENTERP~1\7154FB~1.0\MICRO-~1\bin\..\tmp\carbonapps\-1234\1600259919991RestLoggerCompositeExporter_1.0.0.car\RESTDataService_1.0.0\RESTDataService-1.0.0.dbs</axis2ns19:location><axis2ns19:default_namespace>http://ws.wso2.org/dataservice</axis2ns19:default_namespace></axis2ns19:source_data_service><axis2ns19:ds_code>DATABASE_ERROR</axis2ns19:ds_code><axis2ns19:nested_exception>com.microsoft.sqlserver.jdbc.SQLServerException: Cannot insert the value NULL into column 'Date', table 'LOGS.dbo.LogEntry'; column does not allow nulls. INSERT fails.</axis2ns19:nested_exception><axis2ns19:current_request_name>_postlog</axis2ns19:current_request_name></axis2ns19:DataServiceFault>
curl:(52)来自服务器的空回复
curl:(52)来自服务器的空回复
{Username=null,Date=null,ServiceID=null}RestLoggerDataService将数据服务公开为REST服务。C:\PROGRA~1\WSO2\entrep~1\7154FB~1.0\MICRO-~1\bin\..\tmp\carbonapps \-1234\1600259919991 RestLoggerCompositieExporter_1.0.0.car\RESTDataService_1.0.0\RESTDataService-1.0.0。dbshttp://ws.wso2.org/dataserviceDATABASE_ERRORcom.microsoft.sqlserver.jdbc.SQLServerException: 无法插入列'Date',表'LOGS.dbo.LogEntry'中的值为NULL;列不允许空值。插入失败。\u postlog
{}
RESTLoggerDataService
将数据服务公开为REST服务。
C:\PROGRA~1\WSO2\enterp1\7154FB~1.0\MICRO-~1\bin\..\tmp\carbonapps \-1234\1600263784524RestLoggerCompositeExporter\u 1.0.0.0.car\RESTDataService\u 1.0.0\RESTDataService-1.0.0.dbs
http://ws.wso2.org/dataservice/LoggingAPI
参数不兼容\u错误
_日志
输入参数似乎没有正确绑定。有人知道我做错了什么吗?我用MySQL创建了一个类似的数据服务,没有遇到任何问题。请你试试下面的,看看有没有变化。通过如下添加名称空间来更改负载,并尝试相同的中介
<p:_postlog xmlns:p="http://ws.wso2.org/dataservice">
<xs:Date xmlns:xs="http://ws.wso2.org/dataservice">2020-09-15 09:06:00.000</xs:Date>
<xs:Username xmlns:xs="http://ws.wso2.org/dataservice">KIRBJJ</xs:Username>
<xs:ServiceID xmlns:xs="http://ws.wso2.org/dataservice">WA233</xs:ServiceID>
</p:_postlog>
2020-09-15 09:06:00.000
基尔布吉
WA233
如果这不起作用,请启用wire logs并确认将正确的有效负载传递给数据服务
<axis2ns8:DataServiceFault xmlns:axis2ns8="http://ws.wso2.org/dataservice">
<axis2ns8:current_params>{}</axis2ns8:current_params>
<axis2ns8:source_data_service>
<axis2ns8:data_service_name>RESTLoggerDataService</axis2ns8:data_service_name>
<axis2ns8:description>Exposing the data service as a REST service.</axis2ns8:description>
<axis2ns8:location>C:\PROGRA~1\WSO2\ENTERP~1\7154FB~1.0\MICRO-~1\bin\..\tmp\carbonapps\-1234\1600263784524RestLoggerCompositeExporter_1.0.0.car\RESTDataService_1.0.0\RESTDataService-1.0.0.dbs</axis2ns8:location>
<axis2ns8:default_namespace>http://ws.wso2.org/dataservice/LoggingAPI</axis2ns8:default_namespace>
</axis2ns8:source_data_service>
<axis2ns8:ds_code>INCOMPATIBLE_PARAMETERS_ERROR</axis2ns8:ds_code>
<axis2ns8:current_request_name>_postlog</axis2ns8:current_request_name>
</axis2ns8:DataServiceFault>
<p:_postlog xmlns:p="http://ws.wso2.org/dataservice">
<xs:Date xmlns:xs="http://ws.wso2.org/dataservice">2020-09-15 09:06:00.000</xs:Date>
<xs:Username xmlns:xs="http://ws.wso2.org/dataservice">KIRBJJ</xs:Username>
<xs:ServiceID xmlns:xs="http://ws.wso2.org/dataservice">WA233</xs:ServiceID>
</p:_postlog>