0

私は単純なサービス定義を持っています:

[ServiceContract]
public interface IInterface12
{

    [OperationContract]
    void SendInterface12(string appId);
}

私はサービスに次のように実装しました:

public void SendInterface12(string appId)
{

問題は、文字列パラメーター appId が表示されないことです。完全な WSDL は次のとおりです。

      <?xml version="1.0" encoding="UTF-8"?>

-<wsdl:definitions xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://tempuri.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://tempuri.org/" name="Interface12Service">


-<wsdl:types>


-<xsd:schema targetNamespace="http://tempuri.org/Imports">

<xsd:import namespace="http://tempuri.org/" schemaLocation="http://localhost/TestInterface12/Interface12Service.svc?xsd=xsd0"/>

<xsd:import namespace="http://schemas.microsoft.com/2003/10/Serialization/" schemaLocation="http://localhost/TestInterface12/Interface12Service.svc?xsd=xsd1"/>

</xsd:schema>

</wsdl:types>


-<wsdl:message name="IInterface12_SendInterface12_InputMessage">

<wsdl:part name="parameters" element="tns:SendInterface12"/>

</wsdl:message>


-<wsdl:message name="IInterface12_SendInterface12_OutputMessage">

<wsdl:part name="parameters" element="tns:SendInterface12Response"/>

</wsdl:message>


-<wsdl:portType name="IInterface12">


-<wsdl:operation name="SendInterface12">

<wsdl:input message="tns:IInterface12_SendInterface12_InputMessage" wsaw:Action="http://tempuri.org/IInterface12/SendInterface12"/>

<wsdl:output message="tns:IInterface12_SendInterface12_OutputMessage" wsaw:Action="http://tempuri.org/IInterface12/SendInterface12Response"/>

</wsdl:operation>

</wsdl:portType>


-<wsdl:binding name="BasicHttpBinding_IInterface12" type="tns:IInterface12">

<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>


-<wsdl:operation name="SendInterface12">

<soap:operation style="document" soapAction="http://tempuri.org/IInterface12/SendInterface12"/>


-<wsdl:input>

<soap:body use="literal"/>

</wsdl:input>


-<wsdl:output>

<soap:body use="literal"/>

</wsdl:output>

</wsdl:operation>

</wsdl:binding>


-<wsdl:service name="Interface12Service">


-<wsdl:port name="BasicHttpBinding_IInterface12" binding="tns:BasicHttpBinding_IInterface12">

<soap:address location="http://localhost/TestInterface12/Interface12Service.svc"/>

</wsdl:port>

</wsdl:service>

</wsdl:definitions>

私は何が欠けていますか?パラメーターを受け取るサービス操作が必要ですが、プロキシを生成するときに、文字列 appId パラメーターのパラメーターがありません。それは0個のパラメータを取ると言います。

4

1 に答える 1

0

ほとんどの場合、WSDL は、パラメーターが定義されている XSD ファイルを参照します。「インポート」または「インクルード」を検索して、その XSD の場所を確認します。これが wsdl の場所: http://myserver.com/X.svc?WSDL=WSDL0の場合、XSD はhttp://myserver.com/x.svc?XSD=XSD0 (または XSD1、XSD2...) にあります。 )。WSDL が、XSD (またはそれらのいくつか) を参照する別の WSDL (WSDL1) を参照している可能性があります。

于 2013-09-18T22:47:14.373 に答える