2011-12-01 82 views
0

我是新来使用WCF服务但开始写一个新的项目,并已就遇到了这个问题,当它的价值。我也是编程新手,如果措辞不正确,请原谅我!WCF - 对象失去传递给WCF服务

我有一个称为档案,我可以检索WCF我的客户端上的对象,而且工作没有问题 - 使用GetProfile方法。

我当时就想进行修改,在客户端的对象,并使用UpdateProfile方法发送回通过WCF服务。此时,对象似乎总是被重新实例化(因此将所有值覆盖为空)。

任何帮助表示赞赏。

所以GetProfile方法精美的作品。 变更这个RAIS_Profile我的客户端上精美的作品 发送RAIS_Profile回用UpdateProfile和对象中的所有值是空白,一旦该方法。

Public Function GetProfile(ByVal DocumentNumber As Integer) As RAIS_Profile Implements IRAISAPI.GetProfile 
     Dim Doc As New RAIS_Profile 
     'blah 
     'blah 
     Return Doc 
    End Function 

    Public Function UpdateProfile(ByVal pDoc As RAIS_Profile) As String Implements IRAISAPI.UpdateProfile 
     Return pDoc.DocumentNumber 
    End Function 

任何帮助表示赞赏!

+0

你有没有你的标记与DataMemberAttribute的RAIS_Profile对象的属性? – user957902

+0

您可以发布您在客户端上更新RAIS_Profile的代码,然后调用UpdateProfile方法。你还可以发布RAIS_Profile类的代码吗? –

回答

1

查看客户端和服务器上的服务合同。如果参数的命名方式不同,那么你会遇到这种行为。

Here