cancel
Showing results for 
Search instead for 
Did you mean: 

SOAP Receiver - HTTP/1.1 500 Internal Server Error

Bhargavakrishna
Active Contributor
0 Kudos

Hi Experts,

We are using parameterized java mapping and performing SOAP (Receiver) channel lookup (To post request and get the response back).

We are passing Business system and communication channel name in the parameters tab and executing the operation mapping. Immediately the channel goes into error status.

Error Details:

Channel log:

SOAP: Response message contains an errorXIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 500 Internal Server Error

We have collected XPI_Trace with example 50 --> HTTP Trace (Full dump) and could see the below error and SOAP fault response.

08:31:49:086 The whole request message successfully sent. Receiving ...
08:31:49:092 Server responds with: HTTP/1.1 500 Internal Server Error
08:31:49:092 Response received. Reading response message ...
...
08:31:49:097 reading body <?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope xmlns:xs="<a href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</a>" xmlns:SOAP-ENV="<a href="http://schemas.xmlsoap.org/soap/envelope/">http://schemas.xmlsoap.org/soap/envelope/</a>" xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>">

<SOAP-ENV:Body>

<SOAP-ENV:Fault>

<faultcode>SOAP-ENV:Client</faultcode>

<faultstring>com.sap.SOA.wsr.030106 - No operation found using soap keys [<a href="http://schemas.xmlsoap.org/soap/envelope/">http://schemas.xmlsoap.org/soap/envelope/</a>], [Envelope], []. InterfaceMapping Object class: com.sap.engine.services.webservices.espbase.mappings.InterfaceMapping mappings: {BindingType=Soap, InterfaceMappingID=technidata.de/xem~ewis~mdata~eappl_MDMImporter_Config1Port}.</faultstring>

<detail>

<yq1:com.sap.engine.services.webservices.espbase.server.additions.exceptions.ProcessException xmlns:yq1='<a href="http://sap-j2ee-engine/client-runtime-error">http://sap-j2ee-engine/client-runtime-error</a>'>com.sap.SOA.wsr.030106 - No operation found using soap keys [<a href="http://schemas.xmlsoap.org/soap/envelope/">http://schemas.xmlsoap.org/soap/envelope/</a>], [Envelope], []. InterfaceMapping Object class: com.sap.engine.services.webservices.espbase.mappings.InterfaceMapping mappings: {BindingType=Soap, InterfaceMappingID=technidata.de/xem~ewis~mdata~eappl_MDMImporter_Config1Port}.

</yq1:com.sap.engine.services.webservices.espbase.server.additions.exceptions.ProcessException>

</detail>

</SOAP-ENV:Fault>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

Actions Performed

1) We Referred the SAP note "1737850" and created dummy ICO for SOAP channel binding.

2) Compared request payload posting to the web-service with production request payloads.

3) Telnet ping was successful from SAP PI.

4) When we test the URL from WSnavigator we got the error HTTP : 405 method not allowed.

5) HTTP 500 internal server error when posting the message using REST client to the target URL. Getting the above SOAP fault response in REST client as well.

6) In the channel, tried with SOAP Envelope / Do not use SOAP envelope as well.

Issue still persist, please help me to fix the issue.

Regards

Bhargava Krishna

Accepted Solutions (1)

Accepted Solutions (1)

vinaymittal
Contributor
0 Kudos

First thing you need to clear is if it is soap htttp or soap xi

Are you using these two functions??

accessor.setOperationName(“myInterfaceName”);

accessor.setOperationNamespace(“myInterfaceNS”);

If not use them

Bhargavakrishna
Active Contributor
0 Kudos

Hi Vinay,

Thanks for your response.

We are migrating the interfaces from SAP PI 7.31 to SAP PO 7.5.

In the Old system SAP PI 7.31, we have RFC destination of type "G" where they have maintained the "target host,service no and path prefix" and maintained this destination in the HTTP receiver communication channel in the SAP PI 7.31 system.

In the new system, we created SOAP receiver communication channel with HTTP protocol and maintained the target URL.

We formed the Target URL based on the HTTP destination

https://"Target host":"Port"/"Path prefix" (Referred the HTTP destination and formed the URL)

package com.mdm.po.map;
import java.io.*;  
import com.sap.aii.mapping.api.*;
import com.sap.aii.mapping.lookup.Channel;
import com.sap.aii.mapping.lookup.LookupService;
import com.sap.aii.mapping.lookup.Payload;
import com.sap.aii.mapping.lookup.SystemAccessor;
import com.sap.aii.mapping.lookup.XmlPayload;


public class GMDM_MaterialData_To_XEM_Mail extends AbstractTransformation {
 
  DynamicConfiguration conf; // used for dynamic configuration which is being used to create and write the files.
  InputParameters param;     // used for input parameters
  
  String businessSystem							= 	"";
  String soapChannel							= 	"";   
  String messageID								=   ""; 
  
  public void transform (TransformationInput arg0, TransformationOutput arg1)  
                        throws StreamTransformationException {


    conf 										= 	arg0.getDynamicConfiguration(); // provide dynamic configuration 
    param 										= 	arg0.getInputParameters();     // provide input parameters  
  
    try
    {
    	businessSystem	 							= 	arg0.getInputParameters().getString("BUSINESS_SYS");
    	soapChannel									= 	arg0.getInputParameters().getString("SOAP_CHANNEL");  
    }
    catch(Exception pm)
    {
  	
  	   getTrace().addInfo("Parameters are not maintained properly");
  	    
    } 
   
	InputHeader messageHeader 					= 	arg0.getInputHeader();
    messageID									= 	messageHeader.getMessageId();  
    
    getTrace().addInfo("BUSINESS_SYSTEM		Parameter: " +businessSystem);
    getTrace().addInfo("SOAP_CHANNEL 		Parameter: " +soapChannel);   
  
    
    this.execute(arg0.getInputPayload().getInputStream(), 
                 arg1.getOutputPayload().getOutputStream());


  }


  // the method "execute" is called by "transform" and "main"
  public void execute (InputStream in, OutputStream out)  
                      throws StreamTransformationException {


	  	String line							=	""; 
	  	String lineData						=	""; 
	  	String respData						=	""; 
	  	String reqData						=	""; 
	  	String finalData					=	"";   
	  	 
		try
		{
	 	 //Now read actual run time business file and handle those special chars.
			BufferedReader bin 				= new BufferedReader(new InputStreamReader(in)); 
			StringBuffer sb 				= 	new StringBuffer(); 
			
			  //reading XML line by line and appending into a string buffer.
			  while ((line = bin.readLine()) != null)
			  { 
				  	sb.append(line);   
				  	sb.append("\n");
				  	
			  }			
				  
			  String inData = sb.toString(); 
			  
			  int x 		=	inData.indexOf("<ns1:input>");
			  int y 		=	inData.indexOf("</ns1:input>")+12;
			  
			  if( (x>0) && (y>x) )
			  reqData		= 	inData.substring(x, y);
			  
			  inData		=	"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"+ "\n" +
					  			"<SOAP-ENV:Envelope xmlns:ns1=\"urn:de.technidata.mdmimporter\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
					  			"<SOAP-ENV:Body>" + inData + "</SOAP-ENV:Body></SOAP-ENV:Envelope>";
					  			
			  inData = inData.replaceAll("\\<\\?xml(.+?)\\?\\>", ""); 
			  getTrace().addInfo("HTTP Request ");
			  getTrace().addInfo(inData);
			  try
			  {
				  Channel channel = LookupService.getChannel(businessSystem,soapChannel);


				  SystemAccessor accessor = LookupService.getSystemAccessor(channel);


				 InputStream inputStream =new ByteArrayInputStream(inData.getBytes());


				  XmlPayload payload = LookupService.getXmlPayload(inputStream);


				  Payload SOAPOutPayload = null;


				  //The response will be a Payload. Parse this to get the response field out.


				  SOAPOutPayload = accessor.call(payload);


				  /* Parse the SOAPPayload to get the SOAP Response back.  


				  The conversion rate is available under the Field Name ConversionRateResult */ 


				  InputStream inp = SOAPOutPayload.getContent();  
				  
				  BufferedReader bin2 				= new BufferedReader(new InputStreamReader(inp)); 
				  StringBuffer sb2				= 	new StringBuffer(); 
					
					  //reading XML line by line and appending into a string buffer.
				  while ((lineData = bin.readLine()) != null)
					  { 
						  	sb2.append(lineData);   
						  	sb2.append("\n");				  	
					  }			
						  
				 respData = sb2.toString();
				 
				 int p 		=	respData.indexOf("<rpl:Response>");
				 int q 		=	respData.indexOf("</rpl:Response>")+15;
				 
				 if( (p>0) && (q>p) )
					 respData	= 	inData.substring(p, q);
				 
				 
				 finalData = "<?xml version=\"1.0\"?><EC_Data><EC_Request>" + reqData +
						 			"</EC_Request><EC_Response> " + respData +
						 			"</EC_Response></EC_Data>";
				 
				 finalData	=	finalData.replaceAll("ns0:", "");
				 finalData	=	finalData.replaceAll("ns1:", ""); 
				 finalData	=	finalData.replaceAll("ns2:", "");
				 finalData	=	finalData.replaceAll("ns3:", "");
				 
				 finalData	=	finalData.replaceAll("rn0:", "");
				 finalData	=	finalData.replaceAll("rn1:", "");
				 finalData	=	finalData.replaceAll("rn2:", "");
				 finalData	=	finalData.replaceAll("rn3:", "");
 
			  }
			  catch(Exception e)
			  {
				  finalData = "<?xml version=\"1.0\"?><EC_Data><EC_Request>" + reqData +
				 			"</EC_Request><EC_Response> " + 
				 			"</EC_Response></EC_Data>";
				  
				  	 finalData	=	finalData.replaceAll("ns0:", "");
					 finalData	=	finalData.replaceAll("ns1:", ""); 
					 finalData	=	finalData.replaceAll("ns2:", "");
					 finalData	=	finalData.replaceAll("ns3:", "");
					 
					 finalData	=	finalData.replaceAll("rn0:", "");
					 finalData	=	finalData.replaceAll("rn1:", "");
					 finalData	=	finalData.replaceAll("rn2:", "");
					 finalData	=	finalData.replaceAll("rn3:", "");
					 finalData	=	finalData.replaceAll("<MessageText>", "<MessageText><![CDATA[");				 
					 finalData	=	finalData.replaceAll("</MessageText>", "]]></MessageText>"); 
			  }
				
			  
			  out.write(finalData.getBytes("UTF-8"));
			  out.close();
			  out.flush(); 
			}
			  catch (Exception e)
			  { 
					e.printStackTrace();
                  
			  }


  }
 


  // the method "main" is using files for input and output
  public static void main(String[] args) {


    try {
 
      InputStream in 								= 		new FileInputStream(new File("C:\\Users\\B20013\\Desktop\\Test\\In\\material_Input.xml"));
      OutputStream out 								= 		new FileOutputStream(new File("C:\\Users\\B20013\\Desktop\\Test\\Out\\material_Output.xml"));
      GMDM_MaterialData_To_XEM_Mail myMapping 	= 		new GMDM_MaterialData_To_XEM_Mail();
      myMapping.execute(in, out);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
}
	

Answers (3)

Answers (3)

former_member190293
Active Contributor
0 Kudos

Hi!

Like it's already been mentioned above, try to set Operation name and namespace for accessor instance in your java code.

Regards, Evgeniy.

arrezende
Active Participant
0 Kudos

Hi Bhargava,

If you call this webservice using SOAP UI or some other client, do you succeed?

You say..

"1) We Referred the SAP note "1737850" and created dummy ICO for SOAP channel binding."

Did you test the ICO and succeed?

Bhargavakrishna
Active Contributor
0 Kudos

Hi Alexandre,

Thanks for your response.

I have created dummy ICO for this channel and could see the channel binding is fine when we ping the SOAP channel from communication channel monitoring.

I have also tried to send request message using the dummy ICO from RWB test tab and could see the same "HTTP - 500 internal server error".

We are getting the below response when we tried to post the messages from ARC Client.

"500 Internal Server Error"

<?xml version="1.0" encoding="UTF-8" ?>
<SOAP-ENV:Envelope>
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>javax.ejb.EJBException: ASJ.ejb.005044 (Failed in component: technidata.de/xem~ewis~mdata~eappl) Exception raised from invocation of public de.technidata.mdmimporter.MDMRetVal[] de.technidata.ejb.MDMImportBean.doImportStoffMK(de.technidata.mdmimporter.MatMonitor[]) method on bean instance de.technidata.ejb.MDMImportBean@2f3980f7 for bean technidata.de/xem~ewis~mdata~eappl*xml|technidata.de~xem~ewis~mdmimprt~ejb.jar*xml|MDMImportBean in application technidata.de/xem~ewis~mdata~eappl.; nested exception is: java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key log_msg_mat_import_started
</faultstring>
<detail>
<yq1:com.sap.engine.interfaces.webservices.runtime.RuntimeProcessException>javax.ejb.EJBException: ASJ.ejb.005044 (Failed in component: technidata.de/xem~ewis~mdata~eappl) Exception raised from invocation of public de.technidata.mdmimporter.MDMRetVal[] de.technidata.ejb.MDMImportBean.doImportStoffMK(de.technidata.mdmimporter.MatMonitor[]) method on bean instance de.technidata.ejb.MDMImportBean@2f3980f7 for bean technidata.de/xem~ewis~mdata~eappl*xml|technidata.de~xem~ewis~mdmimprt~ejb.jar*xml|MDMImportBean in application technidata.de/xem~ewis~mdata~eappl.; nested exception is: java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key log_msg_mat_import_started
</yq1:com.sap.engine.interfaces.webservices.runtime.RuntimeProcessException>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
arrezende
Active Participant
0 Kudos
I think that before doing SOAP Lookup or ICO we need to call this webservice successfully using some other client (ARC or SOAP UI for example), only after making sure the webservice is working perfectly develop this in SAP PI.

This response you are receiving seems to be some problem in the service, maybe it is some wrong field being sent or some problem in the application.

Does not the owner of this service have an example of how to consume it?

former_member190293
Active Contributor
0 Kudos

Hi Bhargava!

Did you set SOAP Action in your receiver channel?

Regards, Evgeniy.

Bhargavakrishna
Active Contributor
0 Kudos

Hi Evgeniy,

Thanks for your response.

We are not using any SOAP action.

Also tried with "Do not use SOAP Envelope" option as well, but the issue still persist.

Regards

Bhargava Krishna

former_member190293
Active Contributor
0 Kudos

Hi Bhargava!

1. Try to set SOAP Action in your receiver adapter.

2. Make sure, that WSDL, you're using, matches the recent version at receiver's side.

Regards, Evgeniy.