* @param name Name of the property
* @param value Value of the property
*/
public void setProperty(String name, Object value) {
if (name == null || value == null) {
throw new JAXRPCException(
Messages.getMessage(name == null ?
"badProp03" : "badProp04"));
}
else if (name.equals(USERNAME_PROPERTY)) {
if (!(value instanceof String)) {
throw new JAXRPCException(
Messages.getMessage("badProp00", new String[] {
name, "java.lang.String", value.getClass().getName()}));
}
setUsername((String) value);
}
else if (name.equals(PASSWORD_PROPERTY)) {
if (!(value instanceof String)) {
throw new JAXRPCException(
Messages.getMessage("badProp00", new String[] {
name, "java.lang.String", value.getClass().getName()}));
}
setPassword((String) value);
}
else if (name.equals(SESSION_MAINTAIN_PROPERTY)) {
if (!(value instanceof Boolean)) {
throw new JAXRPCException(
Messages.getMessage("badProp00", new String[]
{name,
"java.lang.Boolean",
value.getClass().getName()}));
}
setMaintainSession(((Boolean) value).booleanValue());
}
else if (name.equals(OPERATION_STYLE_PROPERTY)) {
if (!(value instanceof String)) {
throw new JAXRPCException(
Messages.getMessage("badProp00", new String[] {
name, "java.lang.String", value.getClass().getName()}));
}
setOperationStyle((String) value);
}
else if (name.equals(SOAPACTION_USE_PROPERTY)) {
if (!(value instanceof Boolean)) {
throw new JAXRPCException(
Messages.getMessage("badProp00", new String[]
{name,
"java.lang.Boolean",
value.getClass().getName()}));
}
setUseSOAPAction(((Boolean) value).booleanValue());
}
else if (name.equals(SOAPACTION_URI_PROPERTY)) {
if (!(value instanceof String)) {
throw new JAXRPCException(
Messages.getMessage("badProp00", new String[]
{name,
"java.lang.String",
value.getClass().getName()}));
}
setSOAPActionURI((String) value);
}
else if (name.equals(ENCODINGSTYLE_URI_PROPERTY)) {
if (!(value instanceof String)) {
throw new JAXRPCException(
Messages.getMessage("badProp00", new String[]
{name,
"java.lang.String",
value.getClass().getName()}));
}
setEncodingStyle((String) value);
}
else if (name.equals(Stub.ENDPOINT_ADDRESS_PROPERTY)) {
if (!(value instanceof String)) {
throw new JAXRPCException(
Messages.getMessage("badProp00", new String[]
{name,
"java.lang.String",
value.getClass().getName()}));
}
setTargetEndpointAddress((String) value);
}
else if ( name.equals(TRANSPORT_NAME) ) {
if (!(value instanceof String)) {
throw new JAXRPCException(
Messages.getMessage("badProp00", new String[] {
name, "java.lang.String", value.getClass().getName()}));
}
transportName = (String) value ;
if (transport != null)
transport.setTransportName((String) value);
}
else if ( name.equals(ATTACHMENT_ENCAPSULATION_FORMAT) ) {
if (!(value instanceof String)) {
throw new JAXRPCException(
Messages.getMessage("badProp00", new String[] {
name, "java.lang.String", value.getClass().getName()}));
}
if(!value.equals(ATTACHMENT_ENCAPSULATION_FORMAT_MIME ) &&
!value.equals(ATTACHMENT_ENCAPSULATION_FORMAT_DIME ))
throw new JAXRPCException(
Messages.getMessage("badattachmenttypeerr", new String[] {
(String) value, ATTACHMENT_ENCAPSULATION_FORMAT_MIME + " "
+ATTACHMENT_ENCAPSULATION_FORMAT_DIME }));
}
else if (name.startsWith("java.") || name.startsWith("javax.")) {
throw new JAXRPCException(
Messages.getMessage("badProp05", name));
}
callProperties.put(name, value);
} // setProperty