Last post Mar 13, 2019 02:25 PM by jzero
Mar 08, 2019 12:24 AM|jzero|LINK
I´m not sure if my issue is related to start with a Project instead of a WebSite or if it is related to try MVC in place o WebForm.
I have to consume about 24 diferent webservices and my issue is how can I organize all these webservices, to simplify they are 6 webservices in 4 diferent groups (North, South, East and West) which means states located by region.
In WebSite/WebForm, I just add a reference and point each webservice to same folder, no issue, and classes are generated at runtime. So here there is just 4 folders and 6 groups of files representing each webservice
Now in Project/MVC, when I add a reference (wsdl file), each webservice should be in a dedicated folder and a Reference.map and Reference.vb is created, this forces to have 24 folders one for each webservice. Of course I understand that due to fixed file
On the other hand, looks after all done, I can move files, but still have to maintain one folder per webservice.
So, Is there a better way to organize these References, Folders and Files?
Is there any problem if I move generates files to another place in a way that best suit to have files organized like North, South, East and West? Doing this (move files) I notice, class if found on Import statement but Icon representation on Solution Explorer
will not be same
finally what am I missing here?
Mar 08, 2019 02:59 AM|Ackerly Xu|LINK
WebServices References are generated by visual studio automatically, it seems that you couldn't specify a folder for a generated service.
My suggestion is that you could use namespace as a workaround.
For example , you have 24 services, you could organize namespace for the 24 services,
South.Service1 for the first service , South.Service2 for the second service , South.Service3 for the third service ...
Mar 08, 2019 08:03 PM|jzero|LINK
In fact the name I give to reference will be used as Folder name.
Using your suggestion is what I have in WebSite/WebForms, so if I set South.Service1, VS will create 2 nested folders like South\Service1, inside Service1 there will be files like
.discomap and .wsdl, not a single "reference.map" or "reference.vb" or even "reference.cs"
So this was the way VS2005/2008 created webservice references, if your ws url was supposed be
www.threasure.south.gov service reference name proposed was url reverted like gov.south.threasure.www where each string was an nested folder and on last folder
.discomap and .wsdl
But now, seems very different, I just do not understand why such difference.......
Such behaviour can be changed?
Mar 11, 2019 01:07 AM|Ackerly Xu|LINK
I'm afraid the format of the generated files after adding service references.
Maybe you could consider using ChannelFactory to customize your own client proxy.
Mar 13, 2019 12:48 AM|jzero|LINK
Try create a Web Site, Add Service Reference, click Advanced button, then click Add Web Reference, and point to any webservice like PayPal (https://www.paypalobjects.com/wsdl/PayPalSvc.wsdl),
pay attention to Web Reference Name suggested, do not change, then click Add Reference
Now do same but this time create a Project, you will see same WebReference suggested, do not change, but compare folder with WebSite "folders"
After does channelfactory can realy help?
Could you please provide and example?
By the way, the example (North, South, East, West) was just to simplify, in reality there is 6 webservices per State in a single Country.
Also I have a doubt if I can just delete file for those cases where we have to download *.wsdl file, then add reference pointing to local file
Mar 13, 2019 01:52 AM|Ackerly Xu|LINK
I am not clear about how to change the service generated by adding service reference.
ChannelFactory could generate service client manually, which means you don't need to add reference to service.
But it requires that you have the service contract and data model of your service and write the service interface , data model all by your self ,since you have many service , it is not easy.
About the generated files after adding service reference, in fact , if you only want to use the service client, you could remove all the other files except Reference.vb, I don't know why vb project generated so many files, but after I removed all the
other files, I still could call the service.
You could have a try , this means if your have 50 service , you only need to maintain 50 files.
Mar 13, 2019 02:25 PM|jzero|LINK
I know my scenario is really weird, but would be good if generated files was created in same way independent if we are working with WebSite or Project. Here I mean folder structure.