on 08-10-2012 3:43 PM
Hello guys!
I have a third-party system making HTTP Requests to SAP PI 7.0 (http://<server>:<port>/sap/xi/adapter_plain). I have created a HTTP Sender Adapter and Sender Agreement because I need to change the content-type of PI's HTTP Response from "application/xml" (PI's default) to "application/soap+xml" (this third-party system does not understand "application/xml").
I have created a XSLT mapping and configured the HTTP Sender as in the images bellow! But it is not working! Any guess?
What is not working? Do you see any error message? Is the problem only in response?
I have created a XSLT mapping and configured the HTTP Sender as in the images bellow! But it is not working! Any guess?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually, there is no error in PI! It sends a response to the HTTP client! But since my configuration and mapping did not work (the content-type of the response did not change from "application/xml" to "application/soap+xml) the client refuses it with an error message ("Client found response content type of 'application/xml', but expected 'application/soap+xml'").
Hi Reddy! I just have tried with "type" but it did not change anything!
This the HTTP Response:
HTTP/1.1 200 OK
content-type: application/xml
content-length: 1032
msgguid: 502503AE5D3F0DA0E1008000AC10152F
server: SAP NetWeaver Application Server / ABAP 700
<?xml version="1.0" encoding="UTF-8"?>
<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:Header><nfeCabecMsg xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/NfeCancelamento2"><cUF/><versaoDados>2.00</versaoDados></nfeCabecMsg></soap:Header><soap:Body><nfeCancelamentoNF2Result xmlns="http://www.portalfiscal.inf.br/nfe/wsdl/NfeCancelamento2"><ns1:retCancNFe xmlns:ns1="http://www.portalfiscal.inf.br/nfe" versao="2.00"><ns1:infCanc Id="ID33120833000092004660550010001049621064638988"><ns1:tpAmb>2</ns1:tpAmb><ns1:verAplic>SVRS20110530105153</ns1:verAplic><ns1:cStat>101</ns1:cStat><ns1:xMotivo>Evento registrado e vinculado a NF-e</ns1:xMotivo><ns1:cUF>33</ns1:cUF><ns1:chNFe>33120833000092004660550010001049621064638988</ns1:chNFe><ns1:dhRecbto>2012-08-07T11:28:19-03:00</ns1:dhRecbto><ns1:nProt>333120000473615</ns1:nProt></ns1:infCanc></ns1:retCancNFe></nfeCancelamentoNF2Result></soap:Body></soap:Envelope>
Hi Julio,
I used a UDF and I was able to set the content-type. Here is the result.
----------------HEADERS--------
set-cookie: sap-usercontext=sap-language=EN&sap-client=001; path=/
content-type: application/soap+xml
content-length: 1662
msgguid: 5063BAE2E32E11E198450000005298BA
server: SAP NetWeaver Application Server / ABAP 730
Here is the UDF code
public String setHttpHeader(String contenttype, Container container) throws StreamTransformationException{
// beginning of setHttpHeader d2a0e4bf0852e83b928c90e621036c29
String funcName = "setHttpHeader ";
// get trace object using container
AbstractTrace trace = container.getTrace();
trace.addInfo(funcName + "called with value - " + contenttype);
// Get dynamic configuration object
trace.addDebugMessage(funcName + "getting dyncamic configurtion ");
DynamicConfiguration conf = (DynamicConfiguration)container.getTransformationParameters().get
(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
// If dynamic configuration object is null, return
if(conf == null){
trace.addInfo(funcName + "Unable to get dyncamic configurtion. Returning. ");
return contenttype;
}
// Create the dynamic configuration key
trace.addDebugMessage(funcName + "creating dyncamic configurtion key HeaderFieldOne");
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/HTTP","HeaderFieldOne");
if(key == null){
trace.addInfo(funcName + "Unable to create configurtion key HeaderFieldOne. Returning.");
return contenttype;
}
// set the HeaderFieldOne key value
trace.addDebugMessage(funcName + "setting value " + key.toString() + " "+ contenttype);
conf.put(key, contenttype);
return contenttype;
// end of setHttpHeader d2a0e4bf0852e83b928c90e621036c29
}
Sender configuration remains same:
Let me know if this works for you.
Hello, Nageshwar! Thank you again for your reply! Unfortunatelly, it did not work yet! Looking at trace information everything looks fine, but my HTTP response is still "application/xml"
</MappingTrace>
Nageshwar, although I was using the UDF in the last step (a Transformation Step) before closing the ccBPM bridge, I think the Dynamic Configuration was being replaced. I removed the transformation step and configured the Interface Mapping/Message Mapping directly in the Interface Determination object of the Integration Directory and it worked!
Thanks a lot!
Julio
Hi Julio,
i have the same Problem to Change the Content-type in a http Response from Standard application/XML to text/XML. I set the Parameter with a xslt Transformation and see it in dynamicConfiguration, but on Client side we receive always application/XML .CoulI dont'Ä
I dont' t understand your Change the get this working. Could you please help me ?
IMO the content type application/soap+xml is soap 1.2 based. I'm not positive about HTTP Adapter of version PI 7.0 supports this. You might want to try SOAP AXIS adapter (as simple adapter without using the option soap envelope and as just plain http adapter) and see if that helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Gopalakrishnan, I am using HTTP plain adapter because, unfortunatelly, the HTTP client (third-party system) can not authenticate against PI server, so it is sending user and password as URL parameters (&sap-user=xxx&sap-password=yyy).
If I could send user and password to SOAP Adapter as URL parameters (I have tested it, but it did not work), my problem would be solved, because in SOAP Adapter Module I can set the content-type to "application/soap+xml"
refer stefan blogs about how webservice client passing the soap message directly to integration engine
You might also pass user and password as follows.. example...
http://<hostname>:<port>/sap/xi/engine?type=entry&version=3.0&Sender.Service=<XXX>&Inter...QualityOfService=BE&
sap-client=100&sap-user=user&sap-password=pwd
Hi Gopalakrishnan! First of all, I really appreciate your help!
Well, I've already read Stefan's blog and I've already tried to use the URL of the integration engine. It didn't work either, because HTTP Client uses SOAP 1.2 and the Integration Engine returns an error ("SOAP_ENVELOPE_INVALID: Invalid SOAP envelope due to error in node SOAP:Envelope").
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
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.