Good day. There was a task to poll the web server from the client on which it is planned to write the WCF client part. There is very little information about the server (I don’t know the host platform) I only know the format of SOAP messages.

The quotation from those tasks looks like this:

For the regulatory timetable, the WEB server interface GetScheduleNormative4Place request:

<?xml version="1.0" encoding=" utf-8" ?> <root> <Authentication User='ddd' Password='samba'/> <Place ESR='34567'/> </root > 

answer:

 <?xml version="1.0" encoding=" utf-8" ?> <root> <Place ESR='34567' Data='2015.09.21'/> <Train TrainNumber='6022' Name='Москва-Ожерелье' ESRDeparture='34567' ESRArrival='34560' TimeDeparture='2015.09.21 11:11:00' TimeArrival='' DaysTrainType='ОН' DaysTrain= '2015.09.15;2015.09.17;2015.09.22' > </Train> </root > 

That is, in the request to the end point, I specify the authorization data and some Id number, and if they are correct, the server throws out the answer.

I need to create a client on WCF under the .NET 4.5 platform. Once I did a distributed application and there I classically created a contract that applied to both the client and the server. Here the server has already been made and I understand that one of the endpoints should be mex (metadata). And in VS it is possible even through code generation to create a WCF client project which, using the metadata received from the server, is generated by the client? sort of saw such examples. What are the ways to create a client manually? And if mex is disabled?

Thank you in advance!

  • one
    I haven't done this for a long time, but it seems like the service should have a page with a protocol description (Something like host / service (.asmx)? Wsdl ), it can be downloaded and fed to the wsdl.exe utility, it generates proxy classes, add it to the project and use ... ps. wsdl.exe is put together with the studio - kimaman2
  • Like in 2015 studios. This is done as adding a reference to the assembly in the project and it indicates the address of the launched service. but the service must have one of the mex endpoints. and the usual code is generated, then you can create a proxy object and call a method on the server. - Aldmi
  • Is it possible to create a suitable contract (interface) for communication with only the format of the request and response? - Aldmi
  • the object is in another city and I want to prepare for the unexpected to the maximum)) - Aldmi
  • To do this, you need to get a contract from the server, describe the chore with your hands ... When I wrote integration with banks, they sent it to WSDL and I generated proxy types for it ... I never described it with my hands, I'm sorry ... - kimaman2

0