の追加:は、Windows Phone 7のでウェブサービスを消費し、私は次のように説明したWebサービスメソッド持つSOAPヘッダ
POST /servis.asmx HTTP/1.1
Host: webservice.myproject.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/MyMethod"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<AuthHeader xmlns="http://tempuri.org/">
<Username>string</Username>
<Password>string</Password>
</AuthHeader>
</soap:Header>
<soap:Body>
<MyMethod xmlns="http://tempuri.org/" />
</soap:Body>
</soap:Envelope>
を、私は、このWebサービスメソッドを消費のWindows Phone 7アプリケーションを開発しようとしています。 Visual Studioでは、プロジェクトへの参照を追加しました。私は.netプラットフォームでやっているようなWebサービスクライアントオブジェクトを作成し、AuthHeaderオブジェクトを作成し、そのユーザー名とパスワードを設定しました。
AuthWebService.WebService webService = new AuthWebService.WebService();
AuthWebService.AuthHeader authentication = new AuthWebService.AuthHeader();
authentication.Username = "test";
authentication.Password = "test";
webService.AuthHeaderValue = authentication;
しかし、私は、このコード行を使用してサービスヘッダーを設定しようとしている:
webService.AuthHeaderValue = authentication;
それは動作しません。次のコードは、私のコードが、それ鉱山などのようではありません。 WebサービスオブジェクトにAuthHeaderValueプロパティがありません。私はデスクトップアプリケーションやWebアプリケーションで動作させましたが、Windows Phone 7アプリケーションでは動作しませんでした。
誰でもこの問題についての提案はありますか?ありがとうございました。