webservice接口访问sap报错:Response was of unexpected text/html ContentType

报错详情:

org.apache.cxf.interceptor.fault create breakpoint :Response was of unexpected text/html contenttype. Incoming portion of html stream:Internal server error.

采用cxf框架实现webservice接口访问sap端服务器时,报错。之前怀疑是服务器端没有写好,采用SoapUI进行测试发现没问题。

说明一下,这个接口中传入了三个String类型的参数,前两个是时间,最后一个值我希望查询到为空的条目,于是我传了一个空值("2022-05-06","2022-05-07","")

这里有两点要注意的1.sap的date类型接收的值要用“-”分隔的日期 ;2.Java端传输空值要用null 而不是""   这两个地方出错都会导致Java端编译时报上述错误会,无法成功调用sap端接口。

解决了一下午,在此记录一下,引以为戒

最终解决方法:将第三个参数的传值"",改为null 报错得以解决。

猜你喜欢

转载自blog.csdn.net/SAPmatinal/article/details/131712593