1
votes

I´m trying to make a proxy using WSO2 ESB to consume services like "services/UserIdentityManagementAdminService?wsdl" and scim like ""wso2/scim/Users" in wso2 IS, (I want to balance a IS in HA with a https address Endpoint) , I have a proxy and I can consume scim but when I try to get wsdl wso2 esb just sent a log like:

INFO {org.apache.synapse.mediators.builtin.LogMediator} - To: /services/PRX_SC_IS_SERVICES/services/UserInformationRecoveryService?wsdl, MessageID: urn:uuid:10516b34-8004-4c70-9d4c-61957e4d9147, Direction: request, Envelope: {org.apache.synapse.mediators.builtin.LogMediator}

I think that the problem is that in the URL use services after the proxy name because when I call another URL I haven´t problem.

My Proxy Config:

<proxy xmlns="http://ws.apache.org/ns/synapse"
   name="PRX_SC_IS_SERVICES"
   transports="http"
   statistics="disable"
   trace="disable"
   startOnLoad="true">
<target>
    <inSequence>
        <property xmlns:ns="http://org.apache.synapse/xsd"
               name="Authorization"
               expression="fn:concat('Basic ', base64Encode('admin:admin'))"
               scope="transport"/>
        <send>
            <endpoint key="IS_EP_HTTPS"/>
        </send>
    </inSequence>
    <outSequence>
        <send/>
    </outSequence>
</target>
<description/>
1

1 Answers

0
votes

With WSO2 you can´t do a generic proxy and you can´t use the word services after a proxy name. The easy way to do this is install a Nginx and use it like proxy reverse with a conf like this:

    upstream https.is{
        server IP_IS01:9446;
        server IP_IS02:9446;
    }  

  server {
        listen       8443 ssl;
        server_name IP_HOST;

        ssl_certificate      ssl.crt;
        ssl_certificate_key  ssl.key;

        location / {
                proxy_pass              https://https.is/;
                proxy_set_header        Host   $http_host;
        }
    }

Another thing that you can do is move in the ESB the context services (axis2.xml and carbon.xml) to another context and deploy two APIs that rewrite the context /services and /wso2/scim, because now the proxy services should be redirect to another context and for example /services/UserAdmin to a IS wsdl. API example:

  <resource methods="POST" uri-template="/PRX*">
  <inSequence>
     <send>
        <endpoint>
           <address uri="http://HOST_ESB:PORT_ESB/newservicescontext/"></address>
        </endpoint>
     </send>
  </inSequence>
  <outSequence>
     <send></send>
  </outSequence>