2
votes

I'm using Eclipse to automatically create a WebLogic web service (not client) from a pre-existing WSDL. It receives 3 request parameters (String, String, byte[]) and responds with 1 parameter (byte[]). However the auto-generated class contains code that produces the following error:

Endpoint interface method "public byte[] sign(java.lang.String, java.lang.String, byte[])" must be implemented in the Web Service.

But the sign method clearly exist in the code.

So, I tried creating a really simple WSDL to test the auto-generation of web service. This time the WSDL defined 2 request parameter (int, int) and 1 response (int).

This time the error did not show up and worked just fine.

Tools I'm using

  • Eclipse - 3.7.1
  • Oracle Enterprise Pack for Eclipse 11.1.1.8.0
  • Oracle WebLogic Server 11gR1 (10.3.6)
  • Class auto generation done by Oracle JAX-WS 2.1.5
  • Windows 7 - 32 bit with 1.6 JDK/JRE

Steps to reproduce the error:

  1. Launch Eclipse
  2. File → New → Web Service Project
  3. Import this WSDL to your WEB-INF/wsdl directory.
  4. Right click on the WSDL file name and click WebLogic Web Services → Generate Web Service
  5. Notice the error in the produced dss_DSSPortImpl class file.

Repeat the above step with this WSDL and produced class file works fine.

Any help is really appreciated. Thanks!


(The namespace on the WSDL files have been changed from my test due to privacy reasons.)

1

1 Answers

1
votes

I do not have OEPE installed on my laptop at present so cannot reproduce your exact steps but this might be useful:

If you look carefully at the problem wsdl, you will see two elements in the SignResponse: 'signature' and 'status'. Because more than one element is in the response message, wsimport generates one Holder argument per output parameter as part of the method signature to provide buckets to return each argument. When I run wsimport directly against the problem wsdl, I get the following (expected) signature in the service interface (Adapter.java):

public void sign(
    @WebParam(name = "userId", targetNamespace = "")
    String userId,
    @WebParam(name = "fileType", targetNamespace = "")
    String fileType,
    @WebParam(name = "fileContent", targetNamespace = "")
    byte[] fileContent,
    @WebParam(name = "signature", targetNamespace = "", mode = WebParam.Mode.OUT)
    Holder<byte[]> signature,
    @WebParam(name = "status", targetNamespace = "", mode = WebParam.Mode.OUT)
    Holder<String> status);

I suspect that if you generate the stubs against the first wsdl via wsimport (I do know that generation in this fashion deploys fine to WLS as that is my typical method and WebLogic is our deployment environment) you will be successful.