Hi Vish, On Nov 19, 2014, at 1:26 PM, Vishvjit Khalipe <[email protected]> wrote:
> Hello, > > I am trying out synapse (v2.1.0). I have couple of questions - > > 1. While creating proxy, I have been running into an issue (if I may call > it that). Synapse proxy is adding service port name specific to binding to > the location URL. > e.g. If original service wsdl is > http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL and in original wsdl the > locations are provided as - > <wsdl:service name="Weather"> > <wsdl:port name="WeatherSoap" binding="tns:WeatherSoap"> > <soap:address location="http://wsf.cdyne.com/WeatherWS/Weather.asmx"/> > </wsdl:port> > <wsdl:port name="WeatherSoap12" binding="tns:WeatherSoap12"> > <soap12:address location="http://wsf.cdyne.com/WeatherWS/Weather.asmx"/> > </wsdl:port> > <wsdl:port name="WeatherHttpGet" binding="tns:WeatherHttpGet"> > <http:address location="http://wsf.cdyne.com/WeatherWS/Weather.asmx"/> > </wsdl:port> > <wsdl:port name="WeatherHttpPost" binding="tns:WeatherHttpPost"> > <http:address location="http://wsf.cdyne.com/WeatherWS/Weather.asmx"/> > </wsdl:port> > </wsdl:service> > > Synapse proxy is adding binding port name to location URL so proxy service > wsdl becomes - > <wsdl:service name="weather"> > <wsdl:port name="weatherHttpsSoap11Endpoint" binding=" > tns:weatherSoap11Binding"> > <soap:address location="https://api.example.com:8243/service/v1.0/weather. > *weatherHttpsSoap11Endpoint*"/> > </wsdl:port> > <wsdl:port name="weatherHttpsSoap12Endpoint" binding=" > tns:weatherSoap12Binding"> > <soap12:address location="https://api.example.com:8243/service/v1.0/weather. > *weatherHttpsSoap12Endpoint*"/> > </wsdl:port> > <wsdl:port name="weatherHttpsEndpoint" binding="tns:weatherHttpBinding"> > <http:address location="https://api.example.com:8243/service/v1.0/weather. > *weatherHttpsEndpoint*"/> > </wsdl:port> > </wsdl:service> > . > My proxy config is - > <proxy name="weather" transports="https" > <publishWSDL uri=" > http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL"/> <parameter name= > "ServiceURI">/service/v1.0/weather</parameter> <target> <endpoint> > <address uri="http://wsf.cdyne.com/WeatherWS/Weather.asmx"/> > </endpoint> <outSequence> <send/> </outSequence> </target> </proxy> > > > > What do I need to do to prevent Synapse from adding binding port name to > location so whatever ServiceURI I set is used in WSDL ? I believe the existing behavior is something we have inherited from Axis2. And so far, it hasn't been an issue. You should be able to access the service without putting the binding port name in the URL too. For instance, the URL https://api.example.com:8243/service/v1.0/weather should work without issues. Perhaps an Axis2 expert on the list can inform us if there's a way to prevent Axis2/Synapse from adding the binding port name to the URLs. > > 2. Can I use one proxy declaration to frontend multiple services (possiblt > using "<conditionalRouter") with separate <publishWSDL and target based on > incoming URL ? Is there any example available ? A single proxy can have only one <target> element and one <publishWSDL> element. But it is possible for a single proxy service to front multiple backend services using one of the available router mediators. In fact this is one of the most common use cases for Synapse (e.g. sample 157 -- This sample sends all messages to the same backend service. But it is pretty straight forward to change the configuration so that each route sends messages to a different endpoint.). Thanks, Hiranya > > Thank you in advance for your help. > > -- > Regards, > Vish -- Hiranya Jayathilaka Mayhem Lab/RACE Lab; Dept. of Computer Science, UCSB; http://cs.ucsb.edu E-mail: [email protected]; Mobile: +1 (805) 895-7443 Blog: http://techfeast-hiranya.blogspot.com
