Вызовите веб-службу SAP PI SOAP из Java, выбрасывает ADAPTER.JAVA_EXCEPTION - PullRequest
0 голосов
/ 09 января 2020

я совершаю java soap вызов WS на SAP.

Пробовал с завитком (на машине), и он работал хорошо, получая ответ. Есть ли что-то, что можно сделать с 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();
...