在没有部署接收方的SSL证书之前,得到错误:
Peer certificate rejected by ChainVerifier。
在导入SSL证书链(一共三个)并重启SSL provider之后,这个错误没有了,不过却得到另一个错误:
Failed to call the endpoint: Error in call over HTTP: HTTP 400 Bad Request
SOAP: call failed: java.io.IOException: invalid content type for SOAP: TEXT/HTML; HTTP 400 Bad Request
SOAP: error occured: com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.io.IOException: invalid content type for SOAP: TEXT/HTML; HTTP 400 Bad Request
MP: exception caught with cause com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.io.IOException: invalid content type for SOAP: TEXT/HTML; HTTP 400 Bad Request
尝试修改SOAP adapter指向测试环境的接收方和相应的用户名+密码,一切正常。在SAP PI的测试环境下发送数据到接收方的生产环境,得到的错误与上面一样。可是用SOAP UI 4.51却能正常发送同样payload的数据到接收方。
正常工作:
SAP PI QA --> Receiver QA
SAP PI Prod --> Receiver QA
SOAP UI --> Receiver Prod
不能工作:
SAP PI QA --> Receiver Prod
SAP PI Prod --> Receiver Prod
查看了SOAP FAQ note 856597,里面提到:
For SOAP adapter initialization problem, component com.sap.aii.af.mp.soap must be set to DEBUG. For runtime problem, additionally component com.sap.aii.messaging must be set to DEBUG.可是找半天却不知如何设置com.sap.aii.af.mp.soap和com.sap.aii.messaging成DEBUG模式。网上提到的多是使用visual adaministrator,适用于低一点版本的PI。
自己无法设置tcp gateway去查看SOAP请求,请求接收方安装了一个程序来查看SOAP adapter发出的请求,发现了问题的原因。接收方返回的应答是:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>400 Bad Request</title>
</head>
<body>
<h1>Bad Request</h1>
<p>
Your browser sent a request that this server could not understand.
<br />
Request header field is missing ':' separator.
<br />
<pre>OA==</pre>
</p>
<hr>
<address>Apache/2.2.16 (Debian) Server at hostname Port 443</address>
</body>
</html>
查看HTTP的头:
User-Agent: SAP-Messaging-com.sap.aii.af.sdk.xi/1.0505
CallingType: SJM
Authorization: Basic c3RuX2FwL3N0bl9hcF9pbnRlZ3JhdGlvbjo1Zjg1MTljNzk4NjQ0YjI0OGZiOTFkY2ZkY2VjNDBk
OA==
在Authorization这个字段,值因为太长被错误地截断了,变成了两行,导致请求无法被接收方服务器接受。
SAP note 1153210提到了类似的问题:
The base64 encoding was implemented according to rfc2045, where there is a
limitation on line length. So the encoded user:password string has been
separated by a CRLF chars and this breaks the request
没有评论:
发表评论