How to Configure web service client endpoint url? - visual-studio-2010

We have a situation, our interface partner is calling our web service dynamically by calling our WSDL and consume web methods by using the endpoint defined in the WSDL.
Here, the problem is - As we are using reverse proxy server, the actual web service is hosted in different content server and have URL rewrite rule configured in proxy server to redirect the request to real content server. Our interface partner is successfully consumed our WSDL by using the given reverse proxy URL, but the WSDL is having the real content server URL and our interface partner is not having access to it.
They can change the endpoint url in their proxy class and consume the web service via the reverse proxy URL; unfortunately, they are using some common framework to dynamically build the end point from the received WSDL. So our client could not consume our web service.
Is there any way to determine the client's endpoint url in web service? Thanks in advance.

open wsdl file in browser. save as on local system with .wsdl extension. in client code give url of local file instead of server address as given below.
url = new URL("file:/C:/apps/Services.wsdl");

Related

How can you deploy a spring boot application with HTTPs without making any changes to the application?

I have a spring boot application which works over http.I do not want to touch the application - so no keystore etc. I want to use reverse proxy - i.e. the request will land at some other machine over TLS and
will get redirected to my spring boot application over secure socket layer. How it could be done?
Edit: When I try to login to that site, developer tool console tells me:
"Mixed Content: The page at 'https://xxxx-uat.xxxx.com:4200/login' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://151.253.73.106:9091/login'. This request has been blocked; the content must be served over HTTPS."
Nginx reverse proxy is being used.
Best way to do it is to use cloudflare. Cloudflare is free for basic use. You can create a new site, point to your HTTP URL and configure SSL as flexible. So, now your service is behind https. Cloudflare will act as proxy. Request will go to cloudflare via https, then it will be routed to your http.

how to use the proxy service without tryit tool in wso2 esb?

I am learning and working on building some wso2 sample prototypes.
I have created a proxy service and tried using it with the tryit tool inside.
But i don't know how to use it externally. i mean how to send data to the proxy service because in API there is a endpoint created where the request is sent.
Is there anything like link to request or how to use it externally in some application.
You can use SOAP UI. Please check the article.
The easiest way to call Your proxy service is to use some Rest Client on Your Browser. I use Add-On in Firefox (RestClient i think). U can create there whole request (json, xml), add headers, Authentications or Content Type. It should helps U to call any services in wso2.

How to find the URL of a OSB proxy service which do not have wsdl associated

I have a proxy service which accepts text as request and gives text as response. I have a routed node which invokes another business service. I have to make this way because I need to add soap headers to the input before i invoke the business service. Now everything is working fine and i am able to launch test console of the proxy and get it tested. But I am not able to find the direct url to access the proxy service to share it to the customer.
My proxy uri is for eg, /testWS/TestProxy and if i try to give http://:/testWS/TestProxy?wsdl it returns 404 error. I understand this is because there is no wsdl associated to this proxy. But how will i get this working atleast in soap ui?
Regards
Murali
Go into /sbonsole/
Navigate to Project Explorer and find the proxy
Go to Configuration Details tab (the default tab)
the Endpoint URI field has the path details.
(If you weren't sure, the hostname and port are found in /console/ -> environment -> servers - there are Listen Port fields etc)
As far as SoapUI goes, you can either treat the service as a REST service, or you can create the project without a WSDL and add stuff manually (for instance, there's a HTTP Test Request test step that you can use instead of a SOAP test request)
To receive the response in JSON format, you must set the Accept header as application/json

how to transform a request's URL using a client-side proxy?

I have an application that makes web requests to a set of URLs with the same host name. For testing purposes, I need to have this application make the same requests to URLs with a different host name. I don't have access to the source code, so building a debug version with the modified URLs is not possible.
Is there a [lightweight] proxy application that can intercept web requests and transform their URL?
For example, if it detects a web request to https://some.production.server/path, have it transform and send the request to https://some.development.server/path
Sure, use Fiddler. Click Tools > Hosts.

How to call Java web service (JAX-WS) from AJAX?

I am developing java web services (JAX-WS) to insert data into mysql DB and retrieve it. This web service has two methods i.e. fetchFromDB and insertIntoDB. Services seems to be running fine when I test them using netbeans IDE.
Address: /CalculatorWSService
WSDL: /CalculatorWSService?wsdl
but when I try to access it using AJAX's xmlHttpRequest object by providing url http://localhost:8080/CalculatorApp/CalculatorWSService. It is not able to access it. I have developed C# web services and It has been so easy to access them with a url but java web services don't seem to follow that.
My question is
What url to use to access the web service operations in AJAX? (Do I need to use '?wsdl' in the url?
Is there a javascript ajax library to easily access JAX-WS web services?
Apache Axis web services are a better choice over JAX-WS?
Please help me, Thanks, Jay
I was having the same problem of yours, couldn't invoke a Jax-ws web service from Javascript, but i've found a way to do this.
The Url to use can be your same (EndPointAddress) "http://localhost:8080/CalculatorApp/CalculatorWSService"
but when you create the XMLHttpRequest object from javascript you have to:
* Use the POST method to open the URL , i tried with GET but it didn't work for me.
* Set the SOAPAction Request Header to the one in your wsdl, even if its empty "".
* Be very careful with the request body to send, the soap Envelope must be correct.
hope this can help you!.
Bye.
Paul Manjarres.
From the client's perspective, I wasn't expecting significant differences between Axis and JAX-WS. Everything the client needs should be in the WSDL.
One thing that sometimes happens is that the URL used when developing a WebService references the develpoment host and port (and maybe even the ContextRoot) When deployed to a particular server any of those could be changed. Ideally a new WSDL could be created with new "binding" information.
My first step would be to point a browser directly at the Web Service you want to invoke. In my environments that returns a nice "Hi this is a Web Service" kind of message. If you get 401 not found errors then you just need to study exactly how the web service was deployed. Was a different port or context root specified?

Resources