• 添加评论
  • 编辑
  • 更多操作 v
  • 隔离此条目

评论 (7)

1 XIntegration50 发表了评论 永久链接

Hi Hermann,

 
When we do an export from control panel, DP server creates an export zipped file in the local:///export folder. Do we have any way to perform the same with the base64 resp that we get from SOMA export call?
 
Thanks,
Venkat.

2 XIntegration50 发表了评论 永久链接

Hi Herman,

 
Adding some more information. I want trying to see if I can create export.zip as like DP using SOMA . In my case I am calling XML mgmt ip using xslt ( NOT using cURL or something like that ).
 
I know it might be better to save the base64 encoded text as a file and use the same while importing but if it is zip that can be copied and saved to some repository for version tracking.
 
Thanks,
Venkat.

3 HermannSW 发表了评论 永久链接

Hi, you can access the XML Management interface from within a stylesheet (https://www.ibm.com/developerworks/community/blogs/HermannSW/entry/accessing_xml_management_interface_from_within_a_stylesheet38), and then use dec.xsl technique from above to return the .zip file -- that is the one service returning a .zip export. Hermann

4 XIntegration50 发表了评论 永久链接

Hi Hermann,

 
I mentioned in my above comments that I want to do SOMA from within stylesheet and create an export .zip as like datapower does . So I created do-export SOMA and got base-64 encoded text back. I created a file name with .zip extension with the Set-file SOMA action and gave the content that I got while creating the file .the file created with .zip extn. but doesn't seem to be valid. I am not sure if I have to convert it to binary ( as like dec.xsl above ) but if I convert to binary I cannot use dp:set-file. Can you please suggest an idea ?
 
Thanks,
Venkat.

5 HermannSW 发表了评论 永久链接

Sorry, I do nozt understand why you wnat to use dp:set-file. What you said is that you want a .zip export returned. You can achvieve this by adding the "call do-export by SOMA from withing stylesheet" to dec.xsl above. Then you will have the base64 encoded .zip as you said. Now all you have to do above if replace the <xsl:value> line by <xsl:value select="dp:binary-decode($b64)"/>. So assuming that the base64 encoded .zip is stored in $b64 variable, this modification will return the "real" .zip file. So if you redirect the output into a "file.zip" you can open that file with an archive manager.

6 XIntegration50 发表了评论 永久链接

Hi Herman, Sorry I forgot to mention one step, I am planning to use only SOAP UI and send a request to import and export. So, a user might say export from 'env1' domain and import to 'env2' domain, in this case I want to create export_xxxx.zip file in local or temp folder and them continue importing to targeted domain or user may perform single import or export action. Once export or export/import is done, user copies this export to CVS manually ( I am trying to see if we can call CVS APIs from datapower ) for versioning. Some times user may copy .zip export from CVS system into datapower and only requests import action to 'env2', in this case I have to able to read .zip file and import it. For this reason I am trying to create a .zip file within xsl. Please correct me if you think my approach is wrong.

 
Thnaks,
Venkat

7 AdityaKaranam 发表了评论 永久链接

Hi HermannSW, I tried decoding base64 data using 'dp:decode' extension but am getting Junk value at the end of every line which reads " ", Is there any way through which this could be avoided?

 
Here's the XSL I'm using:
 
 
<xsl:template match="/">
<xsl:variable name="InputData" select="."></xsl:variable>
<xsl:variable name="DecodedData" select="dp:decode($InputData,'base-64')"></xsl:variable>
<xsl:value-of select="$DecodedData"></xsl:value-of>
</xsl:template>
 
And here's how my decoded base64 data looks like:
 
DEE|^~\&|Hello akkarana|GA0000||C PROCESSOR|20010316||ORU^R01|20010422GA03|T|2.3|||NE|AL|1|ASCII|A^b^c^d^e^f
BHO|1||E3302^^^^MR~100000316^^^MRN^MR||Rajesh^Ramayan^KUmar^JR^^^L||20001007|M||2106-3^Brown^HL70005|123 Lemontree St^APT3B^TGSA^GA^30210^^M^^GA067||(678)3535352D313231325E50524E
ALN|D|F||UMHS^L^^^M10|F|F|F|Y|Y|Y
BJF|1|P|comment after PD1
GWB|1|I|GMFDEP^RM319^1859|||GMFDEP^RM320^1860|0100^ANDERSON,JAMES|0148^FLINTOFF,ANDREW||SportsPsych|||||||2345^BOWLER^FAST^^|||||||||||||||||||||||||||20091109||||||||
POP|1|obr_placerorder|obr_fillerorder|obuid|||200603151020||1^ml|obrcollectionid|G|dangercodeisCE|clinicalinfoisST|200603151020|spsasfasra|asdafasgasg|^ORN^CP^^^734^6777777^^obrcallback|placer1|placer2|filler1|filler2|200603151041|99.5^USD|MYC|X|parentisCE|||||reasonforstudy|presult|aresult
FDR|1|DT|87654^Pulse^ABCDE|4|20130202|F|7|A|9|A|F|||201012021309|15
JFK|sponsor|studyphase|scienceshebang
 
---------
 
As you can see there's ' ' at the end of every line. Could you please help me out on this?
 
Thanks in Advance!
 
Aditya :-)

添加评论 添加评论