1

受信/送信シーケンスのみを含む非常に単純な WF4 サービスを作成しました。AppFabric にデプロイしましたが、ブラウザーで表示すると期待どおりに応答します (つまり、「サービスを作成しました」... wsdl リンクなど)。

VS2012 内にサービス参照を追加しましたが、これは正常に完了しました。ただし、ClientBase クラス (ServiceClient) への参照はありません。

ただし、サービス参照を追加する代わりに、 Service2 クラスを作成する場合

svcutil.exe http://localhost/TrinityServices/Testbed/Service2.xamlx?wsdl

結果の Service2.cs には明らかに ServiceClient が宣言されています。

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public partial class ServiceClient : System.ServiceModel.ClientBase<IService>, IService

そして私は宣言することができます:

var svc = new ServiceClient();
.
.
string p = svc.GetData();

Client クラスが Service Reference プロセスで生成されないのはなぜですか? 以下は完全な wsdl です。

同様の投稿を 1 つ見つけました ( ClientBase クラスは Reference.cs ファイルでは利用できません) が、私の問題との直接的な関係はわかりません。私の名前空間はデフォルトから変更されていません。

読んでくれてありがとう!

<?xml version="1.0" ?>
<wsdl:definitions name="Service2" targetNamespace="http://tempuri.org/" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" 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:xsd="http://www.w3.org/2001/XMLSchema">
  <wsp:Policy wsu:Id="NetNamedPipeBinding_IService_policy">
    <wsp:ExactlyOne>
      <wsp:All>
        <msb:BinaryEncoding xmlns:msb="http://schemas.microsoft.com/ws/06/2004/mspolicy/netbinary1"/>
        <sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
          <wsp:Policy>
            <sp:TransportToken>
              <wsp:Policy>
                <msf:WindowsTransportSecurity xmlns:msf="http://schemas.microsoft.com/ws/2006/05/framing/policy">
                  <msf:ProtectionLevel>
                    EncryptAndSign
                  </msf:ProtectionLevel>
                </msf:WindowsTransportSecurity>
              </wsp:Policy>
            </sp:TransportToken>
            <sp:AlgorithmSuite>
              <wsp:Policy>
                <sp:Basic256/>
              </wsp:Policy>
            </sp:AlgorithmSuite>
            <sp:Layout>
              <wsp:Policy>
                <sp:Strict/>
              </wsp:Policy>
            </sp:Layout>
          </wsp:Policy>
        </sp:TransportBinding>
        <wsaw:UsingAddressing/>
      </wsp:All>
    </wsp:ExactlyOne>
  </wsp:Policy>
  <wsdl:types>
    <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:element name="anyType" nillable="true" type="xs:anyType"/>
      <xs:element name="anyURI" nillable="true" type="xs:anyURI"/>
      <xs:element name="base64Binary" nillable="true" type="xs:base64Binary"/>
      <xs:element name="boolean" nillable="true" type="xs:boolean"/>
      <xs:element name="byte" nillable="true" type="xs:byte"/>
      <xs:element name="dateTime" nillable="true" type="xs:dateTime"/>
      <xs:element name="decimal" nillable="true" type="xs:decimal"/>
      <xs:element name="double" nillable="true" type="xs:double"/>
      <xs:element name="float" nillable="true" type="xs:float"/>
      <xs:element name="int" nillable="true" type="xs:int"/>
      <xs:element name="long" nillable="true" type="xs:long"/>
      <xs:element name="QName" nillable="true" type="xs:QName"/>
      <xs:element name="short" nillable="true" type="xs:short"/>
      <xs:element name="string" nillable="true" type="xs:string"/>
      <xs:element name="unsignedByte" nillable="true" type="xs:unsignedByte"/>
      <xs:element name="unsignedInt" nillable="true" type="xs:unsignedInt"/>
      <xs:element name="unsignedLong" nillable="true" type="xs:unsignedLong"/>
      <xs:element name="unsignedShort" nillable="true" type="xs:unsignedShort"/>
      <xs:element name="char" nillable="true" type="tns:char"/>
      <xs:simpleType name="char">
        <xs:restriction base="xs:int"/>
      </xs:simpleType>
      <xs:element name="duration" nillable="true" type="tns:duration"/>
      <xs:simpleType name="duration">
        <xs:restriction base="xs:duration">
          <xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?"/>
          <xs:minInclusive value="-P10675199DT2H48M5.4775808S"/>
          <xs:maxInclusive value="P10675199DT2H48M5.4775807S"/>
        </xs:restriction>
      </xs:simpleType>
      <xs:element name="guid" nillable="true" type="tns:guid"/>
      <xs:simpleType name="guid">
        <xs:restriction base="xs:string">
          <xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}"/>
        </xs:restriction>
      </xs:simpleType>
      <xs:attribute name="FactoryType" type="xs:QName"/>
      <xs:attribute name="Id" type="xs:ID"/>
      <xs:attribute name="Ref" type="xs:IDREF"/>
    </xs:schema>
  </wsdl:types>
  <wsdl:message name="IService_GetData_InputMessage">
    <wsdl:part element="q1:int" name="int" xmlns:q1="http://schemas.microsoft.com/2003/10/Serialization/"/>
  </wsdl:message>
  <wsdl:message name="IService_GetData_OutputMessage">
    <wsdl:part element="q2:string" name="string" xmlns:q2="http://schemas.microsoft.com/2003/10/Serialization/"/>
  </wsdl:message>
  <wsdl:portType name="IService">
    <wsdl:operation name="GetData">
      <wsdl:input message="tns:IService_GetData_InputMessage" wsaw:Action="http://tempuri.org/IService/GetData"/>
      <wsdl:output message="tns:IService_GetData_OutputMessage" wsaw:Action="http://tempuri.org/IService/GetDataResponse"/>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="BasicHttpBinding_IService" type="tns:IService">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="GetData">
      <soap:operation soapAction="http://tempuri.org/IService/GetData" style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:binding name="NetNamedPipeBinding_IService" type="tns:IService">
    <wsp:PolicyReference URI="#NetNamedPipeBinding_IService_policy"/>
    <soap12:binding transport="http://schemas.microsoft.com/soap/named-pipe"/>
    <wsdl:operation name="GetData">
      <soap12:operation soapAction="http://tempuri.org/IService/GetData" style="document"/>
      <wsdl:input>
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="Service2">
    <wsdl:port binding="tns:BasicHttpBinding_IService" name="BasicHttpBinding_IService">
      <soap:address location="http://localhost/TrinityServices/Testbed/Service2.xamlx"/>
    </wsdl:port>
    <wsdl:port binding="tns:NetNamedPipeBinding_IService" name="NetNamedPipeBinding_IService">
      <soap12:address location="net.pipe://ip-0a7e0a82/TrinityServices/Testbed/Service2.xamlx"/>
      <wsa10:EndpointReference>
        <wsa10:Address>
          net.pipe://ip-0a7e0a82/TrinityServices/Testbed/Service2.xamlx
        </wsa10:Address>
        <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
          <Spn>
            host/ip-0A7E0A82
          </Spn>
        </Identity>
      </wsa10:EndpointReference>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>
4

1 に答える 1