8-10 Programming Advanced Features of JAX-RPC Web Services for Oracle WebLogic Server
throws ServiceException, RemoteException{ JMSTransportService service = new JMSTransportService_Implargs[0] + ?WSDL
; JMSTransportPortType port = service.getJMSTransportServicePort;
Stub stub = Stub port; stub._setPropertyWLStub.JMS_TRANSPORT_JNDI_URL,
t3:shackell01.amer.com:7001; try {
String result = null;
result = port.sayHelloHi there ; System.out.println Got JMS result: + result ;
} catch RemoteException e { throw e;
} }
}
See WLStub in Oracle WebLogic Server API Reference for additional stub properties.
8.8.2 Using JMS BytesMessage Rather Than the Default TextMessage
When you use JMS transport, the Web services runtime uses, by default, the javax.jms.TextMessage
object to send the message. This is usually adequate for most client applications, but sometimes you might need to send binary data rather
than ordinary text; in this case you must request that the Web services runtime use javax.jms.BytesMessage
instead. To do this, use the WLStub.JMS_TRANSPORT_ MESSAGE_TYPE
stub property in your client application and set it to the value WLStub.JMS_BYTESMESSAGE
, as shown in the following example: stub._setPropertyWLStub.JMS_TRANSPORT_MESSAGE_TYPE,
WLStub.JMS_BYTESMESSAGE; The Web services runtime sends back the response using the same message data type
as the request. See
Section 8.8.1, Overriding the Default Service Address URL for a full example of a
client application in which you can set this property. See WLStub in Oracle WebLogic Server API Reference for additional stub properties.
8.8.3 Disabling HTTP Access to the WSDL File
As described in Section 8.8, Invoking a WebLogic Web Service Using JMS Transport
, the WSDL of the deployed Web service is, by default, still accessible using HTTP. If
you want to disable access to the WSDL file, in particular if your Web service can be accessed outside of a firewall, then you can do one of the following:
■
Use the weblogic.jws.WSDL annotation in your JWS file to programmatically disable access. For details, see weblogic.jws.WSDL in WebLogic Web Services
Reference for Oracle WebLogic Server.
■
Use the Administration Console to disable access to the WSDL file after the Web service has been deployed. In this case, the configuration information will be
stored in the deployment plan rather than through the annotation.
Using JMS Transport as the Connection Protocol 8-11
To use the Administration Console to perform this task, go to the Configuration - General page of the deployed Web service and uncheck the View Dynamic WSDL
Enabled check box. After saving the configuration to the deployment plan, you
must redeploy update the Web service, or Enterprise Application which contains it, for the change to take effect.
8-12 Programming Advanced Features of JAX-RPC Web Services for Oracle WebLogic Server
9
Creating and Using SOAP Message Handlers 9-1
9
Creating and Using SOAP Message Handlers
The following sections provide information about creating and using SOAP message handlers:
■
Section 9.1, Overview of SOAP Message Handlers