cancel
Showing results for 
Search instead for 
Did you mean: 

Receiver SOAP Adapter - Error

Former Member
0 Kudos

Hi Guys,

I am facing the following error. My async scenario is File -> To -> SOAP.

Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: SOAP: response message contains an error XIAdapter/PARSING/ADAPTER.SOAP_EXCEPTION - soap fault: System.Web.Services.Protocols.SoapException: Possible SOAP version mismatch: Envelope namespace http://schemas.xmlsoap.org/soap/envelope/ was unexpected. Expecting http://www.w3.org/2003/05/soap-envelope.   at System.Web.Services.Protocols.SoapServerProtocol.CheckHelperVersion()   at System.Web.Services.Protocols.SoapServerProtocol.Initialize()   at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)

i read some theads about this error, but i can`t solve this problem.

The print screen of communication channel configurations is attached:

Can you help me?

Regards,

Douglas Figueiredo

Accepted Solutions (1)

Accepted Solutions (1)

former_member184681
Active Contributor
0 Kudos

Hi,

Let me give you few ideas as a check list for most popular mistakes with receiver SOAP scenario:

1. Since you are building a SOAP Envelope on your own, you should definitely mark "Do Not Use SOAP Envelope" in the receiver Communication Channel. Make sure you leave this marked.

2. For the URL in the receiver CC, are you using exactly the same value as the one that shows up in SOAP UI where you perform a successful test? Based on the HTTP 500 error that you received recently, I assume those URLs will not be identical, so just change the one in CC and the scenario should work fine.

3. If still no luck, try testing from SOAP UI with exactly the same message payload as sent by PI (mentioned above) - what is the result?

Hope this helps,

Greg

Former Member
0 Kudos

Hi Grzegorz,

1 - The option "Do Not Use SOAP" Envelope is checked.

2 - I copied URL from SOAP UI and pasted in Communication Channel.

3 - Now I did this test and the same error is happening. I don`t have the request payload. I am using the TCPGateway to get the request message.

Thanks for your reply.

Douglas Figueiredo

former_member184681
Active Contributor
0 Kudos

Dear Douglas,

I'm not sure if I got your point about #3. Simply use the payload taken from TCP Gateway to SOAP UI to perform an identical test from there, as you do it from PI. Is the result identical then? If yes, then you can suspect some problem with the receiver system. If it works properly from SOAP UI, then at least you confirm that this is a problem with PI configuration.

You can also capture the call from SOAP UI with TCP GW and compare these two, including HTTP headers - maybe you will locate the source of the problem thanks to that.

Hope this helps,

Greg

Answers (1)

Answers (1)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Check with target system that what SOAP version they use?  SOAP Axis adapter supports both 1.1 and 1.2.  This is version conflicts between soap version what adapter using in PI and the targtet side. If the problem exists, another option is create soap envelope using mapping and use HTTP adapter.

Former Member
0 Kudos

Hi Baskar,

Thanks for quick response.

The soap version is 1.2.

I configured the communication channel with Http (axis) Soap 1.2.

Error:

Message processing failed. Cause: javax.ejb.TransactionRolledbackLocalException: (Failed in component: sap.com/com.sap.aii.axis.app, BC-XI-CON-AFW-TAD) Exception raised from invocation of public com.sap.aii.af.lib.mp.module.ModuleData com.sap.aii.adapter.axis.modules.AFAdapterBean.process(com.sap.aii.af.lib.mp.module.ModuleContext,com.sap.aii.af.lib.mp.module.ModuleData) throws com.sap.aii.af.lib.mp.module.ModuleException method on bean instance com.sap.aii.adapter.axis.modules.AFAdapterBean@2ea6d166 for bean sap.com/com.sap.aii.axis.app*xml|com.sap.aii.adapter.axis.ejb.jar*xml|AFAdapterBean in application sap.com/com.sap.aii.axis.app.; nested exception is: java.lang.NullPointerException; nested exception is: javax.ejb.EJBException: (Failed in component: sap.com/com.sap.aii.axis.app, BC-XI-CON-AFW-TAD) Exception raised from invocation of public com.sap.aii.af.lib.mp.module.ModuleData com.sap.aii.adapter.axis.modules.AFAdapterBean.process(com.sap.aii.af.lib.mp.module.ModuleContext,com.sap.aii.af.lib.mp.module.ModuleData) throws com.sap.aii.af.lib.mp.module.ModuleException method on bean instance com.sap.aii.adapter.axis.modules.AFAdapterBean@2ea6d166 for bean sap.com/com.sap.aii.axis.app*xml|com.sap.aii.adapter.axis.ejb.jar*xml|AFAdapterBean in application sap.com/com.sap.aii.axis.app.; nested exception is: java.lang.NullPointerException; nested exception is: javax.ejb.EJBTransactionRolledbackException: (Failed in component: sap.com/com.sap.aii.axis.app, BC-XI-CON-AFW-TAD) Exception raised from invocation of public com.sap.aii.af.lib.mp.module.ModuleData com.sap.aii.adapter.axis.modules.AFAdapterBean.process(com.sap.aii.af.lib.mp.module.ModuleContext,com.sap.aii.af.lib.mp.module.ModuleData) throws com.sap.aii.af.lib.mp.module.ModuleException method on bean instance com.sap.aii.adapter.axis.modules.AFAdapterBean@2ea6d166 for bean sap.com/com.sap.aii.axis.app*xml|com.sap.aii.adapter.axis.ejb.jar*xml|AFAdapterBean in application sap.com/com.sap.aii.axis.app.; nested exception is: java.lang.NullPointerException; nested exception is: javax.ejb.EJBException: (Failed in component: sap.com/com.sap.aii.axis.app, BC-XI-CON-AFW-TAD) Exception raised from invocation of public com.sap.aii.af.lib.mp.module.ModuleData com.sap.aii.adapter.axis.modules.AFAdapterBean.process(com.sap.aii.af.lib.mp.module.ModuleContext,com.sap.aii.af.lib.mp.module.ModuleData) throws com.sap.aii.af.lib.mp.module.ModuleException method on bean instance com.sap.aii.adapter.axis.modules.AFAdapterBean@2ea6d166 for bean sap.com/com.sap.aii.axis.app*xml|com.sap.aii.adapter.axis.ejb.jar*xml|AFAdapterBean in application sap.com/com.sap.aii.axis.app.; nested exception is: java.lang.NullPointerException

The configuration of communication channel is attahched.

Thanks again,

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>>APTER.SOAP_EXCEPTION - soap fault: System.Web.Services.Protocols.SoapException: Possible SOAP version mismatch: Envelope namespace http://schemas.xmlsoap.org/soap/envelope/ was unexpected. Expectinghttp://www.w3.org/2003/05/soap-envelope.  

another possible solution is to remove unwanted namespace and provide the expected namespace using XSLT mapping or java mapping.

Former Member
0 Kudos

Hi Baskar,  thanks for yours replies.

This i the source code. I replaced the user and password to XX.

/*

* Created on 02/02/2012

*

* To change the template for this generated file go to

* Window>Preferences>Java>Code Generation>Code and Comments

*/

package com.damyller.br.mapping;

import java.io.File;

import java.io.FileInputStream;

import java.io.FileOutputStream;

import java.io.IOException;

import java.io.InputStream;

import java.io.OutputStream;

import java.util.HashMap;

import java.util.Map;

import javax.xml.parsers.DocumentBuilder;

import javax.xml.parsers.DocumentBuilderFactory;

import javax.xml.parsers.ParserConfigurationException;

import javax.xml.transform.Transformer;

import javax.xml.transform.TransformerFactory;

import javax.xml.transform.dom.DOMSource;

import javax.xml.transform.stream.StreamResult;

import org.w3c.dom.Document;

import org.w3c.dom.Element;

import org.w3c.dom.Node;

import org.w3c.dom.NodeList;

import org.w3c.dom.Text;

import org.xml.sax.SAXException;

import com.sap.aii.mapping.api.AbstractTrace;

import com.sap.aii.mapping.api.DynamicConfiguration;

import com.sap.aii.mapping.api.DynamicConfigurationKey;

import com.sap.aii.mapping.api.StreamTransformation;

import com.sap.aii.mapping.api.StreamTransformationConstants;

import com.sap.aii.mapping.api.StreamTransformationException;

/**

* @author USER

*

* To change the template for this generated type comment go to

* Window>Preferences>Java>Code Generation>Code and Comments

*/

public class WsAlagoasReq implements StreamTransformation

{

          private Map param;

          private AbstractTrace trace;

          private Document docSaida;

          public static void main(String args[])

          {

  try

                    {

                              InputStream in = new FileInputStream(new File("c:/in.xml"));

                              OutputStream out = new FileOutputStream(new File("C:/saidaParaWS_Alagoas.xml"));

                              (new WsAlagoasReq()).execute(in, out);

                    }

                    catch (Exception e)

                    {

                              System.err.println("Main Exception -> " + e.getMessage());

                    }

          }

          public void log(String msg, boolean server)

          {

                    if (server)

                    {

                              trace = (AbstractTrace) param.get(StreamTransformationConstants.MAPPING_TRACE);

                              trace.addInfo("DEBUG -> " + msg);

                    }

  else

                    {

                              System.out.println("DEBUG -> " + msg);

                    }

          }

          public void execute(InputStream inputStream, OutputStream outputStream) throws StreamTransformationException

          {

                    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();

                    DocumentBuilder db;

                    boolean server = false;

  try

                    {

  this.log("Inicio Java Mapping ... ", server);

                              db = dbf.newDocumentBuilder();

                              Document docIn = db.parse(inputStream);

                              docSaida = db.newDocument();

  //FileName

                              DynamicConfiguration dynamicconfiguration = (DynamicConfiguration)param.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

                              DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");

                              String strFileName = dynamicconfiguration.get(key);

                              /*

                               * <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ws="http://nfa.sefaz.al.gov.br/nfa/ws/">

                              <soap:Header>

                              <ws:Autenticacao Usuario="?" Senha="?" CNPJ="?" CategoriaUsuario="?"/>

                              </soap:Header>

                              <soap:Body>

                              <ws:Enviar>

                              <!--Optional:-->

                              <ws:NomeArquivo>?</ws:NomeArquivo>

                              <!--Optional:-->

                              <ws:ConteudoArquivo>?</ws:ConteudoArquivo>

                              <ws:EnvioNormal>?</ws:EnvioNormal>

                              <!--Optional:-->

                              <ws:Observacoes>?</ws:Observacoes>

                              </ws:Enviar>

                              </soap:Body>

                              </soap:Envelope>

                               * */

  //Inicio Envelope

 

                              Element root = docSaida.createElement("soap12:Envelope");

                              root.setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");

                              root.setAttribute("xmlns:xsd", "http://www.w3.org/2001/XMLSchema");

                              root.setAttribute("xmlns:soap12", "http://www.w3.org/2003/05/soap-envelope");

 

 

  //Cabeçalho

                              Element elmHeader = docSaida.createElement("soap12:Header");

                              Element elmAutenticacao = docSaida.createElement("Autenticacao");

                              String strCnpj = this.getCnpj(docIn);

                              String strUser = null;

                              String strSenha = null;

                              if (strCnpj != null && strCnpj.equalsIgnoreCase("XX"))

                              {

  //Filial 46

                                        strUser = "XX";

                                        strSenha = "XX";

                              }

                              else if (strCnpj != null && strCnpj.equalsIgnoreCase("XX"))

                              {

  //Filial 94

                                        strUser = "XXX";

                                        strSenha = "XX";

                              }

                              elmAutenticacao.setAttribute("Usuario", strUser);

                              elmAutenticacao.setAttribute("Senha", strSenha);

                              elmAutenticacao.setAttribute("CNPJ", strCnpj);

                              elmAutenticacao.setAttribute("CategoriaUsuario", "1");

                              elmAutenticacao.setAttribute("xmlns", "http://nfa.sefaz.al.gov.br/nfa/");

                              elmHeader.appendChild((Node) elmAutenticacao);

                              root.appendChild(elmHeader);

  //Fim Cabeçalho

  //Inicio Body

                              Element elmBody = docSaida.createElement("soap12:Body");

                              Element elmEnviar = docSaida.createElement("Enviar");

                              elmEnviar.setAttribute("xmlns", "http://nfa.sefaz.al.gov.br/nfa/");

 

                              Element elmNomeArquivo = docSaida.createElement("NomeArquivo");

                              Text vlrNomeArquivo = docSaida.createTextNode(strFileName != null ? strFileName : "");

                              elmNomeArquivo.appendChild(vlrNomeArquivo);

 

                              Element elmConteudoArquivo = docSaida.createElement("ConteudoArquivo");

                              String strConteudoArquivo = this.buscaValorTagRow("row", "Content", docIn);

                              strConteudoArquivo = "teste";

                              Text vlrConteudoArquivo = docSaida.createTextNode(strConteudoArquivo);

                              elmConteudoArquivo.appendChild(vlrConteudoArquivo);

                              Element elmEnvioNormal = docSaida.createElement("EnvioNormal");

                              Text vlrEnvioNormal = docSaida.createTextNode("false");

                              elmEnvioNormal.appendChild(vlrEnvioNormal);

                              Element elmObservacoes = docSaida.createElement("Observacoes");

                              Text vlrObservacoes = docSaida.createTextNode("");

                              elmObservacoes.appendChild(vlrObservacoes);

                              elmEnviar.appendChild(elmNomeArquivo);

                              elmEnviar.appendChild(elmConteudoArquivo);

                              elmEnviar.appendChild(elmEnvioNormal);

                              elmEnviar.appendChild(elmObservacoes);

                              elmBody.appendChild(elmEnviar);

                              root.appendChild(elmBody);

                              docSaida.appendChild(root);

                              TransformerFactory tFactory = TransformerFactory.newInstance();

                              Transformer transformer = tFactory.newTransformer();

                              DOMSource source = new DOMSource(docSaida);

                              StreamResult result = new StreamResult(outputStream);

                              transformer.transform(source, result);

  this.log("FIM Java Mapping de chamada Webservice.", server);

                    }

                    catch (SAXException e1)

                    {

                              this.log("SAXException ->" + e1.getMessage(), server);

                    }

                    catch (IOException e1)

                    {

                              this.log("IOException ->" + e1.getMessage(), server);

                    }

                    catch (ParserConfigurationException e1)

                    {

                              this.log("ParserConfigurationException ->" + e1.getMessage(), server);

                    }

                    catch (Exception e1)

                    {

                              this.log("Exception ->" + e1.getMessage(), server);

                    }

          }

          public String getCnpj(Document docIn)

          {

                    String strReturn = null;

                    NodeList nl = docIn.getElementsByTagName("content");

                    if (nl != null)

                    {

                              for (int i = 0; i < nl.getLength(); i++)

                              {

                                        Node ndRow = nl.item(i);

                                        if (ndRow != null)

                                        {

                                                  String strNdRow = ndRow.getFirstChild().getNodeValue();

                                                  System.out.println("strNdRow = " + strNdRow);

                                                  if (strNdRow != null && strNdRow.trim().length() > 111 && strNdRow.substring(0, 3).equalsIgnoreCase("E01"))

                                                  {

                                                            return strNdRow.substring(98, 112);

                                                  }

                                        }

                              }

                    }

  return null;

          }

          public void setParameter(Map param)

          {

                    this.param = param;

                    if (param == null)

                    {

                              this.param = new HashMap();

                    }

          }

          public String buscaValorDaTag(String strTag, Document docIn)

          {

                    String strReturn = null;

                    NodeList nl = docIn.getElementsByTagName(strTag);

                    if (nl.getLength() > 0)

                    {

                              Node nd = nl.item(0);

                              if (nd != null)

                              {

                                        Node firstNode = nd.getFirstChild();

                                        if (firstNode != null)

                                        {

                                                  strReturn = firstNode.getNodeValue();

                                        }

                              }

                    }

                    System.out.println("buscaValorDaTag -> Tag -> " + strTag + " - strReturn = " + strReturn);

                    return strReturn;

          }

          public String buscaValorTagRow(String strRow, String strTag, Document docIn)

          {

                    String strReturn = null;

                    NodeList nl = docIn.getElementsByTagName(strRow);

                    StringBuffer sb = new StringBuffer();

                    if (nl.getLength() > 0)

                    {

                              for (int i = 0; i < nl.getLength(); i++)

                              {

                                        Node ndRow = nl.item(i);

                                        if (ndRow != null)

                                        {

                                                  NodeList nlRowChilds = ndRow.getChildNodes();

                                                  if (nlRowChilds != null)

                                                  {

                                                            for (int j = 0; j < nlRowChilds.getLength(); j++)

                                                            {

                                                                      Node ndContent = nlRowChilds.item(j);

                                                                      if (ndContent != null && ndContent.getNodeName().equalsIgnoreCase(strTag))

                                                                      {

                                                                                sb.append(ndContent.getFirstChild().getNodeValue());

                                                                      }

                                                            }

                                                  }

                                        }

                              }

                    }

                    strReturn = sb.toString();

                    System.out.println("buscaValorDaTag -> Tag -> " + strTag + " - strReturn = " + strReturn);

                    return strReturn;

          }

}

This error is happening in response message, because in the RWB was showed:

error in response.

former_member184681
Active Contributor
0 Kudos

Hi,

Make sure this namespace http://schemas.xmlsoap.org/soap/envelope/ is not defined in one of your Service Interfaces, it could be appended somehow then. You can take the message payload and xsd for the receiver structure from PI and validate one against the other in one of the online tools, for instance here: http://schneegans.de/sv/.

Hope this helps,

Greg

baskar_gopalakrishnan2
Active Contributor
0 Kudos

SInce the scenario is sync, we might have to take care the soap version mismatch both during request and response. Few cents. Currently seems that request goes well and during response soap communication channel interprets mismatch in the response. You use stacktrace everywhere in the code to see the log traces deeply.

Example:

try{

// Your logic here

}catch(Exception e){

  e.printStackTrace();

}

Former Member
0 Kudos

where do you want i make this code??

Adapter Module in soap receiver adapter or Java Mapping in response message?

if i java mapping, the problem is: I think, this java mapping is not executing, because the message is stopped in communication channel.

thanks

Former Member
0 Kudos

Hi,

If i check Do Not Use SOAP Envelope, in SOAP Receiver adapter, this error is showed:

Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 500 Internal Server Error

I tried with SOAP UI tool and the response of webservice is:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

   <soap:Body>

      <EnviarResponse xmlns="http://nfa.sefaz.al.gov.br/nfa/ws/">

         <EnviarResult>15/03/2012 15:33:16|0000000000000000000|225|Arquivo inválido.</EnviarResult>

      </EnviarResponse>

   </soap:Body>

</soap:Envelope>

Thanks for yours replies.

Former Member
0 Kudos

HI Guys, more informantions...

I used TCPGateway tool and found the response message from webservice.

version: 1.0.1503

==============

Listen Port: 54000

Target Host:

Target Port: 80

==== Request ====

POST /nfa/ws/arquivocf.asmx HTTP/1.0

Accept: */*

Host: pvmpidev1:54000

User-Agent: SAP-Messaging-com.sap.aii.af.sdk.xi/1.0505

CallingType: SJM

content-id: <payload-d41820736fa611e1c327000011fa3cda@sap.com>

content-type: application/xml

Content-Length: 502

SOAPACTION: "http://nfa.sefaz.al.gov.br/nfa/ws/Enviar"

<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ws="http://nfa.sefaz.al.gov.br/nfa/ws/"><soap:Header><ws:Autenticacao CNPJ="XX" CategoriaUsuario="1" Senha="X" Usuario="X"/></soap:Header><soap:Body><ws:Enviar><ws:NomeArquivo>BE626444.1AB</ws:NomeArquivo><ws:ConteudoArquivo>teste</ws:ConteudoArquivo><ws:EnvioNormal>false</ws:EnvioNormal><ws:ObservacoesS></ws:ObservacoesS></ws:Enviar></soap:Body></soap:Envelope>

==== Response ====

HTTP/1.1 500 Internal Server Error

Via: 1.1 ISASERVER1

Connection: close

Proxy-Connection: close

Content-Length: 1208

Date: Fri, 16 Mar 2012 20:30:39 GMT

Content-Type: text/html

Server: Microsoft-IIS/7.0

X-Powered-By: ASP.NET

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>

<title>500 - Internal server error.</title>

<style type="text/css">

<!--

body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}

fieldset{padding:0 15px 10px 15px;}

h1{font-size:2.4em;margin:0;color:#FFF;}

h2{font-size:1.7em;margin:0;color:#CC0000;}

h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}

#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;

background-color:#555555;}

#content{margin:0 0 0 2%;position:relative;}

.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}

-->

</style>

</head>

<body>

<div id="header"><h1>Server Error</h1></div>

<div id="content">

<div class="content-container"><fieldset>

  <h2>500 - Internal server error.</h2>

  <h3>There is a problem with the resource you are looking for, and it cannot be displayed.</h3>

</fieldset></div>

</div>

</body>

</html>

==============

who can help me?

Thanks