忍者ブログ
開発中に遭遇した落とし穴や忘れそうな事柄を書いた個人メモ
カレンダー
04 2024/05 06
S M T W T F S
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
フリーエリア
最新コメント
[02/03 NONAME]
最新トラックバック
プロフィール
HN:
No Name Ninja
性別:
非公開
バーコード
ブログ内検索
アクセス解析
10
×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

最後に、クライアント側の構成ファイルを説明

構成ファイルを作成するにあたっては、VisualStudio2010の
「サービス参照の追加」を利用して作成するとある程度ひな形が作成できる
(svcutilで作成されるものと同じもの)

サービス参照の追加ダイアログを開き
アドレスを入力
http://xxx.co.jp:80/Service/Service1.svc
 

移動ボタンをクリックすると
サービスの内容がしたに表示される
OKボタンで、ソースが生成される

この時、構成ファイルも追加される(赤字)
一部、設定を追加する(青字)
ClientBehaviorの定義によって、とりあえずルート証明がない証明書も許可しておく


    <system.serviceModel>
      <bindings>
        <wsHttpBinding>
          <binding name="WSHttpBinding_ITraceLogService" closeTimeout="00:01:00"
            openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
            bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
            maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text"
            textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
            <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
              maxBytesPerRead="4096" maxNameTableCharCount="16384" />
            <reliableSession ordered="true" inactivityTimeout="00:10:00"
              enabled="false" />
            <security mode="Message">
              <transport clientCredentialType="Windows" proxyCredentialType="None"
                realm="" />
              <message clientCredentialType="None" negotiateServiceCredential="true"
                algorithmSuite="Default" />
            </security>
          </binding>
        </wsHttpBinding>
      </bindings>
      <behaviors>
        <endpointBehaviors>
          <behavior name="ClientBehavior">
            <clientCredentials>
              <serviceCertificate>
                <authentication certificateValidationMode="PeerOrChainTrust" />
              </serviceCertificate>
            </clientCredentials>
          </behavior>
        </endpointBehaviors>
      </behaviors>
      <client>
        <endpoint address="http://xxx.co.jp/Service/Service1.svc"
          binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ITraceLogService"
          contract="MainService.ITraceLogService" name="WSHttpBinding_ITraceLogService" behaviorConfiguration="ClientBehavior">
          <identity>
            IDが生成される一部省略
            <certificate encodedValue="AwAAAAEAAAAUAAAAnvfi4F7J  ----------  " />
          </identity>
        </endpoint>
      </client>
    </system.serviceModel>

拍手

PR
お名前
タイトル
文字色
URL
コメント
パスワード
Vodafone絵文字 i-mode絵文字 Ezweb絵文字
Copyright c 技術メモ All Rights Reserved
Powered by ニンジャブログ  Designed by ピンキー・ローン・ピッグ
忍者ブログ / [PR]