mps client wrapper.

Last post 07-21-2009 8:14 AM by NisseP. 15 replies.

Sort Posts:

  • mps client wrapper.

    07-09-2008, 7:50 AM
    • Member
      19 point Member
    • morten_bg
    • Member since 05-21-2007, 7:58 AM
    • Norway
    • Posts 31

    Hi!

    I have reached the point where I want to use the mpf client wrapper, but i have som trouble using it on my namespaces on the MPS.

    I use the following code:

    public XmlDocument wrappingme()

    {

    Microsoft.Provisioning.Client.Wrapper.
    Request wrappme = new Microsoft.Provisioning.Client.Wrapper.Request();

     

    XmlDocument xmlrequest = new XmlDocument();

    xmlrequest = wrappme.BuildBaseRequest("Simple Provider CS", "joinstring");

    XmlElement elmdata = xmlrequest.CreateElement("data");

    XmlElement newnode = xmlrequest.CreateElement("stringA");

    XmlText txtnew = xmlrequest.CreateTextNode("ad1.infostorm.no");

    newnode.AppendChild(txtnew);

    elmdata.AppendChild(newnode);

    newnode = xmlrequest.CreateElement(
    "stringB");txtnew = xmlrequest.CreateTextNode("fghfgh");

    newnode.AppendChild(txtnew);

    elmdata.AppendChild(newnode);

    wrappme.SubmitRequest(xmlrequest, true);

    Response.Write(wrappme.ErrorString.ToString());

    return xmlrequest;

    }

     

    But i always get the responce: "Calling user not authorized for invoking trusted method"

    My app is using the the MPSWebServiceAcctPool

    Does anyone know what im doing wrong?

    The mps client wrapper does not support authentication. How do I implement this?

    I realy appreciate some help. 

    Morten

     

     

     

    Filed under: , ,
  • Re: mps client wrapper.

    01-12-2009, 5:46 AM
    • Member
      32 point Member
    • NisseP
    • Member since 12-11-2008, 7:34 AM
    • Posts 27

     Hi

    Do you have any information about using the MPS .NET communication  at all? I'm trying to use something else than provtest.exe to make changes in my hosting enviroment.
    Sorry for the thread hijacking :)

     Regards
    Nisse Pettersson

    Regards
    Nisse Pettersson
  • Re: mps client wrapper.

    05-26-2009, 2:38 PM
    • Member
      26 point Member
    • tsch
    • Member since 05-26-2009, 6:34 PM
    • Auburn Hills, MI
    • Posts 20

    Hi - I am in the same position. I am trying to create a custom C# console application to run on one domain and use Microsoft.Provisioning.Client.Wrapper.Request to submit requests to a hosted Exchange server in another Domain on the same LAN.

    I am looking for some help in understanding and setting up the security for developer environments and environments that will run the code to use something else than provtest.exe to make changes in my hosting enviroment.

    --------------------
    Tom Schulte
    Senior System Engineer
    Plex Systems, Inc.
    http://www.plex.com
  • Re: mps client wrapper.

    05-27-2009, 6:31 PM
    • Participant
      1,134 point Participant
    • mkostersitz
    • Member since 04-13-2004, 1:18 PM
    • somewhere in Europe (mostly in Austria)
    • Posts 248
    • Moderator
    I would not use he Client.Wrapper to submit HMC 4.5 requests. In your scenario it would be more beneficial to use the MPSWS Web services. If you want to use the MPS Client instead of the web services you should use MPF Client Interop directly rather then the Client.Wrapper code which is slightly outdated and based on .NET 1.1. When you create the request create a node and pass in the credentials of the provisioning user. Ideally you grab the credentials from the calling Web Frontend Basic Auth Token or from the WebForm Authentication. If the calling Application is not able to provide valid credentials in the HMC domain I recommend using a stored credential (encrypted of course :-) ) and stick that into the properties of the node.) More details about the node and MPS Security is in the MPS SDK here http://technet.microsoft.com/en-us/library/dd279090.aspx HTH Mike
    Mike Kostersitz
    Microsoft Customer Support Services

    This posting is provided "AS IS" with no warranties, and confers no rights. Script samples are subject to the terms at http://www.microsoft.com/info/cpyright.htm"
  • Re: mps client wrapper.

    05-28-2009, 7:55 AM
    • Member
      32 point Member
    • NisseP
    • Member since 12-11-2008, 7:34 AM
    • Posts 27

     

    tsch:

    Hi - I am in the same position. I am trying to create a custom C# console application to run on one domain and use Microsoft.Provisioning.Client.Wrapper.Request to submit requests to a hosted Exchange server in another Domain on the same LAN.

    I am looking for some help in understanding and setting up the security for developer environments and environments that will run the code to use something else than provtest.exe to make changes in my hosting enviroment.

    I'm maby not the best suited to answer your question but I can say that i'm using the MPS SDK to query the hosted exchange enviroment. If you want i can supply you with some info and code. There might be better solutions like using the webbservice instead of the client wrapper. My application is for my enviroment and it works. Just need to find time to develop :)

    Regards
    Nisse Pettersson
  • Re: mps client wrapper.

    05-28-2009, 9:06 AM
    • Member
      26 point Member
    • tsch
    • Member since 05-26-2009, 6:34 PM
    • Auburn Hills, MI
    • Posts 20

    Mike - thank you very much for taking the time to point me in this direction. I am now attacking the problem with renewed hope.

    --------------------
    Tom Schulte
    Senior System Engineer
    Plex Systems, Inc.
    http://www.plex.com
  • Re: mps client wrapper.

    05-28-2009, 9:07 AM
    • Member
      26 point Member
    • tsch
    • Member since 05-26-2009, 6:34 PM
    • Auburn Hills, MI
    • Posts 20

    Nisse -

     The Web Services sounds like the right approach for my situation. I woiuld be very glad of the info and code samples you offer.

    --------------------
    Tom Schulte
    Senior System Engineer
    Plex Systems, Inc.
    http://www.plex.com
  • Re: mps client wrapper.

    05-28-2009, 9:25 AM
    • Member
      32 point Member
    • NisseP
    • Member since 12-11-2008, 7:34 AM
    • Posts 27

     

    tsch:

    Nisse -

     The Web Services sounds like the right approach for my situation. I woiuld be very glad of the info and code samples you offer.


    First of all you need to have the machine you wish to compile/develop your code on a memeber of the Hosted Exchange domain. Then you need to install the MPS SDK for more info read this thread.
    http://forums.asp.net/t/1370201.aspx

    Then you need to add a new reference in you project and point out the PROVCLIENTlib reference.
    I've made a function for running the command.

            public string SubmitTrustedRequest(string dataXmlString)
            {
                PROVCLIENTLib.ProvEngineClientClass MPSComClient = new PROVCLIENTLib.ProvEngineClientClass();
                string s = MPSComClient.SubmitTrustedRequest(dataXmlString);
                return s;
            }

    The XML-string is as the XML-files you edit and pass to provclient.exe. Happy hunting!
    You can read more about my project on http://www.nissesblog.se/post/2009/05/14/Microsoft-Provisioning-System(MPS)-control-panel.aspx

    Nisse Pettersson

    Regards
    Nisse Pettersson
  • Re: mps client wrapper.

    05-28-2009, 9:39 AM
    • Participant
      1,134 point Participant
    • mkostersitz
    • Member since 04-13-2004, 1:18 PM
    • somewhere in Europe (mostly in Austria)
    • Posts 248
    • Moderator

    That codesample is a good start for writing a GUI around Provtest functionality. When calling the web services you can install the sourcecode for the SampleProvisioningUI from the \Samples\Provisioning Folder on the HMC ISO image and see how it is done in that application, then replicate the code into your winforms app. Or you find the SampleProvisioningUI a good point to start from and rework it to suit your needs.

    There are also 3rd Party Frameworks out there which you can purchase for a one time fee and then build on that if that is of interest.

     Mike

    Mike Kostersitz
    Microsoft Customer Support Services

    This posting is provided "AS IS" with no warranties, and confers no rights. Script samples are subject to the terms at http://www.microsoft.com/info/cpyright.htm"
  • Re: mps client wrapper.

    05-28-2009, 9:40 AM
    • Contributor
      4,166 point Contributor
    • DmitriG
    • Member since 08-26-2004, 5:41 PM
    • Toronto
    • Posts 1,087

    FYI.

     All solution web services use same/similar code to execute MPS requests.

    Regards,

    Dmitri Gaikovoi
  • Re: mps client wrapper.

    05-28-2009, 9:49 AM
    • Member
      32 point Member
    • NisseP
    • Member since 12-11-2008, 7:34 AM
    • Posts 27

    DmitriG:

    FYI.

     All solution web services use same/similar code to execute MPS requests.

     

    So in other terms I'ts just a matter of taste if you wish to use the webserice or the library provided by the SDK?

    Regards
    Nisse Pettersson
  • Re: mps client wrapper.

    05-28-2009, 10:06 AM
    • Participant
      1,134 point Participant
    • mkostersitz
    • Member since 04-13-2004, 1:18 PM
    • somewhere in Europe (mostly in Austria)
    • Posts 248
    • Moderator

    I think what Dimitri was saying is more that the web services are more consistent and better typed  in terms of the symantics than the pure XML request XMLDom creation tactics required to call the MPS Client directly.

     Another benefit of the Web services is that you are dealing with .NET Objects rather than XML documents and COM Interop :-)

     

    Mike

    Mike Kostersitz
    Microsoft Customer Support Services

    This posting is provided "AS IS" with no warranties, and confers no rights. Script samples are subject to the terms at http://www.microsoft.com/info/cpyright.htm"
  • Re: mps client wrapper.

    05-28-2009, 10:15 AM
    • Member
      32 point Member
    • NisseP
    • Member since 12-11-2008, 7:34 AM
    • Posts 27

    mkostersitz:

    I think what Dimitri was saying is more that the web services are more consistent and better typed  in terms of the symantics than the pure XML request XMLDom creation tactics required to call the MPS Client directly.

     Another benefit of the Web services is that you are dealing with .NET Objects rather than XML documents and COM Interop :-)

     

    Mike

     

    Ok, so I should take a look at the web serivices instead of using the XML request. The XML-request are a headache to workwith and generating. Loads of ambgious code and it's becomming a bloatware :)
    Thanks for the info!

     

    Regards
    Nisse Pettersson
  • Re: mps client wrapper.

    05-28-2009, 11:05 AM
    • Contributor
      4,166 point Contributor
    • DmitriG
    • Member since 08-26-2004, 5:41 PM
    • Toronto
    • Posts 1,087

    NisseP:
    The XML-request are a headache to workwith and generating.

     

    Not at all if you do not use XMLDom, old-fashion string concatenation works very well. If you want to stick with solutions web-services remember that these web services don't cover whole solutions MPS namespaces and methods - only things that MS thinks is suitable for your consumption. In addition, these web services is another layer of code around MPS and as a result - another layer of bugs (just check what was fixed after HMC 4.0 release),

    Regards,

    Dmitri Gaikovoi
  • Re: mps client wrapper.

    05-29-2009, 4:30 PM
    • Member
      26 point Member
    • tsch
    • Member since 05-26-2009, 6:34 PM
    • Auburn Hills, MI
    • Posts 20

    Thank you all for your help. I am now using using the WS from one domain to send in my requests from another. I am succeeding, for instance, in creating OUs over there with code like this:

    Plexus.ActiveDirectory.com.dev_pass.ah_test_mps.CreateOrganizationRequest createOrganizationRequest = new Plexus.ActiveDirectory.com.dev_pass.ah_test_mps.CreateOrganizationRequest();

    Plexus.ActiveDirectory.com.dev_pass.ah_test_mps.CreateOrganizationRequestData orgdata = new Plexus.ActiveDirectory.com.dev_pass.ah_test_mps.CreateOrganizationRequestData();

    orgdata.preferredDomainController = "_______.com";

    orgdata.container = "LDAP....DC=com";

    orgdata.name = "tsch2";

    orgdata.planName = "BusinessPlan";orgdata.description = "tsch test";

    createOrganizationRequest.Data = orgdata;

    Plexus.ActiveDirectory.com.dev_pass.ah_test_mps.CreateOrganizationResponse createOrganizationResponse = svc.CreateOrganization(createOrganizationRequest, true);

     

    However, on creating Users I am running into the datatype issues described on threads http://forums.asp.net/p/1353264/3197237.aspx and
    http://forums.asp.net/t/1325714.aspx

     So, I consider the general how-to-make-it work-at-all issue resolved for me, and I'll be watching the other threads for help in the datatype issue for properties.

    --------------------
    Tom Schulte
    Senior System Engineer
    Plex Systems, Inc.
    http://www.plex.com
Page 1 of 2 (16 items) 1 2 Next >