I have created a WCF service using Workflow. It works just fine. I created another Workflow application to consume it. I added the service reference to the application project and rebuilt the project. I added the component from the service to the app, but it's expecting an argument that I never specified.
I've tried rebuilding both the service and the app, generating an entirely new solution and starting from scratch - same problem. I've looked at others' code and they've structured this project the same as mine but this issue does not show up on theirs. Googling this problem seems to bring up not results.
My workflow service is defined as such: https://i.imgur.com/E8mEfs6.png
The parameters of the receive component are: https://i.imgur.com/TaNRw2y.png
But when I add it to my app, the parameters are defined as: https://i.imgur.com/tqgEwNr.png
Which is not what I had defined in my service. I can't even figure out what it wants me to pass in for _GetCityStateFromZip. It says the type is InArgument.
I was expecting it to be expecting the zipcode parameter as I specified in the service. I think I might be adding the service reference incorrectly, but I don't know how. I went to Add Service Reference in Visual Studio, then copy/pasted the path to the .xamlx file of the service on localhost.
Thank you.
I found a solution to this problem here:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/5279fc5f-8a53-43e7-8ef2-3073808dc90f/configuring-workflow-services-how-to-configure-workflow-control-endpoint?forum=wfprerelease
I re-made my service using the steps listed and it works as originally intended.
I'm trying to "Add Service Reference" with WCF to the following wsdl: https://se-face-webservice.redsara.es/sspp?wsdl
The visual studio does not provide any warning but the reference.cs is empty and no serialization took place.
I have already tried removing the "Reuse types in specified referenced assemblies", however the serialization stills fails.
If I tried to add the service with the WcfTestClient it gives an error stating that : 'http://schemas.xmlsoap.org/soap/encoding/Array' is not defined.
Finally, when I add the wsdl through a "Add Web Reference" the serialization takes place. I'm guessing that maybe the service is using "unknown" bindings to WCF.
Is there a work around for this situation?
PS: If I use the SoapUI to generate the client everything works fine.
Your WSDL is faulty. It defines the prefix soap-enc, but does not define the schema which defines it. The WSDL is assuming that the http://schemas.xmlsoap.org/soap/encoding/ schema is automatically defined.
Perhaps this service is built on an old version of Axis? I have seen that version assume that the consumer is also built on Axis.
I've tried good old wsdl.exe for generating web service references with System.Web.Services and seems to work - generating and compilation at least :-)
Can you check it? Link to project on bitbucket. Just simple console app with references and generated assemblies.
https://bitbucket.org/polacekpavel/servicestack_27747564/src
and interesting one - generated proxy class https://bitbucket.org/polacekpavel/servicestack_27747564/src/c43b90221fae7ceb2e234552b9f57034551b3cbf/SSPPWebServiceProxyService.cs?at=master
I have a WPF application using service references to a WCF service. When doing updates on the service I need to update the service reference, so I right click it and hit "Update Service Reference".
Doing this results in duplicate entries in the App.config file of the client project.
It duplicates a binding under wsHttpBinding - adding an equal entry with postfix number in name: WSHttpBinding_ISomeService --> WSHttpBinding_ISomeService1.
And it duplicates the endpoint definition under binding such that there is one endpoint for each wsHttpBinding. This too is a pure duplicate except of the name.
Why does it duplicate the config? Isn't it just supposed to update the name? And how can I make it stop?
Which version of Visual Studio are you using? This is a known bug, which has been fixed in VS2010. Check out this link!
code-zoop says that this known bug is resolved in VS2010, but I'm getting it in VS2010 as well.
Happens when I manually modify the default value for the MaxReceivedMessageSize property (and others) of the basicHttpBinding in App.config (as per this post: WCF - How to Increase Message Size Quota)
Just thought I'd mention that this happens in VS2010 as well. For the moment, I'm taking Shiraz Bhaiji's advice and just deleting the duplicate, which seems to be working for the moment being.
This has also happend to us on a few occasions.
You need to remove the duplicate, otherwise it will crash at runtime. The client looks in the configuration file to find where it should send a request to Interface(WCF contract X), finds more than one, and crashes.
one workaround is to put the service agent (web reference) in its own DLL and reference it from the main project.
it won't touch your service agent config in your web.config when you do Update Referene and as a bonus you'll have a project with up to date serviceagent config if you ever need to compare the default configuration with what you actually have in web.config
also has the benefit that if you have one service agent referencing another it will share the types
MAIN DLL > ServiceAgent1 DLL > ServiceAgent2 DLL
If ServiceAgent1 and ServiceAgent2 have shared types you won't get two generated duplicate classes
I have an ASMX service that I wan't to add to my Silverlight project (in the near future this will be converted to a WCF service).
When using the "Add (or Update) Service Reference" not all the files seem to be created and files under Reference.svcmap aren't created and the ServiceReferences.ClientConfig is empty.
Has anyone ever come across this before?
Not sure I have a good answer for this one. I see this every so often. Usually the problem can be traced by looking at the output window entires that occured during the attempted proxy generation.
Sometimes it is caused because invalid or unsupported Wsdl or just some silly issue with serialization of one of the types.
Try to give your client (Silverlight) application the WSDL, not just the ASMX when adding the service reference.
e.g. http://myserver.com/services/mywebservice.asmx?wsdl
Remove the service reference altogether from your client project, and try adding it again this time with the WSDL.
I'm using Visual Studio 2008 and have a WCF client working against a WCF service. They are both located in the same Visual Studio solution. After I've made a change in my WCF contract, I want to update the service reference on the client so that changes made to the contract is also made in the proxy.
My problem is that the proxy code is not re-generated.
When I select to update the service reference, the following happens:
A dialog with the title "Updating service reference 'name-of-reference'" is shown. This dialog has a progress bar.
The progressbar moves and the status text in the dialog is changed to "Updating configuration"
The progressbar moves a bit more, and the status text is chnaged to "Configuration update complete"
The dialog doesn't show the text "Generating \something\" (can't remember the exact wording) which I would expedct.
If I delete the service reference and add it again, the proxy is properly generated. I add the service using the exact same settings as before, so I don't think it's a issue I can solve by changing the service reference configuration on the client.
One thing I suspect may be the problem is that I've renamed the default wsHttpBindings in app.config. I've also renamed the default endpoints. The reason behind this is that I need more than one endpoint and having one named 'some-default-name' and one with my own name is just confusing.
The problem with deleting the service and adding it again is that Visual Studio adds a new binding in app.config (among other things) which should not be there.
Anyone seen this problem before? Anyone knows of a solution to it?
When we have had this problem it has usually been one of these errors:
The size of the contract has increased, and is now so large that the WCF configuration does not allow it to be transferred.
A new class has been added to a WCF Interface and that class is not marked as serializable.
There is a compile error that stops the code from building and it therefore uses the old dll
I've run into this problem with the following conditions:
Our workstations are connected to an Active Directory domain (nearly everything uses Windows Authentication)
The service reference I'm trying to update is hosted on localhost, and is running under IIS Express (so the Application Pool user is running as the developer's personal domain user account)
Another developer has added or updated the reference to the project more recently than me.
The only way I have figured out how to workaround this issue is to edit the configuration.svcinfo file for that service reference (you will need to show all files for the project to see it in visual studio), locate the following section:
userPrincipalName value="user#domain.com"
and change the user to my own domain user. After saving the file, I have no trouble updating the reference until another developer updates the service reference (likely using the same workaround). Unfortunately, I haven't been able to figure out a permanent solution to this issue.
My error was that I forgot to add the OperationContract attribute.
In my case the problem was that the previous developer had added the service reference using his machine name rather than localhost. So when I told Visual Studio to update, it connected to his machine, which did not have the changes. I modified the service reference files and replaced his machine name with localhost and it was able to update the reference.
I had this problem too. Deleted the service reference and recreated it again.
My problem was that I had two methods with the same name. Everything builded fine, but I couldn't update service reference. When I tried to start just the WCF service, the error pops up.
Two easy steps to solve that:
Run Service, then stop it.
Update service reference.
Highlight the service as the active project, F5 to run it in VisualStudio, it will start up in the service test app. Stop debugging. Then try to update your service reference - worked for me.
I know this solution is a bit late, but after trying the posted solutions with no success, this worked:
When you create a WebService, it generates a .dll file that you reference as your service reference. This .dll is (as most know) not recreated everytime you make changes to the .SVC file. You can see this if you go and view the date modified property of the web service .dll file, in my case it was three hours old!
My solution was to make appropriate changes to the service contact, save it, and re-build the project which will cause it to recreate all the .dll's reflecting the changes you made to the service contact file (.svc).
After this, update the service reference on the client app, and the changes are evident.
Spades
I had the same problem. Modified some of the data contracts. Tried to "Update Service Reference" and did not see the change. Dropped and re-added the service. Still didn't see the change when writing code in the client. Opened my client with Reflector and saw the service types had the change! So why was intellisense still showing old properties? Restarted Visual Studio and the modifications finally showed in intellisense.
I had the same problem, this by me it was caused by GIT Merge Conflict, i was missing the following code from my csproj file
<ItemGroup>
<None Include="Service References\<SERVICE NAME>\Reference.svcmap">
<Generator>WCF Proxy Generator</Generator>
<LastGenOutput>Reference.cs</LastGenOutput>
</None>
</ItemGroup>
I have added this onder the line of Reference.svcmap
Another solution to these kinds of problems is if your namespaces get jumbled in referenced projects that both consume the service. So:
ProjectA - Consumes ServiceA
ProjectB - Consumes ServiceA, Has Reference to ProjectA
If you change ServiceA and update ProjectB, sometimes the namespaces can can change to look at ProjectA's version of the service.