# 結果が『SOAPリクエストが不正です。』となります

**URL:** <https://community.cybozu.dev/t/topic/2069>\
**Category:** kintone 開発相談\
**Created:** [2015 年 6 月 24 日午前 2:49 UTC](https://community.cybozu.dev/t/topic/2069 "2015-06-24T02:49:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Legacy\_Account2139](https://avatars.discourse-cdn.com/v4/letter/l/df705f/32.png) [@Legacy\_Account2139](https://community.cybozu.dev/u/Legacy_Account2139)\
**Post date:** [2015 年 6 月 24 日午前 2:49 UTC](https://community.cybozu.dev/t/topic/2069/1 "2015-06-24T02:49:47Z")

</div>

garoon APIの勉強としてまず『掲示板の更新情報を取得する』API、BulletinGetTopicVersionsを使ってみようとしました。  
そうした所、例外『SOAPリクエストが不正です。』が発生しました。  
何がいけないのでしょうか？

try  
{  
BulletinBinding bulletinBinding = new BulletinBinding();  
BulletinGetTopicVersionsRequestType type = new BulletinGetTopicVersionsRequestType();  
type.start = DateTime.Now.AddDays( -10 );

```
ItemVersionResultType[] results;
results = bulletinBinding.BulletinGetTopicVersions( type );
foreach ( ItemVersionResultType result in results )
{
    Console.WriteLine( result.version.ToString() );
}

```

}  
catch ( Exception exception )  
{  
Console.WriteLine( exception.Message );  
}

---

<div class="post-metadata">

**Author:** ![Legacy\_Account2139](https://avatars.discourse-cdn.com/v4/letter/l/df705f/32.png) [@Legacy\_Account2139](https://community.cybozu.dev/u/Legacy_Account2139)\
**Post date:** [2015 年 6 月 24 日午前 5:05 UTC](https://community.cybozu.dev/t/topic/2069/2 "2015-06-24T05:05:00Z")

</div>

とりあえずログイン名とパスワードを設定していないので、  
『ログイン処理を行う』API、UtilLoginから勉強することにしました。  
そうした所、結果が変わりませんでした。  
何がいけないのでしょうか？

```
try
{
    UtilBinding utilBinding = new UtilBinding();
    UtilLoginRequestType utilLoginRequestType = new UtilLoginRequestType();
    utilLoginRequestType.login_name = "Administrator";
    utilLoginRequestType.password = "password";
    UtilLoginResponseType utilLoginResponseType = utilBinding.UtilLogin( utilLoginRequestType );
}
catch ( Exception exception )
{
    Console.WriteLine( exception.Message );
}

```

---

<div class="post-metadata">

**Author:** ![Legacy\_Account2139](https://avatars.discourse-cdn.com/v4/letter/l/df705f/32.png) [@Legacy\_Account2139](https://community.cybozu.dev/u/Legacy_Account2139)\
**Post date:** [2015 年 6 月 24 日午前 6:01 UTC](https://community.cybozu.dev/t/topic/2069/3 "2015-06-24T06:01:39Z")

</div>

良く見たらツールボックスにコンポーネントが追加されていたので、  
それを使用するようにしましたが、同じでした。

```
try
{
    UtilLoginRequestType utilLoginRequestType = new UtilLoginRequestType();
    utilLoginRequestType.login_name = "Administrator";
    utilLoginRequestType.password = "password";
    /*utilBinding1.Url = "http://sv0007/cgi-bin/cbgrn/grn.cgi/util_api/util/api?";*/
    UtilLoginResponseType utilLoginResponseType = utilBinding1.UtilLogin( utilLoginRequestType );
}
catch ( Exception exception )
{
    Console.WriteLine( exception.Message );
}

```

---

<div class="post-metadata">

**Author:** ![Legacy\_Account2139](https://avatars.discourse-cdn.com/v4/letter/l/df705f/32.png) [@Legacy\_Account2139](https://community.cybozu.dev/u/Legacy_Account2139)\
**Post date:** [2015 年 6 月 24 日午前 7:24 UTC](https://community.cybozu.dev/t/topic/2069/4 "2015-06-24T07:24:05Z")

</div>

ExceptionをSoapExceptionに変えたところ、詳細がわかりました。  
Headerはどのように設定すれば良いのでしょうか？

GRN\_UTIL\_API\_65001  
SOAPリクエストが不正です。  
“Header” がSOAPリクエストに存在しません。  
サイボウズオフィシャルパートナー、または販売元にお問い合わせください。
