Skip to Content
0

Soap Lookup to BRM brings empty response

Feb 02 at 07:49 PM

33

avatar image
Former Member

Hi SCN users,

I am trying to do a SOAP Lookup from PI 7.5 to BRM and receive an empty response. If I test from SOAPUI, I get valid response with output field populated. The code that I used is as below:

SystemAccessor accessor = null;

String Hike = "";

StringBuffer sb = new StringBuffer();

try{

// 1. Get the system accessor for the channel.

accessor = LookupService.getSystemAccessor(soapEmpHike);

// 2. Build request.

InputStream reqStream;

String reqString = " "+ " http://www.sap.com\">"+ " urn://crestron.com/POC/BRM\">" + " " + Region + " " + " " + Grade + " " + " " + " ";

reqStream = (InputStream) new ByteArrayInputStream(reqString.getBytes());

XmlPayload reqPayload = LookupService.getXmlPayload(reqStream);

// 3. Call BRM

XmlPayload resPayload = (XmlPayload)accessor.call(reqPayload);

// 4. Parse result byte[] b = new byte[4096];

for (int n; (n = resPayload.getContent().read(b))!= -1;) {

sb.append(new String(b,0,n));

}

container.getTrace().addWarning(sb.toString());

int i = sb.indexOf("<Hike>") + 6;

int j = sb.indexOf("</Hike>");

Hike = sb.substring(i,j);

}

catch (Exception e){

// TODO Auto-generated catch block e.printStackTrace();

}

finally {

// 5. Close the accessor in order to free resources.

if (accessor != null) accessor.close();

}

return Hike;

If I call the same BRM from SOAPUI, I get the response with Hike populated per the rules. When I see the BRM logs, there are entries like, Rule invocation started, Rule fired, Rule invocation completed.

But in case of PI test, I only get Rule Invocation Started and Rule invocation completed. Rule Fired step is missing.

Thanks,

Vijita

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers