Download WebLogic Web Service

Transcript
W ri ti n g A d va n ce d Ja v a C l i en t Ap p l i c at i o ns
call.addParameter( "inputStruct",
new QName( "http://soapinterop.org/xsd", "SOAPStruct" ),
ParameterMode.IN);
call.setReturnType(
new QName( "http://soapinterop.org/xsd", "SOAPStruct" ) );
//set end point address
call.setTargetEndpointAddress(
"http://www.mssoapinterop.org/asmx/simple.asmx" );
SOAPStruct s = new SOAPStruct();
s.setVarInt(2);
s.setVarString("foo");
s.setVarFloat(123123);
System.out.println(s.toString());
SOAPStruct res = (SOAPStruct) call.invoke(new Object[]{s} );
System.out.println( res );
}
}
Writing a J2ME Client
You can create a Java 2 Platform, Micro Edition (J2ME) Web Service-specific client JAR file to
use with client applications that run on J2ME.
Note: BEA supports the CDC and Foundation profile J2ME environment.
Creating a J2ME client application that invokes a Web Service is similar to creating a non-J2ME
client. For example, you use the same runtime client JAR file as non-J2ME client applications
(WL_HOME/server/lib/webserviceclient.jar.)
To write a J2ME client application, follow the steps described in “Creating Java Client
Applications to Invoke Web Services: Main Steps” on page 7-4 but with the following changes:
!
When you run the clientgen Ant task to generate the Web Service-specific client JAR
file, be sure you specify the j2me="True" attribute, as shown in the following example:
<clientgen wsdl="http://example.com/myapp/myservice.wsdl"
packageName="myapp.myservice.client"
clientJar="myapps/myService_clients.jar"
j2me="True"
/>
Note: The J2ME Web Service-specific client JAR file generated by clientgen is not
compliant with the JAX-RPC specification in the following ways:
Programming WebLogic Web Services
7-31