ストーリーボードには、NSTextFileldを
入力文字列用に1つと出力表示用に1つ、合わせて2つ用意してください。
イベントを発生させるために、ボタンを1つ用意します。

ここまで、設定が終わったところで、一度ビルドを通して、動作の確認を行ってみてください。
設定が完了した段階で、コンパイルエラーが出ていなければ、コーディングに移りましょう。

ヘッダーファイル
ViewController.h


#import 
#import "Service1.h"

@interface ViewController : NSViewController

@property IBOutlet NSTextFiled *text1;
@property IBOutlet NSTextFiled *text2;

-(IBAction)ButtonClicked:(id)sender;

@end

インプリメンテーションファイル
ViewController.m


-(IBAction)ButtonClicked:(id)sender
{
	NSString *input = [_text1 stringValue];
	BasicHttpBinding_IService1Binding *binding = [Service1 BasicHttpBinding_IService1Binding];
	binding.logXMLInOut = YES;
	
	Service1_Koneko_QueryItemPrice *req = [Service1_Koneko_QueryItemPice new];
	req.jan = input;
	
	BasicHttpBinding_IService1BindingResponse *res = [Binding Koneko_QueryItemPriceUsingParameters: req];
	
	NSArray *bodypart = res.bodyParts;
	
	NSString *str;
	
	for(id s in bodypart)
	{
	if([s isKindOfClass:[Service1_Koneko_QueryItemPriceResponse class])
	{
		Service1_Koneko_QueryItemPriceResponse *body = (Service1_Koneko_QueryItemPriceResponse*)s;
		
		str = body.Koneko_QueryItemPriceResult;
	}
	
	[_text2 setStringValue:str];
}

気を付ける点が何個かあります。
Service1_Koneko_QueryItemPrice *req = [Service1_Koneko_QueryItemPice new];
req.jan = input;
上記、朱記の「jan」は、Webサービスに渡す属性です。
BasicHttpBinding_IService1BindingResponse *res = [Binding Koneko_QueryItemPriceUsingParameters: req];
上記、UsingParametersは引数を与えることを示すための接尾辞のようです。「Koneko_QueryItemPrice」の部分が変わります。
Webサービスの定義によって変わってくるので、ご注意ください。


下記は、「LaLaLaCafe」というWebサービスを立ち上げたときに作った、MAC OS X用のアプリケーションのコードです。
掲載したコードと比較してみると、クラスの使い方や、パラメータの与え方の違いが見えてくるかもです。

9.コードの記述