cancel
Showing results for 
Search instead for 
Did you mean: 

SOAP Lookup Value is not coming in the output Payload...

Former Member
0 Kudos

Hi,

I created a Soap lookup UDF in my Mapping program for that I created a SOAP Receiver and passing the value and getting the values using this webservice.

In the lookup I am using the Sender Constant function this to get the Business system name and passing this in the LookupService.getChannel(Business_System, "CC_SOAP:);

Once I run the interface and I am not able to see the webservice values in the payload. How I need to troubleshoot this to know the webservice is giving the value or not.

Is there any way to trace step by step troubleshoot the webservice to catch th data.

Thanks,

Jane F.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Jane,

The way you build the SOAPXml String looks "suspicious" to me ... Could you add a trace.addDebugMessage("SOAPXml = '" + SOAPXml + "'", trace); so we can get its actual value before sending it to the channel ?

It should contain the SOAP message, matching the expected input structure ...

Rgds

Chris

Edited by: Christophe PFERTZEL on Jan 12, 2010 12:06 PM

Former Member
0 Kudos

Chirsto,

Can you add the code in to my above lookup program and past it I will use this and see it works.

Thanks,

Jane F.

Former Member
0 Kudos

Jane,

Just before the line :

InputStream inputStream = new ...

add

trace.addDebugMessage("XML payload = '" + SOAPxml + "'");

compile and test the mapping (set the trace level to debug before), so you should see the msg and the SOAPxml value in the debug popup ...

Let us know what you got then

Chris

PS: could you also give us the expected SOAP request&response structures (according to the WDSL) ?

Edited by: Christophe PFERTZEL on Jan 12, 2010 2:39 PM

Former Member
0 Kudos

Hello Christo,

I am new to this lookups and let me know I added the code in the UDF and how I need to test this in the mapping area.

Thanks,

Jane F.

Former Member
0 Kudos

Jane,

Once you've added the line, and saved the UDF, switch to the "test" tab of the message or interface mapping object ! Provide the input structure, and test it with the trace level set to "debug", you should see a popup with the msg we've added in the code

Chris

PS: please give us the input and output structures for your SOAP lookup (according to the WSDL), this will help us to give you the SOAPxml string content...

Edited by: Christophe PFERTZEL on Jan 12, 2010 3:33 PM

Former Member
0 Kudos

Hi Chirsto,

In my case I am using CCBPM and for the MM's test tab I can't test this. Is there any other way to test this interface.

Where this needs to be set in the PI system. trace level set to "debug"????

Thanks,

Jane F.

Former Member
0 Kudos

Jane

Where is the lookup performed : in a message mapping ? If so, in the builder tool (that's the name in XI 3.0, dunno for PI), in the message mapping object, there is a tab named "test". In this tab, you can provide an input message and then execute the mapping, so you can see what the errors or results are ... In this tab, there is a dropdown list for trace level selection (here you select "debug") ...

If needed, send us screenshots of your objects ...

Could you

Former Member
0 Kudos

Hi,

Try adding trace in your UDF for trouble shooting purposes.

example:

AbstractTrace trace = container.getTrace();

trace.addWarning("");

Regards,

Swetha.

former_member187339
Active Contributor
0 Kudos

Hi Jane,

can you paste here the code which you are using to do this lookup? There are few try catch blocks which you could use to see the error Messages:

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

I am using the Try catch in my SOAP Lookup UDF.

Here is my SOAP Receiver Adapter Target URL:

http://Jane.Fox.Inv.com:6666/oracle/sharedservices/GetMappedToValueByName/1.2?wsd

Here is my SOAP Lookup UDF.

Start SOAP Lookup UDF----


public String LookUp(String FromMapValue, String FromMapSystemID, String ToMapSystemID, String BS_Name, Container container) throws StreamTransformationException{

AbstractTrace trace = container.getTrace();

/**/

String output = "";

try {

/*Pass the Business System and Communication Channel as input to the getChannel().

/* Receiver SOAP Adapter */

Channel channel =

LookupService.getChannel(Business_System, "CC_SOAPu201D);

SystemAccessor accessor = LookupService.getSystemAccessor(channel);

/* Construct the SOAP Request Message using the InputParameters.*/

String SOAPxml =

/* "<InputData xmlns=\"http://www.inv.com/ist/integration/mappedtovaluebyName/input\"> <FromMapValue>"

+ FromMapValue

+ "</FromMapValue><FromMapSystemID>"

+ FromMapSystemID

+ "</FromMapSystemID><ToMapSystemID>"

+ ToMapSystemID

+ "</ToMapSystemID></InputData>" ; */

"<ns1:GetMappedToValueByNAMEInput xmlns:ns1=\"http://www.inv.com/ist/integration/mappedtovaluebyname/input\"> <ns1:InputData><ns1:FromMapValue>"

+ FromMapValue

+ "</ns1:FromMapValue><ns1:FromMapSystemID>"

+ FromMapSystemID

+ "</ns1:FromMapSystemID><ns1:ToMapSystemID>"

+ ToMapSystemID

+ "</ns1:ToMapSystemID></ns1:InputData ></ns1:GetMappedToValueByNAMEInput>" ;

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

XmlPayload payload = LookupService.getXmlPayload(inputStream);

Payload SOAPOutPayload = null;

/The SOAP call is made here and the response obtained is in the SOAPOutPayload./

SOAPOutPayload = accessor.call(payload);

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

InputStream inp = SOAPOutPayload.getContent();

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

/* Create DOM structure from input XML */

DocumentBuilder builder = factory.newDocumentBuilder();

Document document = builder.parse(inp);

/* Result is available in the ToMapValue tag */

NodeList list = document.getElementsByTagName("ns1:ToMapValue");

Node node = list.item(0);

if (node != null) {

node = node.getFirstChild();

if (node != null) {

output = node.getNodeValue();

}

}

} catch (Exception e) {

trace.addWarning("Error" + e);

}

return output;

}

END SOAP Lookup UDF----


I am having some doubts about from this part

"<ns1:GetMappedToValueByNAMEInput xmlns:ns1=\"http://www.inv.com/ist/integration/mappedtovaluebyname/input\"> <ns1:InputData><ns1:FromMapValue>"

+ FromMapValue

+ "</ns1:FromMapValue><ns1:FromMapSystemID>"

+ FromMapSystemID

+ "</ns1:FromMapSystemID><ns1:ToMapSystemID>"

+ ToMapSystemID

+ "</ns1:ToMapSystemID></ns1:InputData ></ns1:GetMappedToValueByNAMEInput>" ;

According to my webservice link it is GetMappedToValueByName and I am using like the below GetMappedToValueByNAMEInput this Input need to given is correct for this case.

Thanks,

Jane F.

former_member187339
Active Contributor
0 Kudos

Hi Jane,

>>According to my webservice link it is GetMappedToValueByName and I am using like the below GetMappedToValueByNAMEInput this Input need to given is correct for this case.

Use as mentioned in the wsdl action field (i guess it shoudl be GetMappedToValueByNAMEInput)... Also when you see the display queue or SOAP Channel (CC_SOAP) you may see some more error messages. Have you tried this?

Regards

Suraj

Former Member
0 Kudos

Hello Suraj,

I am not able to see any error in the Queue.

I tested with right click and disply queue for the SOAP Lookup UDF message is below.

Compilation of MM_Inv_Mapping successful Execution of mapping on server took 14 milliseconds Executed successfully

Thanks,

Jane F.

Former Member
0 Kudos

Hi,

The Soap XML you are passing is not proper. what you are giving in SOAPxml string is not in the correct xml format.

Correct the xml you are passing. Also try using the execution type as "All values of a context" instead of single Values while creating UDF.

Regards,

Swetha.

former_member187339
Active Contributor
0 Kudos

Hi Jane,

Ok.. Now do like this

1. Test your wsdl using some tools like XMLSPY or SOAPUI and see how the request payload looks like. If possible paste the request payload structure here.

2. In you udf try to create a structure similar to the request structure (take the suggestion of Christopher to display the structure in Trace message.

3. Now see whether you get any message in soap channel or display queue.

Regards

Suraj

Former Member
0 Kudos

Hi Jane,

You'll have to use the AbstractTrace object so you can add trace/debug msgs for each step of your lookup process etc ...

Some details about this object (in case you need some) : http://help.sap.com/saphelp_nw04/helpdata/EN/c8/98e7d5c1620642973565ea3dd319d1/content.htm

Rgds

Chris