Remove path prefix when testing web service - web-services

I'm using apex 4.2.6. I have a problem with using REST services. When I try to test out a webservice that I created in apex I get a prefix in URL. That prefix actually messes up the real URL. When I delete that prefix my webservice works.
I'll try to explain it with this picture.
The first part of picture shows part in administration where you have to define path prefix for REST services.
Second part shows what I get when I go to my service and click button "TEST".
Third part shows what I get after I manually delete path prefix that was put there by apex.
As you can see it works after I delete it.

Related

How to prevent React from caching other github project pages

I built a GitHub User Page (https://username.github.io) with create-react-app. And I also have a project page at https://username.github.io/myProject which is built using Vuejs. The create-react-app seems to have a built-in service worker that does the caching automatically, which is what I wanted, but it also make my https://username.github.io/myProject not showing the project page correctly but showing my https://username.github.io page instead. I tried to unregister and clear the storage but it's only work once, when I located to my User's page and then to my Project's page, the problem still coming again.
How do I keep the caching behavior, and make these two urls able to show properly?
When you register an SW at the root ("/") it automatically takes control of everything below it ("/myapp2"). This is bu design and there's no exclusion config available.
I think you have two options:
Move the React project out of the root to it's own sub dir and have the SE control only that
Write some logic in the SW itself that checks all fetches it's handling and does a no-op if the they match a dir you don't want to be handled by the SW

How to customize URL pattern in WSO2AM

I am designing an API using WSO2AM 2.0
My service is like : http://190.100.10.10:9000/abc/xyz/doPost<br>
I want to replace /abc/xyz/doPost by /<MY_CUSTOM_PATH>/doPost
How can I make a custom URL pattern to hide my original URL path from the service?
Like: http://<WSO2AM_GENERATED_HOST>/WSO2AM_CONTEXT/WSO2AM_VERSION/<MY_CUSTOM_PATH>/doPost
I have searched the docs, but I am not able to find any related tutorial.
If I put /abc/xyz/doPost it will get appended to the WSO2AM generated hostname.
What is "EDIT SOURCE" in the image below? Can it be used to do what I want? If YES, How??
There aren't anything like WSO2AM_CONTEXT or WSO2AM_VERSION. You can provide any value for the context and version. Version can be String, numbers, etc.
In your case, you can use abc as context and xyz as the version.
That is exactly the kind of URL you would get in WSO2 API Cloud: http://your.custom.url/api-name/version/context. See this tutorial for details: https://docs.wso2.com/display/APICloud/Customize+the+API+Store+and+Gateway+URLs
It might not be complicated...
In publisher interface, when you add/edit an API, in "Implementation" screen, just configure WSO2 APIM to point to "http://190.100.10.10:9000/abc/xyz" - this way, "/abc/xyz" will not be visible to your clients.
So in this case,
http://<WSO2AM_GENERATED_HOST>/WSO2AM_CONTEXT/WSO2AM_VERSION/doPost
will point to:
http://190.100.10.10:9000/abc/xyz/doPost
If you wanted to add additional custi=om paths, in the "Design" screen you attached, you can also add your "(MY_CUSTOM_PATH)/doPost" path there.
This way
http://<WSO2AM_GENERATED_HOST>/WSO2AM_CONTEXT/WSO2AM_VERSION/<MY_CUSTOM_PATH>/doPost
will point to:
http://190.100.10.10:9000/abc/xyz//<MY_CUSTOM_PATH>/doPost
(However, your backend services should also have "//doPost" implemented)

non-root url not working when directly entered in browser address bar for ember app deployed in Jetty

I have a simple app developed using Ember. It is more of a pet project than anything else. As I am familiar with Jetty, so I just deployed it into Jetty's webapps/ROOT. The problem is, I have to start the app with the root url: http://localhost:8080/. If I enter something like http://localhost:8080/foobar in browser's address bar, I will get a 404. But I can go to that page by clicking some link in the root page.
To my understanding, the reason why directly entering the non-root foobar url not working is that Jetty is trying to locate the foobar resource. Since the foobar resource is only resolvable inside the Ember app, Jetty can't find it and hence it fails to enter non-root url directly. However, my question is, how can I make that directly entered url work? If it can not be done or not easily be done with Jetty, I am open to use another http server.

How to simulate passing the keyword to a website from a search engine?

We made a website using the sitecore. And we have a rule for the DMS part when searching keyword contains SUV, then we do something. But my question is how to test this rule, we have prepared everything for the back-end. How to pass a keyword 'suv' to our website to simulate the search engine?
You can create your own page simulating search engine (or just a page with a link to your app and open it with the SUV keyword - http://mytestengine/index.html?q=SUV) and navigate from this page to your Sitecore application. You must also add a new engine definition to your configuration:
<engine hostname="www.google" parametername="q"/>
<engine hostname="mytestengine" parametername="q"/>
Remember to clear the history of the browser before testing the solution - in other case your visit won't be considered as a new visit.
More information can be found in the blog post.
In the past I have used the Tamper Data Firefox plugin to test some DMS functionality. The plugin will allow you to intercept the request to your website and update the referrer to be: http://www.google.com?q=suv.
Steps:
Open page that has a link to your website in Firefox.
Open Tamper Data Plugin.
Select 'Start Tamper'.
Click link to your site.
When prompted, select 'Tamper'.
Change 'Referrer' field to: http://www.google.com?q=suv (or whichever search engine you'd like to test).

GetOpenFileName lpstrInitialDir (directory)... not working for URL (SharePoint)

I bring up a GetOpenFileName dialog, enter a URL to a SharePoint sever, and it lets me browse that server using the Web Client Service (WebDAV mini-redirector). I am trying to get the initial directory to come up as that URL, but it seems to ignore it (using OPENFILENAME struct's lpstrInitialDir). Local paths work fine.
EDIT: Paul requested the form of the URL: it's http://doc.name.com I've also tried a trailing slash (both flavors) to see if that made a difference (saw some reference to that in another posted question). It didn't seem to.
EDIT2: This does work if I use the WebDAV address instead of the HTTP URL (i.e., \doc.name.com\DavWWWRoot. This doesn't solve my problem, as it's not a view of the site that users will recognize and will have difficulty working with.
If your application is for vista, you can use the IFileOpenDialog, which lets you use an IShellItem as the default location, and it should be pretty easy to create a shell item that points to the sharepoint URL.