<div dir="ltr">Hi,<div><br></div><div><br></div><div>Thank you very much Pavol for the wonderful reply. It helped a lot.</div><div><br></div><div>I was actually missing <b>.connector (a dot)</b> thats why the connector was not getting  loaded.</div><div><br></div><div><br></div><div><br></div><div>Thanks,</div><div>Anand  </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb 28, 2015 at 4:01 AM, Pavol Mederly <span dir="ltr"><<a href="mailto:mederly@evolveum.com" target="_blank">mederly@evolveum.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>Hello Anand,<span class=""><br>
      <br>
      <blockquote type="cite">The problem  i can think of is in java
        connector we have manifest file, is there anything equivalent in
        .net connector.</blockquote>
      <br></span>
      The ConnectorServer uses Windows Assembly mechanism to discover
      the connectors. I believe this is the code
      (LocalConnectorInfoManagerImpl in ApiLocal.cs)<br>
      <br>
      <tt>FileInfo[] files = directory.GetFiles("*.Connector.dll");</tt><tt><br>
      </tt><tt>foreach (FileInfo file in files)</tt><tt><br>
      </tt><tt>{</tt><tt><br>
      </tt><tt>  Assembly lib = Assembly.LoadFrom(file.ToString());</tt><tt><br>
      </tt><tt>  CollectionUtil.AddAll(_connectorInfo,
        ProcessAssembly(lib));</tt><tt><br>
      </tt><tt>}</tt><tt><br>
      </tt><br>
      The ProcessAssembly methods gathers the type information from the
      assembly, and looks for ConnectorClassAttribute instances. That's
      how it knows that these are ICF Connectors.<br>
      <br>
      ---<br>
      <br>
      In order to help you a bit with creating your own connector, I've
      prepared a sample (empty) connector for you. Please see the latest
      commit to <a href="https://github.com/Evolveum/openicf" target="_blank">Evolveum/openicf
        project</a>.<br>
      <br>
      The connector is in the connectors\dotnet-sample directory.<br>
      <br>
      For building it I use the following two batch procedures - these
      are not part of the commit; please create them manually:<br>
      <br>
      <b>env.bat</b> - sets up an environment:<br>
      <br>
      <tt>set WIX_HOME=C:\Program Files (x86)\WiX Toolset v3.7</tt><tt><br>
      </tt><tt>set Path=%Path%;%WIX_HOME%\bin</tt><tt><br>
      </tt><tt>set OPENICF_HOME=c:\openicf-home</tt><tt><br>
      </tt><br>
      Note that you should have the corresponding software installed
      (WiX Toolset in this case).<br>
      OPENICF_HOME points to a directory where the installation of
      OpenICF/ConnId server is unpacked.<br>
      <br>
      For the building itself I use this one: <b>b.bat</b> :<br>
      <br>
      <tt>c:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
        SampleDotNetConnector.sln /p:Configuration=Release
        /p:ZipRelease=true</tt><br>
      <br>
      After building the connector, I simply unzip the file <b>Build\Sample.Connector-1.4.1.20283.zip</b>
      into the OPENICF_HOME directory (c:\openicf-home) and start the
      connector server.<br>
      <br>
      In midPoint I create the connector host object:<br>
      <br>
      <small><tt><connectorHost
          xmlns=<a href="http://midpoint.evolveum.com/xml/ns/public/common/common-3" target="_blank">"http://midpoint.evolveum.com/xml/ns/public/common/common-3"</a></tt><tt><br>
        </tt><tt>              
          oid="91919191-76e0-59e2-86d6-44cc44cc4400"</tt><tt><br>
        </tt><tt>               version="0"></tt><tt><br>
        </tt><tt>   <name>ICF Connector server on
          localhost:8759</name></tt><tt><br>
        </tt><tt>   <hostname>127.0.0.1</hostname></tt><tt><br>
        </tt><tt>   <port>8759</port></tt><tt><br>
        </tt><tt>   <sharedSecret>...</sharedSecret></tt><tt><br>
        </tt><tt></connectorHost></tt><tt><br>
        </tt></small><br>
      And when I do the discovery operation on this connector host,
      midPoint creates new Connector object named "ICF
      Org.IdentityConnectors.Sample.SampleConnector v1.4.1.20283 @ICF
      Connector server on localhost:8759".<br>
      <br>
      Then I can import a very simple resource definition that uses this
      sample connector:<br>
      <br>
      <small><tt><resource
          xmlns=<a href="http://midpoint.evolveum.com/xml/ns/public/common/common-3" target="_blank">"http://midpoint.evolveum.com/xml/ns/public/common/common-3"</a></tt><tt><br>
        </tt><tt>         
xmlns:icfs=<a href="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3" target="_blank">"http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"</a></tt><tt><br>
        </tt><tt>         
          xmlns:c=<a href="http://midpoint.evolveum.com/xml/ns/public/common/common-3" target="_blank">"http://midpoint.evolveum.com/xml/ns/public/common/common-3"</a></tt><tt><br>
        </tt><tt>         
          xmlns:q=<a href="http://prism.evolveum.com/xml/ns/public/query-3" target="_blank">"http://prism.evolveum.com/xml/ns/public/query-3"</a>></tt><tt><br>
        </tt><tt>   <name>Sample</name></tt><tt><br>
        </tt><tt>   <connectorRef></tt><tt><br>
        </tt><tt>      <filter></tt><tt><br>
        </tt><tt>         <q:equal></tt><tt><br>
        </tt><tt>           
          <q:path>c:connectorType</q:path></tt><tt><br>
        </tt><tt>           
<q:value>Org.IdentityConnectors.Sample.SampleConnector</q:value></tt><tt><br>
        </tt><tt>         </q:equal></tt><tt><br>
        </tt><tt>      </filter></tt><tt><br>
        </tt><tt>   </connectorRef></tt><tt><br>
        </tt><tt>   <connectorConfiguration
xmlns:icfc=<a href="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/connector-schema-3" target="_blank">"http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/connector-schema-3"</a>></tt><tt><br>
        </tt><tt>      <icfc:configurationProperties
xmlns:gen780=<a href="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/bundle/Sample.Connector/Org.IdentityConnectors.Sample.SampleConnector" target="_blank">"http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/bundle/Sample.Connector/Org.IdentityConnectors.Sample.SampleConnector"</a>></tt><tt><br>
        </tt><tt>        
          <gen780:Username>administrator</gen780:Username></tt><tt><br>
        </tt><tt>        
<gen780:Password><clearValue>secret</clearValue></gen780:Password></tt><tt><br>
        </tt><tt>        
          <gen780:Property1>P1</gen780:Property1></tt><tt><br>
        </tt><tt>        
          <gen780:Property2>P2</gen780:Property2></tt><tt><br>
        </tt><tt>      </icfc:configurationProperties></tt><tt><br>
        </tt><tt>   </connectorConfiguration></tt><tt><br>
        </tt><tt></resource></tt><tt><br>
        </tt></small><br>
      Of course, it does nothing, because the sample connector even does
      not provide any schema. (I.e. Test connection from midPoint passes
      first three steps and fails the fourth, related to connector
      schema.) The only indication that something is going on is the
      diagnostic messages that the sample connector writes to the
      console:<br>
      <br>
      <small><tt>Press q to shutdown.</tt><tt><br>
        </tt><tt>Press t for a thread dump.</tt><tt><br>
        </tt><tt>Init called.</tt><tt><br>
        </tt><tt>CheckAlive called</tt><tt><br>
        </tt><tt>Schema called.</tt><tt><br>
        </tt><tt>CheckAlive called</tt><tt><br>
        </tt><tt>Schema called.</tt><tt><br>
        </tt><tt>CheckAlive called</tt><tt><br>
        </tt><tt>Schema called.</tt><tt><br>
        </tt><tt>CheckAlive called</tt><tt><br>
        </tt><tt>Test called</tt><tt><br>
        </tt></small><br>
      Anyway, I hope this will allow you to get started developing your
      own connector.<br>
      <br>
      Best regards,<br>
      Pavol<div><div class="h5"><br>
      <br>
      On 27. 2. 2015 16:41, Anand Kothekar wrote:<br>
    </div></div></div><div><div class="h5">
    <blockquote type="cite">
      <div dir="ltr">Hi,
        <div><br>
        </div>
        <div>I checked the error logs but there was no error.</div>
        <div><br>
        </div>
        <div>The problem  i can think of is in java connector we have
          manifest file, is there anything equivalent in .net connector.</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>Thanks, </div>
        <div>Anand Kothekar</div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Fri, Feb 27, 2015 at 8:46 PM, Pavol
          Mederly <span dir="ltr"><<a href="mailto:mederly@evolveum.com" target="_blank">mederly@evolveum.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000">
              <div>Hello Anand,<br>
                <br>
                I don't know of any reference document for that.<br>
                <br>
                Have you got any error messages in ConnectorServer log?<br>
                <br>
                Best regards,<br>
                Pavol
                <div>
                  <div><br>
                    <br>
                    On 27. 2. 2015 12:45, Anand Kothekar wrote:<br>
                  </div>
                </div>
              </div>
              <blockquote type="cite">
                <div>
                  <div>
                    <div dir="ltr">Hi,
                      <div><br>
                      </div>
                      <div>I have a requirement to write a custom .net
                        connector, do you have any reference document
                        which i an refer to write it.</div>
                      <div><br>
                      </div>
                      <div>I have written some c# code and implemented
                        the connector interfaces but when i deploy the
                        connector dll on .net connector server midpoint
                        connector host is not able to discover the
                        connector. </div>
                      <div><br>
                      </div>
                      <div>So I think I might be missing something, a
                        quick document on this will be a great help.<br>
                      </div>
                      <div><br>
                      </div>
                      <div><br>
                      </div>
                      <div>Thanks</div>
                      <div>Anand</div>
                    </div>
                    <br>
                    <fieldset></fieldset>
                    <br>
                  </div>
                </div>
                <pre>_______________________________________________
midPoint mailing list
<a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a>
<a href="http://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
              </blockquote>
              <br>
            </div>
            <br>
            _______________________________________________<br>
            midPoint mailing list<br>
            <a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a><br>
            <a href="http://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
midPoint mailing list
<a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a>
<a href="http://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
    </blockquote>
    <br>
  </div></div></div>

<br>_______________________________________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><br>
<a href="http://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
<br></blockquote></div><br></div>