最近、ProjectServer PSI WebService を使用する Xamarin-iOS アプリの作成を開始しました。PSI を WebReference として追加し、PSI メソッドにアクセスしようとすると、401 無許可エラーが発生します。興味深いことに、ローカル ネットワークでは問題なく動作しますが、エンタープライズ ネットワークではエラーが発生します。そこで、WebReference を SOAP - HttpwebRequest メソッドに変更する予定です。
これは私が試したものです
この URL BaseAddress + pwa/_vti_bin/PSI/Resource.asmx?op=GetCurrentUserUidを使用してリソース ID を取得しようとしています。
<?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:Body>
<GetCurrentUserUid xmlns="http://schemas.microsoft.com/office/project/server/webservices/Resource/" />
</soap:Body>
上記のコードを本文として渡しています。
しかし、HttpWebRequestを使用してこれを実行すると、エラーHttpStatusCode InternalServerError System.Net.HttpStatusCodeが発生します。
また、応答で次の xml 応答を見つけました。
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
xmlns:a="http://Microsoft.Office.Project.Server">a:ProjectServerFaultCode
</faultcode>
<faultstring>
Unhandled Communication Fault occurred
</faultstring>
<detail>
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">
Object reference not set to an instance of an object.</string></detail>
</s:Fault>
</s:Body>
</s:Envelope>
何が悪いのかわからない。だから私の質問は、
HttpWebRequest を使用して PSI メソッドを呼び出すことは可能ですか。
助けてください。前もって感謝します。