on 01-29-2007 4:39 PM
Hello, All,
I created a SOAP-XI-SAP scenario.When I actually send my message, it did nothing. I checked communication channel monitoring. It says "Channel started but inactive". I checked all the configuration and found no error. I used HttpURLConnection to post soap message to XI through SOAP and I did not caught any error (exceptions). Could anyone give me some ideas? Any usful answers will be awarded. Thanks!
Meiying
Hi,
This blog may help u-
/people/siva.maranani/blog/2005/09/03/invoke-webservices-using-sapxi
if you are posting the payload dierctly into Integration Engine Pipeline, then no need of SOAP sender adapter, you can directly post via http client code.
hope this helps,
rgds,
moorthy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Are you keeping any xml tags like <?xml version="1.0" encoding="UTF-8" ?> before the below mentioned payload..if you are keeping it remove it and send it once again.
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:n1="http://www.w3.org/2001/XMLSchema-instance" n1:schemaLocation="http://schemas.xmlsoap.org/soap/envelope/ C:\sample.xsd">
<SOAP-ENV:Body>
<ns1:MeiyingTest_mt xmlns:ns1="http://olemiss.edu/XI/MEIYINGTEST">
<empid school="OLEMISS">1</empid>
<emp.name>M</emp.name>
<empage>7</empage>
<flag>Y</flag>
</ns1:MeiyingTest_mt>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Amaresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
How you are sending the payload... can you post the sample data the XML file which you are sending...so that i may be figure it ..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes. Sure.
Here is my sample XML file:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:n1="http://www.w3.org/2001/XMLSchema-instance" n1:schemaLocation="http://schemas.xmlsoap.org/soap/envelope/ C:sample.xsd">
<SOAP-ENV:Body>
<ns1:MeiyingTest_mt xmlns:ns1="http://olemiss.edu/XI/MEIYINGTEST">
<empid school="OLEMISS">1</empid>
<emp.name>M</emp.name>
<empage>7</empage>
<flag>Y</flag>
</ns1:MeiyingTest_mt>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Here is my sample Java program to send that XML file to XI through SOAP adapter.
public class testMessage {
public static void main(String[] args) {
String SOAPUrl =
"http://testpid.edu:51500/XISOAPAdapter/MessageServlet"
+ "?channel=:FaDisb:MeiyingTestSoap";
String xmlFile2Send = "c:/sample.xml";
String SOAPAction = "";
if (args.length > 2)
SOAPAction = args[2];
try {
// Create the connection where we're going to send the file.
URL url = new URL(SOAPUrl);
URLConnection connection = url.openConnection();
HttpURLConnection httpConn = (HttpURLConnection) connection;
// Open the input file. After we copy it to a byte array, we can see
// how big it is so that we can set the HTTP Cotent-Length
// property. (See complete e-mail below for more on this.)
FileInputStream fin = new FileInputStream(xmlFile2Send);
ByteArrayOutputStream bout = new ByteArrayOutputStream();
// Copy the SOAP file to the open connection.
copy(fin,bout);
fin.close();
byte[] b = bout.toByteArray();
// Set the appropriate HTTP parameters.
httpConn.setRequestProperty( "Content-Length",
String.valueOf( b.length ) );
httpConn.setRequestProperty("Content-Type","text/xml; charset=utf-8");
httpConn.setRequestProperty("SOAPAction",SOAPAction);
httpConn.setRequestMethod( "POST" );
httpConn.setDoOutput(true);
// Everything's set up; send the XML that was read in to b.
OutputStream out = httpConn.getOutputStream();
out.write( b );
out.close();
}catch (MalformedURLException ex) {
error ("Bad URL");}
catch (UnknownServiceException ex) {
error ("UnknownServiceException occurred.");
} catch (IOException ex) {
error ("IOException occurred.");
}
// copy method from From E.R. Harold's book "Java I/O"
public static void copy(InputStream in, OutputStream out)
throws IOException {
// do not allow other threads to read from the
// input or write to the output while copying is
// taking place
synchronized (in) {
synchronized (out) {
byte[] buffer = new byte[256];
while (true) {
int bytesRead = in.read(buffer);
if (bytesRead == -1) break;
out.write(buffer, 0, bytesRead);
}
}
}
}
public static void error (String s) {
System.out.println (s);
System.exit (1);
}
}
But it seems nothing been sent out and I did not get error (exeption). Thanks for look at it.
Meiying
Hi,
If you are not using WSDL, then You can use HTTP Client, where you can send the message, without WSDL to the R/3...and after sending the payload message through it you can test in the message monitoring to figure out the exact problem
Amaresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yang,
Can you download any SOAP client like SOAPScope or Altova XML SPY etc and send the request to server.
I think your WSDL is having some problem. So it is the reason why it is not coming into XI.
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Satish,
Thank you very much for the quick response. But I don't use WSDL to send message. I use direct URL ("http://testpid.olemiss.edu:51500/XISOAPAdapter/MessageServlet"
+ "?channel=:FaDisb:MeiyingTestSoap) and HttpURLConnection to send out a XML file (SOAP message) to XI. My java client code is something like this:
URL url = new URL(SOAPUrl);
URLConnection connection = url.openConnection();
HttpURLConnection httpConn = (HttpURLConnection) connection;
httpConn.setRequestMethod( "POST" );
httpConn.setDoOutput(true);
OutputStream out = httpConn.getOutputStream();
out.write( b );
out.close();
Thanks!
Meiying
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.