Visual Studio does not generate client proxy code when adding service reference - c#

I have a WF [Workflow Foundation] project and when I try adding a service reference [Visual Studio 2013-Target Framework is 4.5.1] to it the generated reference code doesn't contain the client proxy code. I tried adding a service reference to other non WF projects [Library projects] and it works fine and the reference.cs contains the Client proxy code. Why Visual Studio doesn't generate client proxy for WF projects? If the facility is not there then obviously I am taking the wrong approach. How can I use a WCF method inside my CodeActivity?
Just to remind you that this is not the duplicate of the following thread :
Service reference not generating client types

Instead of a simple Reference.cs file Visual Studio kindly adds 7 more files to the service reference folder. When I recompile the project and build it all the methods of my WCF service appeared on the toolbox [and became available] and now I can use them in my Work Flows.

Related

Update service reference - Server Refused 127.0.0.1:Port

My project has a bunch of projects and some of them consume a WCF one that is in the solution... Every now and then I have to update the service reference and i always get the same message saying that the server actively refused to answer as if there was no service there...
First I start debugging only the WCF project and test it using the WCF Test Client, and everything is fine...
Then, I open another VS instance, without closing the first one, open the same solution (again, not closing the first), start the WCF project, go back to instance 1, and update the service reference without a problem...
I think this is not how it's supposed to work... why can't VS start the WCF project, update the reference and then go on its way? is there a config i'm missing? perhaps something that another team member might have screwed-up in the past?!?
Details:
VS 2015
All projects on the same solution
All projects using same framework version
All projects using same architecture ref (x64)
In your situation (WCF project part of a solution including service consumers) I would not use a service reference. Service references are designed for when you are calling a service over which you have no control and to which you have no access.
You can call the service directly using ChannelFactory<T>.CreateChannel() - this removes the need for service references altogether and makes your code simpler and more readable.

Adding a service reference using a WSDL which contains links that 'could not be resolved'

I need to add a service reference using a WSDL supplied by a customer. The WSDL contains references to their WCF web service which I cannot see from my development machine. The reference is resolvable on our acceptance environment but I cannot install Visual Studio there.
I thought the point of the WSDL was that it contained all the information for VS to generate the classes necessary to talk to the WS (even without direct access to the WS).
Have have 2 questions:
Is it possible to add this WSDL to my C# project without visibility to their WS
otherwise
Is it possible to generate the classes from the environment that does have direct access to the WS, without installing VS? Maybe by just installing the svcutil.exe (but I imagine this to0l will also require VS)

Error when trying to generate service reference from wsdl

i got a folder with a WSDL file (and all the xsd files related to it) but i can't seem to generate a web service from it using the "Add service reference" option in VS2013 (also tried in 2008 just to test). I'm using .net 4.0.
i get multiple error such as:
Custom tool error: The global type ('WarningType') has been defined in both
'file:///D:/WSDL/AMA/2011Y/chameleon/AMA_CommonTypes.xsd' and
'file:///D:/WSDL/IATA/2010.1/chameleon/IATA_CommonTypes.xsd'.
They are different at './simpleContent/extension/#base'.
so, i was advised to use "Add Web reference" tool.
this works for some reason. i get no errors now.
But, the problem is that i found out that a web reference do not support WS-Security /WS-Adressing
(someone wrote this as a comment in how to add SOAP Security header) and i MUST specify in the header those elements.
Also, i keep reading not to use a web reference since this is an old technology.
So, does anyone know how to solve the errors I'm getting ?
There are multiple tools that generate service proxy objects. Apart from using Add Service Reference you can use command line tool svcutil.exe which is included as part of the visual studios installation for generating service objects.
Here is how to do this
http://msdn.microsoft.com/en-us/library/ff623148.aspx
This alternative command line approach will help you resolve issue related to WS-Security / WS-Adressing.

Cannot instantiate objectVO class from another project from WCF Service Library project even though they are in the same solution

I've been trying to create a webService on a .NET platform using Visual Studio's WCF Service Library project template. I noticed that when I tried to use a VO object from another project file within the same solution... programatically, the compiler has no issues and runs fine... but when I call the webService, it will stop the application prematurely.
I've done some google-ing and the closest answer I could find was the possibility that since WCF is run from a separate location, the VO.dll file that I added in as a reference is not available to it.
As a reference to the above statement... please find the enclosed link:
http://forums.asp.net/t/712261.aspx
Thanks

Unable to access ColdFusion webservice from C# class

I have to use a ColdFusion webservice in my project. I have
added the service reference in my project and it was successfully loaded, but
service is not accessible in my web application.
What I have done is let's say I have a url http://www.server/service.cfc?wsdl - I have added the above service reference and given the service reference name as MyServiceReference.
When I am accessing MyServiceReference in my class file it is not accessible.
I had a similar issue this week when consuming a Coldfusion webservice. To solve it I suggest you can:
1. Consume the WS using old 'Add Web Reference' (like .NET 2.0) instead of using 'Add Service Reference'
In my case, the problem was the webservice's methods were generated with return void and they hadn't had parameters, but when I added the service using this technique the proxies were correctly generated. This post has helped me.
2. Try using WSDL.exe from Visual Studio Developer Command Tools to see if there is an error with service description
If there is maybe you will not be able to generate proxies correctly and you should ask developers to correct the service.
The tool I mentioned can be found at 'Start Menu\Programs\Microsoft Visual Studio 2012\Visual Studio Tools\Developer Command Prompt for VS2012' (also for VS2010).
In my case I've seen the following error:
"This web reference does not conform to WS-I Basic Profile v1.1.R2706:
A wsdl:binding in a DESCRIPTION MUST use the value of "literal" for the use attribute in all soapbind:body, soapbind:fault, soapbind:header and soapbind:headerfault elements."

Categories