14 Replies Latest reply on Sep 6, 2016 4:21 PM by John Groft

    WCF Web Services and the EPDM API

    John Groft

      I've created a WCF web service that uses the EPDM API to extract files from the vault.  It works fine on my local machine where I'm logged into the vault, but as soon as I put it on a web server running IIS, the LoginEx() function times out.  Interestingly, it doesn't "fail."  No error is returned - at least not within a minute.  It just never finishes.

       

      I've read a few posts on this forum which seem to suggest that, in order to do this, I need to have a user on logged into the vault on the web server.  I've tried that without much luck.  Has anyone else run into this particular issue?  I've seen one other post where the developer had a similar issue - but that seemed to be with the SolidWorks API - not the EPDM one.  I've reached out to that person, but it's an old post and I have not received a response.

       

      Any insights that anyone can provide are appreciated.  I'm stuck at the moment and I'm not sure how to resolve this.

        • Re: WCF Web Services and the EPDM API
          Artem Taturevych

          Hi John,

           

          I would suggest to read the Web2 Installation Guide from SolidWorks 2016 documentations. It is explained how to host the Web2 service under the IIS. I believe the Web2 utilizes the PDM APIs and it is hosted under the IIS which is similar to your case. So you can use instructions as a help to host your server.

           

          Alternatively you might try to host it under the Windows Service (you may need to play with the options in Log On tab on Windows Service).

           

          Thanks,
          Artem

            • Re: WCF Web Services and the EPDM API
              John Groft

              I will certainly have a look at that because, honestly, this one has me truly stumped at the moment.  I suspect it won't be much help, but you never know.

               

              By the way, the one thing I didn't mention here is that LoginEx() appears to be the only API function that isn't working.  The few commands that don't require a login (such as GetVersion and IsLoggedIn) work just fine.  I can't really try other methods that DO require login because I can't get past the Login method.

            • Re: WCF Web Services and the EPDM API
              Jesse Seger

              Just try Login or LoginAuto for now and see if that works.

                • Re: WCF Web Services and the EPDM API
                  John Groft

                  Sorry, I probably should have mentioned that I did try both Login and LoginAuto.  I've tried them both with and without a user already logged in manually on the server .  Those methods both actually return a "Can't open database" error.  LoginEx just never finishes.  I don't really know *why* Login and LoginAuto can't open the database.  There's no more information that I can see.  And, of course, as I said, GetVersion and IsLoggedIn can both work, so the API is clearly working.

                • Re: WCF Web Services and the EPDM API
                  John Groft

                  Out of curiosity, has anyone else successfully done this?  (i.e. Host a web service using the EPDM API.)  I would feel a whole lot better just knowing that it CAN be done and that I'm simply doing something wrong.  Right now, I'm not really even sure if the web service is a viable option.  The other post I mentioned seems to suggest that it's possible, but I'd love to know that for sure.  My fear is that the ability to do this may be turned off by design.

                  • Re: WCF Web Services and the EPDM API
                    John Groft

                    I did ultimately resolve this issue.  As I suspected, it was a mistake on my part - permissions.

                     

                    After taking a closer look at the web services defined by SolidWorks, I noticed that their own web services use the NetworkService account in their application pools.  I changed my application pool to use NetworkService and the issue went away.

                     

                    It still doesn't really explain why the method timed out instead of failing with a specific error, but it works now.

                     

                    John