调用SAP PI web服务引发ADAPTER.JAVA_异常

调用SAP PI web服务引发ADAPTER.JAVA_异常,java,soap,sap,sap-xi,sap-pi,Java,Soap,Sap,Sap Xi,Sap Pi,我正在对sappi上的WS进行javasoap调用 试着卷发,效果很好,得到了回应。 在Java方面还有什么我想做的吗? 尝试使用代码时,我得到以下响应: <?xml version='1.0'?> <!-- see the documentation --> <SOAP:Envelope xmlns:SOAP='http://schemas.xmlsoap.org/soap/envelope/'> <SOAP:Body> <SO

我正在对sappi上的WS进行javasoap调用

试着卷发,效果很好,得到了回应。 在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();

显然,您没有发送与CURL相同的HTTP请求,因此请至少发布CURL,以便人们可以告诉您在java中的不同做法。您的CURL在哪里?如何进行身份验证?似乎auth-issue
这里最可靠的调试方法是检查它的建议(PI-trace),而不是阅读tea-leavesHello,谢谢你的回答。问题是WSDL不符合XML调用。PI由我管理,我只是向它发送请求,但没有访问权限。我结束这个问题。另外,setContentType(“application/xml”);java代码中需要的。@DanieleO如果您解决了问题,建议将解决方案作为答案发布,然后接受它。然后问题将被清楚地标记为已解决。