Creating Stubs to .NET Web Services

This topic contains information to help you when you create a stub or skeleton to a .NET web service using the Web Service Stub/Skeleton wizard.

Creating a Stub that Uses Array Types

When JDeveloper creates a stub to a .NET web service that uses the array type ArrayList, the associated JavaBean generated by the wizard contains an unknown type. For example

private UnKnown[] m_Producers

You should edit the generated code in the JavaBean to change the type UnKnown[] to the type that is expected at runtime, for example, String[].

Creating a Stub for .NET Web Service where .NET types inherit other .NET types

When JDeveloper creates a stub to a .NET web service that contains types that inherit from other .NET types, the JavaBean created for the inherited type does not correctly reflect the inheritence. Follow the stesp below to resolve this issue. This describes how to create stub to a web service that uses the .NET complex type Bean1 and type Bean2, which extends Bean1.

  1. After running the Web Service Stub/Skeleton wizard, create an inherited Bean2 JavaBean by hand.
  2. Copy the stub for a web service that returns the Bean1 complex type.
  3. Modify the copied stub to use Bean2 everywhere that Bean1 was used in the original stub, and if you are passing in a value make sure that the name of the parameter matches.

Running a Stub for a .NET Web Service From a JSP

When you create a stub or proxy to a .NET web service, before running the stub from a JSP on Oracle Application Server or an external instance of OC4J, you need to add a library to the deployment, otherwise the stub will fail. This is because the library jdev-rt.jar, which contains a class that is used for .NET web services and that is present in all projects run from JDeveloper, is not on the classpath of OC4J so when the JSP executes it can't find the class.

To avoid this happening, you can add jdev-rt.jar to the deployment profile dependencies so that it is deployed to OC4J.

  1. Open the JAR Deployment Profile Settings dialog by select double-clicking the .deploy node in the navigator.
  2. Select Dependency Analyser in the left pane, then select jdev-rt.jar to add the library to the deployment profile.
  3. Click OK, then redeploy your application.

Creating a Stub with Overloaded Methods to a .NET Web Service

When you create a stub to a .NET web service that contains more than one method with the same name, the stub is generated with just one method present, for example:

public Float Add(Float a, Float b) throws Exception

You must manually edit the stub to add the additional overloaded methods, for example:

public Float Add(Float a, Float b) throws Exception
public Integer Add(Integer a, Integer b) throws Exception



Copyright © 1997, 2004, Oracle. All rights reserved.