0

I have inherited a web project that uses WCF in a separate project of my solution to get the data. I'm not familiar with WCF but I was asked to see if I could send another parameter. A developer that is responsible for the actual Web Service will make the adjustment for the extra parameter on his side.

I did a search in the solution for the property called crewMemberConMonthField so I could just copy and paste a new one called crewMemberConMonthField2. I found it in the References.cs and in a FH_FTPService.xsd file.

In the .xsd file I copy and pasted the XML and just changed the name. I then went to the refernces.cs file and added another parameter with the new name (crewMemberConMonthField2). Since I'm using VS 2015 it gives me the option to refactor the name but when I do I get a warning message that basically says "the file could not be refactored. The current object is auto-generated by the Wcf Client Generator and cannot be renamed".

I've been searching for information about this but everything I'm finding is try to walk me through created a WCF. When I look through those examples I'm not seeing anything about a Wcf Client Generator.

I was looking to see if anyone could maybe point me in the right direction.

Here is some of what I have in the reference.cs

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.18408")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://sitename.com/FH_FTPService/")]
public partial class StartRequestType : object, System.ComponentModel.INotifyPropertyChanged {

    private StartRequestTypePartition partitionField;

    private string crewMemberConMonthField;

    private string crewMemberConMonthField2;

    private string sequenceConMonth1Field;

    private string sequenceConMonth2Field;

and this is in my .xsd file

<schema xmlns:tns="http://sitename.com/FH_FTPService/" elementFormDefault="qualified" targetNamespace="http://sitename.com/FH_FTPService/" xmlns="http://www.w3.org/2001/XMLSchema">
  <complexType name="StartRequestType">
    <sequence>
      <element name="CrewMemberConMonth">
        <simpleType>
          <restriction base="string">
            <length value="7" />
            <pattern value="^(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)\d{4}$" />
          </restriction>
        </simpleType>
      </element>
      <element name="CrewMemberConMonth2">
        <simpleType>
          <restriction base="string">
            <length value="7" />
            <pattern value="^(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)\d{4}$" />
          </restriction>
        </simpleType>
      </element>
Caverman
  • 3,371
  • 9
  • 59
  • 115
  • Duplicate of - [How to add service reference in client project?](http://stackoverflow.com/questions/6538493/how-to-add-service-reference-in-client-project) - [Web Reference vs. Service Reference](http://stackoverflow.com/questions/2158106/web-reference-vs-service-reference) – Petar Vučetin Jun 13 '16 at 19:57
  • Unless I'm misunderstanding something, I don't see how this is a duplicate. Are you saying that i need to have the person in charge of the FH_FTPService update and publish there project first and then I would need to remove and re-add a Service Reference to it? – Caverman Jun 13 '16 at 20:07
  • That is normally how its done if you are using Service Reference. Another way is to share DLL's. Either way service owner needs to make changes and publish them. – Petar Vučetin Jun 13 '16 at 20:22

0 Answers0