[英]Callling SAP PI web-service throws ADAPTER.JAVA_EXCEPTION
我正在对 SAP PI 上的 WS 进行 Java SOAP 调用。
尝试卷曲,效果很好,得到了回应。 我想念在 Java 上还有什么可以做的吗?
尝试使用代码我得到以下响应:
<?xml version='1.0'?>
<!-- see the documentation -->
<SOAP:Envelope xmlns:SOAP='http://schemas.xmlsoap.org/soap/envelope/'>
<SOAP:Body>
<SOAP:Fault>
<faultcode>SOAP:Server</faultcode>
<faultstring>Server Error</faultstring>
<detail>
<s:SystemError xmlns:s='http://sap.com/xi/WebService/xi2.0'>
<context>XIAdapter</context>
<code>ADAPTER.JAVA_EXCEPTION</code>
<text><![CDATA[
See log trace with id: n/a
]]></text>
</s:SystemError>
</detail>
</SOAP:Fault>
</SOAP:Body>
</SOAP:Envelope>
这是Java代码
String body = "body xml and validated ";
StringEntity stringEntity = new StringEntity(body, "UTF-8");
stringEntity.setChunked(true);
String soapAction = "ActionOut";
HttpPost httpPost = new HttpPost("http://x.x.x.x:50000/XISOAPAdapter/MessageServlet?senderParty=&senderService=BSY_IBMMDM_T&receiverParty=&receiverService=&interface=ActionOut&interfaceNamespace=urn:yyyy.com:IBMMDM:AdobeForms");
UsernamePasswordCredentials creds = new UsernamePasswordCredentials("usr", "psw");
httpPost.addHeader(new BasicScheme().authenticate(creds, httpPost, null));
httpPost.setEntity(stringEntity);
httpPost.addHeader("Accept", "text/xml; charset=utf-8");
httpPost.addHeader("SOAPAction", soapAction);
// Execute and get the response.
HttpClient httpClient = new DefaultHttpClient();
HttpResponse response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity();
您需要验证原始数据中是否有任何特殊字符。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.