locked
Utilizing Web Services inside Visual Studio RRS feed

  • Question

  • User-1078520054 posted

    We are using SVN as our code repository.  We have a developer building web-references and service-references (as named in Visual Studio) and then our main application is to utilize those references, which this same developer has then incorporated into his Visual Studio main application environment. 

    When he does a check-in of his code to the repository and a new developer comes along and does an update of the repository to get all the code, should he be able to compile without manually adding a web-reference to his project? 

    I am under the impression when said developer checks in his code, all I need to do is an "update" to the repository and, assuming he has done everything on his end correctly, should be able to just code without specifically adding a new web-reference. 

    What is happening now is said developer has done a check-in of his main application (with what he claims is all the necessary files), but when I do an "update" in my project, I am getting errors in relation to the web/service references, as Visual Studio doesn't seem to know updates to them have been made. 

    Is the issue I need to do something on my end, or does the web-service developer need to check in the proper files?

    Wednesday, July 31, 2013 8:56 AM

Answers

  • User-1078520054 posted

    The end result was we were missing the commit of the *.csproj file, so each individual envrionment wasn't knowing the service reference was part of the project.  Once we had the developer commit this file, everything worked....

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 1, 2013 8:12 AM

All replies

  • User220959680 posted

    Client application source should be different from Web Service source.

    From the description it is evident that you are using SOAP (Simple Object Access Protocol) based web services, which requires client service reference (proxy).

    When the service is hosted on IIS there is no dependency on service source check out hassle. Client application can add service reference by pointing to the service url that is hosted on the central web server.

    when both the service and client applications are under development phase

    • checkout the service source first and build the service locally on your machine.
    • Then run the service locally i.e., visual studio IIS express
    • checkout the client application source and add the service reference by pointing to the service url that is running locally.
    • I am under the impression when said developer checks in his code, all I need to do is an "update" to the repository and, assuming he has done everything on his end correctly, should be able to just code without specifically adding a new web-reference. 
      service reference will be out of sync. It requires to add them or update.
    • Above suggested above is better one.
    Wednesday, July 31, 2013 9:49 AM
  • User-1078520054 posted

    So you are saying each developer needs to install the service reference manually by going into Visual Studio, right mouse clicking on Service References and Clicking on Add Service Reference? 

    But why do I need to get the Service Reference code, as I am not developing anything in that, just using the service reference's functions in the main application?  Shouldn't I be able to simply change where the service reference points in a web-config in the main project and not have to run it locally to use its functions?  Shouldn't I simply be able to change the endpoint in the web-config?

    Wednesday, July 31, 2013 9:59 AM
  • User220959680 posted

    So you are saying each developer needs to install the service reference manually by going into Visual Studio, right mouse clicking on Service References and Clicking on Add Service Reference? 

    Yes, above is True when the web service is NOT hosted on the server.

    But why do I need to get the Service Reference code, as I am not developing anything in that, just using the service reference's functions in the main application?

    The service references contains metadata for the web service and the proxy class that allows the client to interact with the web service.

    As the web service is NOT hosted on to the server (running locally on your machine), client does not know the current state of the web service i.e., whether any new methods added or existing ones updated or types changed etc. 

    As mentioned in the above post either the web service should be hosted to the web server to add the service reference to the client application without having to checkout the web service source and run the service locally, then adding the reference to the client application.

    Shouldn't I be able to simply change where the service reference points in a web-config in the main project and not have to run it locally to use its functions?  Shouldn't I simply be able to change the endpoint in the web-config?

    Yes, its straight forward when the service is hosted on the server.

    when ever the developer updated the service source , it is required to publish the updated service to the server. So that your client can simply add the service reference by pointing to the service URL i.e., xyx.xyx.svc

    Wednesday, July 31, 2013 10:26 AM
  • User-1078520054 posted

    The end result was we were missing the commit of the *.csproj file, so each individual envrionment wasn't knowing the service reference was part of the project.  Once we had the developer commit this file, everything worked....

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 1, 2013 8:12 AM