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

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.

Related

What is Wiremock and can I use it to test my Rest API in Spring?

I created a REST API with Spring and want to test it. I saw WireMock but I dont really know how this library can help me. Can I use it to test my Rest API or ist it to mock another API my API uses, so that I can ensure that a mistake is coming from my Service?
What exactly do you mean by "want to test it"? How would you be "testing" your API? What would a pass/failure look like?
WireMock is a mock server service. It acts as an API that can feed in responses that you have defined (or even proxy an existing API and feed in responses it gets from there.) I usually use it in place of an unreliable API, to act as the back end for the app that I am using.
If you are looking for a library that you can use to ping your API, I've had success using REST-Assured. If you are looking for a program you can use to ping your API, Postman is my app of choice.

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

grpc header/cookie in Go

I want to do place on server application which can be called by Go APP and Java app both.
for some reason ,there's a cookie authentication and oAuth mechanism ,so I want to set one Go app as Auth Micro-service for the authentication purpose.
As GRPC is built on the HTTP2 ,so The headers and cookies are on the protocol.but I did not find out how to carry on header and cookie when the rpc occurs,implemented by Go, on GitHub I only found the JAVA-Implementation for headers at :
https://github.com/grpc/grpc-java/tree/master/examples/src/main/java/io/grpc/examples/header
Can anybody give me some direction of Go implementation for this purpose?
Headers in gRPC are called "Metadata." Clients can only send "headers". Servers can send both "headers" and "trailers."
You want to:
Use the google.golang.org/grpc/metadata package and metadata.NewContext() to send metadata from the client-side.
Use grpc.SendHeader() and grpc.SetTrailer() to send metadata from the server-side.
Use the grpc.Header() and grpc.Trailer() CallOptions for receiving the Metadata on the client-side.
Use metadata.FromContext() for receiving metadata on the server-side.

CORS Issue in WSO2 DSS By using Ajax

Calling Wso2 Dss Services by using ajax is not working like Rest Resource or SOAP UI it causes
Cors Issue , Even i did not get any relevant information about that after a long research What i have to edit in my Configuration File or is some other option is there to fix this issue.
This Case For my apache tomcat Server , i can Simply add Access Control Orgin header as * , but in wso2 its not working out .I dont know even where to add it ..plz give me a good solution for this
You may set up WSO2 ESB on before of your DSS server and you may call your service using ESB proxy or REST end point.If you do that you can set CORS parameters inside outSequence tag.
Same question asked here Call WSO2 DSS service using ajax?

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