0

Technical details: I'm using a Windows 10 VM, Visual Studio 19, C# Latest .NET Framework.

I am having this problem with multiple methods, but I'll use a single one for demonstration purpose.

I have a function in my WCF Service file, in it's own project, as such:

public bool FindSalesOrder(
    Int64 OrderNo, 
    out string ReturnMessage, 
    out SalesActiveOrderHeaderBDO OrderHeader, 
    out SalesActiveOrderLineDataTable OrderLines, 
    out SalesActiveOrderNoteDataTable OrderNotes)

And the same function in the Service Contract:

[OperationContract]    
bool FindSalesOrder(
    Int64 OrderNo, 
    out string ReturnMessage, 
    out SalesActiveOrderHeaderBDO OrderHeader, 
    out SalesActiveOrderLineDataTable OrderLines, 
    out SalesActiveOrderNoteDataTable OrderNotes);

But when I go to the UI project and click "Update Service Reference", I get plenty of errors, which when I go to, it's complaining about conversion. When I go to the Reference.cs and navigate to the same function, I find it has been changed to:

public bool FindSalesOrder(
    long OrderNo, 
    out string ReturnMessage, 
    out CentricNamespace.SalesActiveOrderHeaderBDO OrderHeader, 
    out CentricNamespace.CentricCoreDataSet.PurchaseActiveOrderLineDataTable OrderLines, 
    out CentricNamespace.CentricCoreDataSet.PurchaseActiveOrderNoteDataTable OrderNotes)

I can manually fix these issues by just replacing "Purchase" with "Sales" and it all works perfectly fine, but I don't feel like doing this each time I need to update the service reference. Additionally, when I have fixed all the errors, then look for the above function(with Purchase instead of Sales, using the built-in Visual Studio search feature), it doesn't find it. So I am unsure of where it is getting this from?

Any help would be greatly appreciated! (Any extra info you need, I'd be happy to give out(as long as it's not sensitive information of course)).

  • It shouldnt be picking a completely different class... This is strange to say the least – TheGeneral Aug 21 '20 at 08:51
  • Do any of those interfaces have GUIDs attached to them? What does the raw WSDL look like when you query it yourself? – Dai Aug 21 '20 at 08:55
  • Dai, please forgive me, I'm new to this WCF stuff, how do I check that stuff? – Bacon Season Aug 21 '20 at 09:11
  • Ideally, you'd ditch WCF because it's a dead-end technology that Microsoft abandoned back in 2008 (and a PITA to work with, but that's another story). You can browse WSDL in your browser by simply adding `?wsdl` to the service-root, e.g. https://stackoverflow.com/questions/11840516/getting-wsdl-from-vs2010-wcf-service-application/11840623 – Dai Aug 21 '20 at 10:27
  • Unfortunately, it's not my choice to use WCF. When I follow those instructions I get a 404 error, "The requested resource is not found." – Bacon Season Aug 21 '20 at 10:47
  • Can you fire up Fiddler or Wireshark to see what request the WCF Service Reference tool is making to get service metadata? – Dai Aug 21 '20 at 13:14
  • This may be a WSDL problem, you need to check your WSDL file. You can also generate proxy classes through Svcutil. For how to use Svcutil, you can refer to this link: https://stackoverflow.com/questions/61631400/adding-wsdl-service-reference-to-vs-fail-because-generated-xsd-file-contains-ill/61725107#61725107 – Ding Peng Oct 16 '20 at 08:21

0 Answers0