0

I have wsdl file. Then I create service implementation from this wsdl file:

cd C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin
svcutil -//-.wsdl

It is file SendResultsFromService.cs with class SendResultsFromServicePortTypeClient. Here there is a function CalcZoneViewForArea.

Now I want, that my application was the server. So someone call CalcZoneViewForArea in another application.

In my application in class SendResultsFromServicePortTypeClient there is a function CalcZoneViewForArea.

    public int CalcZoneViewForArea(TAnswInfoFromService args0)
    {
        CalcZoneViewForAreaRequest inValue = new CalcZoneViewForAreaRequest();
        inValue.args0 = args0;
        CalcZoneViewForAreaResponse retVal = ((SendResultsFromFHServicePortType)(this)).CalcZoneViewForArea(inValue);
        return retVal.@return;
    }

This function was generated from wsdl. I need to create .doc file from the received data TAnswInfoFromService . Can I modify this function here?

My misunderstanding of this question is based on the following:

I already have ServiceHost serviceHost.

serviceHost = new ServiceHost(typeof(*.*.*.*.*.MapViewPortTypeClient), new Uri(uri));
serviceHost.Open(); 

MapViewPortTypeClient is not the same as SendResultsFromServicePortTypeClient. And this services have different uri.

novicegis
  • 519
  • 3
  • 5
  • 13
  • 1
    your question is confusing. You can create WCF client from WSDL, not the server. The server provides the WSDL – Matt Oct 21 '13 at 13:10
  • I know how create client. I need to create a server. – novicegis Oct 21 '13 at 13:26
  • You create the service by creating the contract and then hosting it. scvutil is for generating a client to consume a service, not for generating a service. It sounds like you're trying to reverse engineer an existing service. – Tim Oct 21 '13 at 14:49
  • Here http://stackoverflow.com/questions/1394930/how-to-generate-web-service-out-of-wsdl/1406523#1406523 people tell that I can use wsdl.exe for generating service interface. I have client wsdl. There are no servers. I must to create server with my own functionality. But I have existing wsdl. Other people do not generate their clients. They already have client implementation. – novicegis Oct 21 '13 at 15:11
  • That answer is talking about .asmx web services, which is a legacy technology that is only present in new .NET versions to support backwards compatibility. wsdl.exe is part of the old .asmx web services - svcutil.exe is for WCF. If you read the other answers in that question, there is one about WCSF (and WCSF-Blue) that *might* help, but other than that I don't see a way to generate a completely functioning service (with all the logic) from a WSDL - the WSDL is there so client's can consume the service, not create their own. – Tim Oct 21 '13 at 15:24
  • The whole idea behind web services is to let the service handle the actual logic, and all the client needs to know is where the service is, what operations it has available for consumption and the arguments and return types of those operations. – Tim Oct 21 '13 at 15:26
  • Possible duplicate of [Possible to autogenerate to code using WSDL in Visual Studio](https://stackoverflow.com/questions/13061172/possible-to-autogenerate-to-code-using-wsdl-in-visual-studio) – Paul Sweatte Jul 10 '17 at 23:55

0 Answers0