i use from wso2 esb to add proxy service. i hvae an error when i try to call this web service. this is my proxy service :
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="citynetserviceMain"
transports="https,http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<property name="DISABLE_CHUNKING"
value="true"
scope="axis2"
type="STRING"/>
<send>
<endpoint>
<address uri="http://citynetservice..../CityBank.svc?wsdl"
format="soap12"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
<publishWSDL uri="http://citynetservice..../CityBank.svc?wsdl"/>
<description/>
</proxy>
when i try to call this proxy service it throw an exception :
<TryitProxyError xmlns:h="http://wso2.org/ns/TryitProxy" h:status="SOAP envelope error">org.apache.axis2.AxisFault: Transport error: 404 Error: Not Found</TryitProxyError>
Not sure if you are facing the same issue as mine, but I've had the same problem when an other server (tomcat) was listening on port 8280.
The ESB start without any problem but you can find an error in esb logs that say that port is already in use
You can access ESB console on port 9443 and use "try this service", but in my case, tomcat were sending back a 404.
Hope it can help.
Related
I am trying to use WSO2 ESB (version 4.8.1) to invoke externally hosted SOAP web services. To try it out I was using a public web service for weather information (http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL), more specifically the GetWeatherInformation operation.
I have successfully consumed the web service using the soapUI tool.
I am a newcomer to SOAP and ESB, so I tried to follow a number of blog entries, but I keep on getting errors. I tried using proxy service, payload factory and send but still didn't manage. Can somebody please help me with setting this up?
Thanks
Here come a sample API to invoke GetWeatherInformation :
<?xml version="1.0" encoding="UTF-8"?>
<api xmlns="http://ws.apache.org/ns/synapse"
name="testws3api"
context="/testws3api">
<resource methods="GET" url-mapping="/GetWeatherInformation">
<inSequence>
<payloadFactory media-type="xml">
<format>
<GetWeatherInformation xmlns="http://ws.cdyne.com/WeatherWS/"/>
</format>
<args/>
</payloadFactory>
<send>
<endpoint>
<address uri="http://wsf.cdyne.com/WeatherWS/Weather.asmx" format="soap11"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<send/>
</outSequence>
</resource>
</api>
You just have to send a GET http request to http://esb.hostname:8280/testws3api/GetWeatherInformation (use SoapUI or type this address in your internet browser) and you will get back the XML response from the Weather WS
It works with this proxy conf deployed in WSO2 ESB v4.8.1 :
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="testws3"
transports="https http"
startOnLoad="true"
trace="disable">
<target>
<endpoint>
<wsdl service="Weather"
port="WeatherSoap12"
uri="http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL"/>
</endpoint>
<outSequence>
<send/>
</outSequence>
</target>
<publishWSDL uri="http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL"/>
</proxy>
I have created a Resful WebApplication and upload it in wso2 as a Restful Service
I want to call this RestFul Service using a proxy service in wso,Is it possible
While doing this ,i am not able to get the response
Below is my Proxy Service configuration
<?xml version="1.0" encoding="UTF-8"?><proxy xmlns="http://ws.apache.org/ns/synapse" name="ProxyService" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<outSequence>
<send/>
</outSequence>
<endpoint>
<http method="get" uri-template="http://10.132.97.131:9763/JerseyJSONExample/rest/jsonServices/print/mahi/"/>
</endpoint>
</target>
<description/>
But while calling this proxy service,i am not able to get the response
If i am simply calling the service
http://10.132.97.131:9763/JerseyJSONExample/rest/jsonServices/print/mahi/
I am getting the response...
Can anyone help me on this what actually is the problem
You can use the following configuration to call a restful service from proxy service
<inSequence>
<property name="HTTP_METHOD" value="GET" scope="axis2" type="STRING"/>
<send>
<endpoint>
<address uri="http://10.132.97.131:9763/JerseyJSONExample/rest/jsonServices/print/mahi/"
format="pox"/></endpoint>
</send>
</inSequence>
More information can be find here
I am trying to get WSO2 to work with WCF - WCF expects the WSAddressing headers to be set and correct. I am trying to use a Header Mediator with my WSDL Proxy Service and to set the To Header but it never seems to do anything - I always get the error message from WCF: "The message with To '' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree."
Here is my proxy setup - what do I need to do to get this working?
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="PingService"
transports="http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target>
<inSequence>
<header xmlns:a="http://www.w3.org/2005/08/addressing"
name="a:To"
scope="default"
value="http://localhost/PingService/PingService.svc"/>
</inSequence>
<outSequence>
<send/>
</outSequence>
<endpoint>
<wsdl service="PingService"
port="AccountService_WsHttp"
uri="http://uk-dev-10706.wintech.local/PingService/PingService.svc?singleWsdl"/>
</endpoint>
</target>
<description/>
</proxy>
I think you can enable "WS-Addressing" for your endpoint.
http://docs.wso2.org/display/ESB480/WSDL+Endpoint
Please try with transport scope may be that will work in your case.
<header xmlns:a="http://www.w3.org/2005/08/addressing"
name="a:To"
scope="transport"
value="http://localhost/PingService/PingService.svc"/>
I am trying to implement ESB as a JMS Consumer sample, given at WSO2 ESB documentation.
http://docs.wso2.org/display/ESB470/ESB+as+a+JMS+Consumer
I have followed below steps:
configuring JMS listener and sender in
ESB_Home\repository\conf\axis2\axis2.xml
copied all the jar file as mentioned
created a message queue in ActiveMQ using its web console.
Below is my proxy service code:
<proxy xmlns="http://ws.apache.org/ns/synapse" name="JMStoHTTPStockQuote" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<inSequence>
<property name="OUT_ONLY" value="true"/>
</inSequence>
<outSequence>
<send/>
</outSequence>
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
</endpoint>
</target>
<description></description>
</proxy>
But still my proxy service is showing as faulty service. with the message:-
Unable to configure the service JMStoHTTPStockQuote for the VFS transport: Service doesn't have configuration information for transport vfs. This service is being marked as faulty and will not be available over the VFS transport.
As you can see I am not using VFS transport for my service and I have uncommented the code for VFS in axis2.xml but still I am getting this faulty exception.
First of all your proxy configuration is not correct. If you want to listen to a JMS queue, you need to use the jms transport in your proxy service. In the link you have mentioned, the proxy service is given as below.
<proxy xmlns="http://ws.apache.org/ns/synapse" name="JMStoHTTPStockQuoteProxy" transports="jms">
<target>
<inSequence>
<property action="set" name="OUT_ONLY" value="true"/>
</inSequence>
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
</endpoint>
<outSequence>
<send/>
</outSequence>
</target>
</proxy>
Here the transport is "jms". Please try with this config.
I'm new to this area and i need to access my web service via the ESB. as it mentioned in here - Service Mediation Using Proxy Services i tried to to create it. after that i run it and get the response as follows :
<TryitProxyError xmlns:h="http://wso2.org/ns/TryitProxy"
h:status="SOAP envelope error">org.apache.axis2.AxisFault:
The input stream for an incoming message is null.</TryitProxyError>
but i tried to run same web method using SOAPUi and get the expected out put as below:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<getPatientHistoryResponse xmlns="http://tilani.lk/">
<getPatientHistoryResult>
<NIC>123</NIC>
<FullName>ABC DEF</FullName>
<FirstName>ABC</FirstName>
<Surname>DEF</Surname>
<Title>Mr.</Title>
<Gender>M/Gender>
</getPatientHistoryResult>
</getPatientHistoryResponse>
</soap:Body>
</soap:Envelope>
what is the reason for this? i created this using .net
my WSDL Address - http://localhost:2935/PatientRegService.asmx?WSDL
then in
Define Endpoint as - http://localhost:2935/PatientRegService.asmx
EDIT
my proxy configuration is as follows:
<proxy xmlns="http://ws.apache.org/ns/synapse" name="PatientManagement" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<outSequence>
<send/>
</outSequence>
<endpoint>
<address uri="http://localhost:2935/PatientRegService.asmx?WSDL"/>
</endpoint>
</target>
<publishWSDL uri="http://localhost:2935/PatientRegService.asmx?WSDL"/>
<description></description>
</proxy>
If you just want to access your web service via ESB you need to create a proxy service and access the proxy service URI instead of the original service URI. Just follow the Pass Through Proxy example.
Try the following proxy and see waht you are getting. Add this proxy configuration via source view editor.
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="testProxy"
transports="https http"
startOnLoad="true"
trace="disable">
<description/>
<target>
<inSequence>
<log level="full">
<property name="testprop" value="incoming message"/>
</log>
<send>
<endpoint>
<address uri="http://localhost:2935/PatientRegService.asmx"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
</proxy>