Need assistance fine turning capturing response XSLT - xslt

Below is the results of a request and I'm trying to capture the EFTCardNum MaskVal
<EFTCardNum MaskVal="123456******1234">1234560000123456</EFTCardNum>
For response I'm currently using.
<xsl:value-of select="s:Envelope/s:Body/a:EFTCardInqResponse[a:EFTCardNum/#MaskVal]/a:EFTCardNum"/>
And I'm only bringing back "1234560000123456" and need to bring back the masked section "123456******1234". Hope this is enough information.

Related

How can i retrieve the PONumber

When I charge a credit card in Authorize.net, along with the createTransactionRequest I send along also a poNumber. This appears in the admin portal alongside all transaction details.
But when I retrieve the batches via the API to see what was charged/settled etc., I dont see any ponumber
Here is a sample of what I get back
<transaction>
<transId>9999</transId>
<submitTimeUTC>2017-12-03T20:16:23Z</submitTimeUTC>
<submitTimeLocal>2017-12-03T15:16:23</submitTimeLocal>
<transactionStatus>declined</transactionStatus>
<invoiceNumber>9999</invoiceNumber>
<accountType>AmericanExpress</accountType>
<accountNumber>XXXX9999</accountNumber>
<settleAmount>50.00</settleAmount>
<marketType>MOTO</marketType>
<product>Card Not Present</product>
</transaction>
Is there any way to get back the poNumber as well? It is very important for me.
PS. I don't need specifically the ponumber, any arbitrary field/tag would be fine for me.
Thanks

Preserving Whitespaces in Soap response using xslt

We are recieving soap response with spaces from backend application, when i see in datapower probe unformatted format i can see spaces. But Consumer team are recieving response without spaces from datapower webservice proxy.How can we send the unformatted response or how to preserve whitespaces within the response?
But when i test using soapUI I am getting response as expected with spaces.Please suggest
Actual Result :
<restopic:SequencedText>
<seqtxt:Sequence>00010</seqtxt:Sequence>
<seqtxt:Text>% LOB: Facility, Professional Effective Date: 07/11/97</seqtxt:Text>
</restopic:SequencedText>
Expected Result :
<restopic:SequencedText>
<seqtxt:Sequence>00010</seqtxt:Sequence>
<seqtxt:Text>% LOB: Facility, Professional Effective Date: 07/11/97</seqtxt:Text>
</restopic:SequencedText>
Thanks in Advance!!
First of all, don't trust the probe!
It will format messages according to what it "thinks" is correct and spaces might "disappear".
Make a XML File capture in the default domain and grab the archives from there to see how it really looks!
DataPower won't touch the XML element values so my guess is that it's either something happening after the message leaving DataPower or some conversion of character code or something messing up your spaces.
In the file capture you will be able to see both incoming and outgoig message and then you'll know how it looks.

cfhttp how to not encode plus sign

Situation: I am trying to call the LinkedIn API from a ColdFusion CFC to get the user's profile and network (connections). The LinkedIn API states that to do this you must call a URL with scope=r_fullprofile+r_network.
Issue: ColdFusion is automatically encoding the URL, so the plus sign is getting encoded, and LinkedIn is rejecting my call. Is there any way around this? I've posted a link below to some code snippets on github which I believe illustrate the issue.
https://gist.github.com/4535364
Any help would be appreciated!
I have searched around on this for a bit and I am seeing lots of examples where ColdFusion is not playing nicely with the LinkedIn API. So I'm afraid if you do get passed this issue (although I have not come up with an alternative yet) another will crop up. While searching I found several suggestions from people to use the linkedin-j, A Java wrapper for LinkedIn APIs instead. Here are some of the references that I found:
Working example Coldfusion and Linkedin API
LinkedIn-J does not return educations
401 Unauthorized response. API people/~ and people/id=; ColdFusion, cfhttp
Problem updating status - 401 unauthorized - ColdFusion
linkedin-j Getting Started
Side Note Your github code example is making a cfhttp call to 'receiver.cfm' but you called the file 'cfhttp_receiver.cfm'. In this line:
<cfhttp url="http://#cgi.http_host#/sandbox/receiver.cfm?scope=#url.scope#" method="post" resolveurl="no">
The scope field is a space delimited list.
The + character is commonly used as a shortcut for space, since it's more readable than %20 (which is what space encodes to).
If using a plus character results in an encoded plus (%2B) being sent, then you are left with two other ways of putting the space into the URL:
using a literal space character, or
using an encoded space %20
Try both of those options, ideally using a network snifer (e.g. WireShark) so that you can see accurately what is being sent.
Update: As per comments below, %20 is correct, but the signature based string needs to be encoded again, so for that the % becomes %25, giving a result of %2520.

Regex with iframe in Yahoo! Pipes

I'm building a Yahoo! Pipe to pull an RSS feed from Reddit which links to some content in the description. I'm using a regex to match the href attribute of the anchor link in an item.description field. The regex I'm using is:
^.+?href="([^"]+)">\[link\].+?$
As a test, I set the replace to simply:
$1
and I see that the entire description field has been replaced with the URL. So far, so good.
I then put the following in the replace field. The idea being to iframe the content that's linked to:
Content: <iframe src="$1">no iframe support</iframe> End
What I get out however is:
Content: no iframe support End
I've confirmed that this is also coming through in the pipe's output and not just in the Yahoo! Pipes debug console.
I've so far tried replacing my angle brackets with < and > entities. I've tried wrapping the entire thing in a <![CDATA[ ... ]]> block and still, I get nothing. If I break my iframe tag by removing an angle bracket, the broken content comes through fine, but if I have a well-formed iframe element, it vanishes, leaving the "no iframe support" text. Am I doing something wrong here, or is Yahoo! actively preventing me from using iframe tags in my generated pipe? A cursory search on Google isn't turning up anything related to this.
The pipe in question is here:
http://pipes.yahoo.com/pipes/pipe.info?_id=2ba41448cadd2347d86f377efd3d199f
This Pipes FAQ Question "Why does Pipes Strip <object> and <embed> tags... ?" shows that a certain amount of sanitization is performed, by placing content (at least certain content) into an iframe for the safety of RSS consumers - though it does not state it specifically, this probably also removes other iframes in order to avoid nesting and other work-arounds.
Yahoo is big enough I would doubt they have a week sanitizer, but an extremely long shot is that you might be able to fool it by nesting the iframe in a bunch of other tags (again I doubt this will work). Also depending upon which step does the sanitization, perhaps adding part of the tag in one step, then adding another part somewhere else might work (yet again, doubt overwhelms me)
Not sure what else to suggest, other than getting something else to consume and transform your RSS a little bit more (by fixing otherwise broken tags??) - but that's what you're using pipes for to begin with, isn't it? Idunno...
Good luck!
Pipes has an fanatical devotion to the RSS spec and the spec says the description field is plain text only. HTML etc is supposed to go in the content:encoded field, not that I've had much luck getting pipes to do that.

How to display Atom/RSS feeds in browser with custom XSLT?

Back in about 2006, I wrote a nice XSLT that transformed my RSS feeds into custom HTML. That way if a user clicked from a browser it would display as a simple page rather than a bunch of junk XML. If that same URL was used in a feed reader it was handled properly and everything was slick.
Now days, most browsers (IE, Firefox, Safari, Opera) seem to grab hold of the styles and won't let go. And Chrome just plain ignores the stylesheet transformation.
Given that it has been several years, am I simply forgetting some detail? Didn't it used to just be this easy?
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="/atom2html.xslt"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<!-- ... -->
</feed>
Anyone know if there is a way to override those browsers with very specific ideas of feed styling? And is there any way to get something nice out of Chrome?
Chrome appears to only apply the XSLT processing instruction if the Content-Type for the feed response is set to XML, not Atom.
This displays XSLT in Chrome:
Content-Type: application/xml
This does not display any styling (which is technically the more correct type):
Content-Type: application/atom+xml
It is now default behaviour for most browser to apply their own XSLT to any Atom/RSS feed they come across, very annoying. A feed is identified through the application/atom+xml mime type for Atom and application/rss+xml for RSS
You used to be able to circumvent this by filling the first 512 bytes of the feed with crud in the form of a comment. This would throw off the feed sniffing of the browser and allow you to apply your own XSL Stylesheet. This has worked for years for me but with IE8 this behaviour has gone out of the window and the 512 bytes comment doesn't work anymore. I have now switched over to server side processing but I still lament this decision from browser makes.
I'm not aware of a way to fool IE & FF & Safari's automatic display of RSS/Atom feeds, but in Chrome the XSLT is correctly applied via the xml-stylesheet processing instruction; here is an example from the Randonneur Group pool at flickr.