2012-05-10 209 views
0

我试图将'WSO2数据服务服务器'上创建的服务转换为本地.NET客户端(Windows应用程序)。我能够与服务进行通信(我能够列出这些服务提供的操作)。但是,当我尝试调用方法应用程序抛出以下错误。在C#.Net中使用WSO2数据服务Windows应用程序

命名空间'XYZ'中的XML元素'ABCD'引用了一个方法和一个类型。使用WebMethodAttribute更改方法的消息名称,或使用XmlRootAttribute使用 更改类型的根元素。

我通过Visual Studio刚刚添加的服务参考Windows应用程序,并试图调用方法

谁能给循序渐进的过程来解决上述问题?

回答

0

当您在数据服务配置中对操作和元素使用相同的名称时,会发生这种情况。在添加服务引用时,代理将在VS中创建,无法区分类型和方法。您可以尝试为数据服务配置中的操作和其他XML属性赋予不同的名称吗?如果仍不起作用,请发布您的数据服务配置。

0

是否有解决方案,而不是给结果集不同的名称?

如果我有一个Web服务3种方法,他们都输出相同

然后感觉不自然的我给他们重命名为Customers1,Customers2和Customers3例如

这里是我的样本这在.NET中导致问题,因为有3种方法都返回条目 - >条目

<data name="ws_getSubnoCCInfo" serviceNamespace="com.test.ws"> 
    <config id="tro"> 
     <property name="driverClassName">oracle.jdbc.driver.OracleDriver</property> 
     <property name="url">jdbc:oracle:thin:xxx/[email protected]:1521/DB</property> 
     <property name="username">xxx</property> 
     <property name="password">yyy</property> 
    </config> 
    <query id="subnoHasCCSQL" useConfig="tro"> 
     <sql>select case when count(*) &gt; 0 then 'OK' else 'NOK' end hasCC from ccinfo where subno = :subno</sql> 
     <result element="Entries" rowName="Entry"> 
     <element column="hasCC" name="hasCC" xsdType="string"/> 
     </result> 
     <param name="subno" sqlType="STRING"/> 
    </query> 
    <query id="idNoHasCCSQL" useConfig="tro"> 
     <sql>select case when count(*) &gt; 0 then 'OK' else 'NOK' end hasCC from ccinfo cc, tabs.crm_departement ui where cc.contrno = ui.contrno and ui.id_no = :id_no</sql> 
     <result element="Entries" rowName="Entry"> 
     <element column="hasCC" name="hasCC" xsdType="string"/> 
     </result> 
     <param name="id_no" sqlType="STRING"/> 
    </query> 
    <query id="contrnoHasCCSQL" useConfig="tro"> 
     <sql>select case when count(*) &gt; 0 then 'OK' else 'NOK' end hasCC from ccinfo cc where contrno = :contrno</sql> 
     <result element="Entries" rowName="Entry"> 
     <element column="hasCC" name="hasCC" xsdType="string"/> 
     </result> 
     <param name="contrno" sqlType="STRING"/> 
    </query> 
    <operation name="subnoHasCC"> 
     <call-query href="subnoHasCCSQL"> 
     <with-param name="subno" query-param="subno"/> 
     </call-query> 
    </operation> 
    <operation name="idNoHasCC"> 
     <call-query href="idNoHasCCSQL"> 
     <with-param name="id_no" query-param="id_no"/> 
     </call-query> 
    </operation> 
    <operation name="contrnoHasCC"> 
     <call-query href="contrnoHasCCSQL"> 
     <with-param name="contrno" query-param="contrno"/> 
     </call-query> 
    </operation> 
</data> 
相关问题