Hiranya - Thanks for your reply. 1. It would be really helpful if we have a solution to remove the binding port names from URL. Without it, I don't see us adopting this solution as we will be sharing the WSDL URL with our partners and they won't be able to access the service using the location provided in the WSDLs. Btw, is there a way to customize "publishWSDL" to execute sequence before WSDL is sent back ? This way we can probably execute XSLT to remove the binding port names.
2. I tried CBR based on the example. Proxy is created fine and WSDL can be accessed. But when I post a request, I get error "The service cannot be found for the endpoint reference (EPR) /soap/CBRProxy". Here is my proxy config. Pls let me know if I messed up anything - * <proxy name="CBRProxy" xmlns="http://ws.apache.org/ns/synapse <http://ws.apache.org/ns/synapse>" transports="http"> <target> <inSequence> <conditionalRouter continueAfter="false"> <conditionalRoute breakRoute="false"> <condition> <match xmlns="" type="header" source="zip" regex="12345"/> </condition> <target sequence="cnd1_seq"/> </conditionalRoute> </conditionalRouter> </inSequence> <outSequence> <log level="custom"> <property name="node" value="sending to east coast server"/> </log> <send/> </outSequence> </target> <publishWSDL uri="http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL <http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL>"/> </proxy>* . * <sequence name="cnd1_seq"> <log level="custom"> <property name="MSG_FLOW" value="Condition (I) Satisfied"/> </log> <sequence key="send_seq"/> </sequence> <sequence name="send_seq"> <log level="custom"> <property name="DEBUG" value="Condition Satisfied"/> </log> <send> <endpoint name="simple"> <address uri="http://wsf.cdyne.com/WeatherWS/Weather.asmx <http://wsf.cdyne.com/WeatherWS/Weather.asmx>"/> </endpoint> </send> </sequence>* . Thanks for your help. On Wed, Nov 19, 2014 at 8:55 PM, Hiranya Jayathilaka <[email protected]> wrote: > 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 > > -- Regards, Vish Vishvjit Khalipe
