2009-05-27 8 views
0

私は最初のAXIS SOAPクライアントを動作させるのに本当に苦労しています。私はAxis v1.4を使用しています。コードを生成するようにAxis 1.4:動作するようにSOAP要求を受け取ることができません

.... 
<element name="GetParameters"> 
    <complexType> 
    <sequence> 
     <element name="param1" type="codeapi:SomeParam"/> 
     <element name="param2" type="unsignedShort" minOccurs="0"/> 
     <element name="param3" type="string" minOccurs="0"/> 
     <element name="param4" type="unsignedShort" minOccurs="0"/> 
     <element name="param5" type="unsignedShort" minOccurs="0"/> 
     <element name="param6" type="string" minOccurs="0"/> 
     <element name="param7" type="string" minOccurs="0"/> 
     <element name="param8" type="string" minOccurs="0"/> 
     <element name="param9" type="codeapi:AnotherParam" minOccurs="0"/> 
    </sequence> 
    </complexType> 
</element> 
.... 

私が走っているのWSDL2Java:

当社のWSDLは、これが含まれています。

私の最初の試みアクセス要求 -

SimpleProvider conf = new SimpleProvider(new BasicClientConfig()); 
conf.setGlobalRequest(new LoggingHandler(LOG, Level.FINE, 
    "Request sent:\n")); 
conf.setGlobalResponse(new LoggingHandler(LOG, Level.FINE, 
    "Response received:\n")); 

MyService = new MyServiceLocator(conf); 

URL myServiceURL = "http://<removed>"; 

MyServicePort myServicePort = myService.getMyServiceSOAPPort(myServiceUrl); 

SomeParam param1 = new SomeParam(); 
param1.setParamA("blah"); // this is the only needed parameter 

Entry[] allEntries = myServicePort.getParameters(param1, null, null, null, null, null, null, null, null); 

これは、NullPointerExceptionがその結果( -

は私がポートを初期化していますすべてのnullパラメータがオプションであっても、クライアント側で)。

-

私の第二の試み:

SomeParam param1 = new SomeParam(); 
param1.setParamA("blah"); 

Entry[] allEntries = myServicePort.listCodes(param1, new UnsignedShort(), new StringHolder(), new UnsignedShort(), new UnsignedShort(), new String(), new String(), new String(), new AnotherParam()); 

これは、例外なく、その結果が、null値がallEntriesに戻り、私はおそらく(SOAPリクエストが実際に送信されたかどうかは考えていないん)。

コードはOracle AS上で実行されています。どちらの場合でも、Oracleではすべての異なるデバッグクラスがアクティブ化され、LoggingHandlerが初期化されていても、Axisによってログにデバッグ情報の1行が書き込まれません。

私はここで間違っていますか?

答えて

1

パラメータがホルダータイプ(つまりそのクラスが*ホルダー)の場合は、ホルダーインスタンスを作成し、そのパラメーターがオプションの場合でもパラメーター値として渡す必要があります。それ以外の場合は、生成されたスタブクラスにNULLポインタ例外が発生します。ホルダーの中に何も入れないでください。

+0

そうであるようです。ありがとう! – tputkonen

関連する問題