on 04-13-2013 7:32 AM
Hello,
I`m facing problem with "certification verification failed" during sending signed message via web service.
In my opinion it is because element/parameter SIGNATURE in xml is like:
<n2:Signature Id="Signature-0">
and should be:
<n2:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="Signature-0">
Originally proxy structure was very complexed element "Signature" so every part we had to put separately.
Now i tried to modify wsdl and set "Signature" as string so we can send only one parameter with correct xml to function module and next to web service.
Now we are able to add everything inside "Signature" but still first element is generated by SAP
Modified WSDL part is like:
<xs:element name="UploadRequest">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="Signature" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
so in SAP under request parameter we have only Signature type string.
My question is:
Is it possible to add namespace xmlns:ds="http://www.w3.org/2000/09/xmldsig#" to "Signature"?
If so how can I do this?
Best regards
Since I have not much experience with XSLT mapping I think I need more help.
What I have done and how it works now:
1. Created Service Consumer under SE80 (using wsdl file)
2. Created SM59 connection and logical port via LPCONFIG
While using webservice we are using function module. For example it is:
FUNCTION Z***UPLOAD***.
*"----------------------------------------------------------------------
*"*"Lokalny interfejs:
*" IMPORTING
*" VALUE(PRT_NAME) TYPE SRT_LP_NAME
*" VALUE(REQUEST) TYPE Z_UPLOAD_REQUEST
*" EXPORTING
*" VALUE(DOCUMENT) TYPE Z_DOCUMENT16
*" VALUE(ERROR_TEXT) TYPE STRING
*" EXCEPTIONS
*" SYSTEM_FAILURE
*" COMMUNICATION_FAILURE
*"----------------------------------------------------------------------
DATA:
dummy TYPE STRING,
fault TYPE REF TO cx_ai_system_fault.
DATA: Z_PROXY_CLIENT TYPE REF TO Z_CO_SERVICES .
TRY.
CREATE OBJECT Z_PROXY_CLIENT
EXPORTING
LOGICAL_PORT_NAME = PRT_NAME.
CATCH CX_AI_SYSTEM_FAULT .
ENDTRY.
data: UPLOAD_RESPONSE type Z_UPLOAD_RESPONS .
data: UPLOAD_REQUEST type Z_UPLOAD_REQUEST .
REQUEST-SIGNATURE = '<ds:SignedInfo Id="ID-for_testing"></ds:SignedInfo>'.
MOVE REQUEST-SIGNATURE TO UPLOAD_REQUEST-SIGNATURE.
TRY.
CALL METHOD Z_PROXY_CLIENT->UPLOAD
EXPORTING
UPLOAD_REQUEST = UPLOAD_REQUEST
IMPORTING
UPLOAD_RESPONSE = UPLOAD_RESPONSE
.
CATCH CX_AI_SYSTEM_FAULT INTO fault.
dummy = fault->errortext.
MOVE dummy to ERROR_TEXT.
CATCH CX_AI_APPLICATION_FAULT .
ENDTRY.
MOVE UPLOAD_RESPONSE-DOCUMENT TO DOCUMENT.
ENDFUNCTION.
Now in srt_util I can see that PI is sending xml as
...
<n0:Signature><ds:SignedInfo Id="ID-for_testing"></ds:SignedInfo></n0:Signature>
...
Where do I have to use this XSLT to add namespace?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have checked all the links above but there is no step-by-step info how to do this.
I have found: http://www.riyaz.net/sap/sap-pi-abap-mapping-simplified/837/ and done "Writing Your First ABAP Mapping Class".
I don`t know how to do step: "Implementing ABAP mapping in SAP PI".
..but next step should me mapping.
According to: http://scn.sap.com/thread/3174199
I can implement something simillar to: http://www.sachinhandiekar.com/2011/12/remove-namespace-using-xslt.html in tcode: XSLT_TOOL
I have also found quite old guide without screenshots: http://scn.sap.com/people/r.eijpe/blog/2005/11/04/using-abap-xslt-extensions-for-xi-mapping
To sum up:
I have created new mapping class.
I know that mapping simillar to: http://www.sachinhandiekar.com/2011/12/remove-namespace-using-xslt.html should be developed under XSLT_TOOL
But how to make it complete and working?
You create XSLT mapping and specify this mapping in the operation mapping after your message mapping. The sequence is first message mapping and followed by XSLT. You basically create xslt mapping externally and import it in PI, Please refer SCN for adding namespace using XSLT. You will see plenty of threads.
Hi,
Finally I have access to PI - ESR.
Since I have no experience with it could you please tell we where should I start doing XSLT mapping? Maybe there is any tutorial with screens?
Using sxmb_ifr I have view as following:
In ESR - Enterprise Services Builder there is:
and in: ID - Integration Builder:
Best regards
You can have an XSLT mapping to add namespace. Consult the below links:
http://www.sachinhandiekar.com/2011/12/remove-namespace-using-xslt.html
http://stackoverflow.com/questions/2686650/xslt-add-namespace-to-root-element
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
But, is it possible when all proxy structures are generated by SAP based on imported wsdl + xsd?
As I can see in SE80 there is assigned XSLT transformation generated by SAP and I can not change it.
Or maybe it is possible to attach other transformations somewhere else?
I would appreciate your help.
>But, is it possible when all proxy structures are generated by SAP based on imported wsdl + xsd?
You don't need to make any change in the proxy or sender system. You use the structure you have from the wsdl. You just add this namespace in the mapping step and so before you call the web service you have this namespace .
>Or maybe it is possible to attach other transformations somewhere else?
Do it in the mapping step. You can use xslt mapping or java mapping.
Hi,
As Baskar already said, the XSLT mapping will be applied during the mapping step in PI. The below tutorials explain how the XSLT mapping is added in PI:
http://saptechnical.com/Tutorials/XI/XSLT/page1.htm
http://scn.sap.com/docs/DOC-3824
& for your requirement, you can refer to the links which I gave in my previous post.
User | Count |
---|---|
86 | |
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.