📄 call.java
字号:
if (!encodingStyleExplicitlySet) { String encStyle = ""; if (operationUse == Use.ENCODED) { // RPC style defaults to encoded, otherwise default to literal encStyle = msgContext.getSOAPConstants().getEncodingURI(); } msgContext.setEncodingStyle(encStyle); } } /** * Get the operation use. * * @return the <code>Use</code> of the operation */ public Use getOperationUse() { if (operation != null) { return operation.getUse(); } return Use.DEFAULT; } // getOperationStyle /** * Flag to indicate if soapAction should be used. * * @param useSOAPAction true if the soapAction header is to be used to * help find the method to invoke, false otherwise */ public void setUseSOAPAction(boolean useSOAPAction) { this.useSOAPAction = useSOAPAction; } // setUseSOAPAction /** * Discover if soapAction is being used. * * @return true if it is, false otherwise */ public boolean useSOAPAction() { return useSOAPAction; } // useSOAPAction /** * Set the soapAction URI. * * @param SOAPActionURI the new SOAP action URI */ public void setSOAPActionURI(String SOAPActionURI) { useSOAPAction = true; this.SOAPActionURI = SOAPActionURI; } // setSOAPActionURI /** * Get the soapAction URI. * * @return the curretn SOAP action URI */ public String getSOAPActionURI() { return SOAPActionURI; } // getSOAPActionURI /** * Sets the encoding style to the URL passed in. * * @param namespaceURI URI of the encoding to use. */ public void setEncodingStyle(String namespaceURI) { encodingStyleExplicitlySet = true; msgContext.setEncodingStyle(namespaceURI); } /** * Returns the encoding style as a URI that should be used for the SOAP * message. * * @return String URI of the encoding style to use */ public String getEncodingStyle() { return msgContext.getEncodingStyle(); } /** * Sets the endpoint address of the target service port. This address must * correspond to the transport specified in the binding for this Call * instance. * * @param address - Endpoint address of the target service port; specified * as URI */ public void setTargetEndpointAddress(String address) { URL urlAddress; try { urlAddress = new URL(address); } catch (MalformedURLException mue) { throw new JAXRPCException(mue); } setTargetEndpointAddress(urlAddress); } /** * Sets the URL of the target Web Service. * * Note: Not part of JAX-RPC specification. * * @param address URL of the target Web Service */ public void setTargetEndpointAddress(java.net.URL address) { try { if ( address == null ) { setTransport(null); return ; } String protocol = address.getProtocol(); // Handle the case where the protocol is the same but we // just want to change the URL - if so just set the URL, // creating a new Transport object will drop all session // data - and we want that stuff to persist between invoke()s. // Technically the session data should be in the message // context so that it can be persistent across transports // as well, but for now the data is in the Transport object. //////////////////////////////////////////////////////////////// if ( this.transport != null ) { String oldAddr = this.transport.getUrl(); if ( oldAddr != null && !oldAddr.equals("") ) { URL tmpURL = new URL( oldAddr ); String oldProto = tmpURL.getProtocol(); if ( protocol.equals(oldProto) ) { this.transport.setUrl( address.toString() ); return ; } } } // Do we already have a transport for this address? Transport transport = service.getTransportForURL(address); if (transport != null) { setTransport(transport); } else { // We don't already have a transport for this address. Create one. transport = getTransportForProtocol(protocol); if (transport == null) throw new AxisFault("Call.setTargetEndpointAddress", Messages.getMessage("noTransport01", protocol), null, null); transport.setUrl(address.toString()); setTransport(transport); service.registerTransportForURL(address, transport); } } catch( Exception exp ) { log.error(Messages.getMessage("exception00"), exp); // do what? // throw new AxisFault("Call.setTargetEndpointAddress", //"Malformed URL Exception: " + e.getMessage(), null, null); } } /** * Returns the URL of the target Web Service. * * @return URL URL of the target Web Service */ public String getTargetEndpointAddress() { try { if ( transport == null ) return( null ); return( transport.getUrl() ); } catch( Exception exp ) { return( null ); } } public Integer getTimeout() { return timeout; } public void setTimeout(Integer timeout) { this.timeout = timeout; } public boolean getStreaming() { return useStreaming; } public void setStreaming(boolean useStreaming) { this.useStreaming = useStreaming; } // // end properties code. // //////////////////////////// /** * Is the caller required to provide the parameter and return type * specification? * If true, then * addParameter and setReturnType MUST be called to provide the meta data. * If false, then * addParameter and setReturnType SHOULD NOT be called because the * Call object already has the meta data describing the * parameters and return type. If addParameter is called, the specified * parameter is added to the end of the list of parameters. */ public boolean isParameterAndReturnSpecRequired(QName operationName) { return parmAndRetReq; } // isParameterAndReturnSpecRequired /** * Adds the specified parameter to the list of parameters for the * operation associated with this Call object. * * Note: Not part of JAX-RPC specification. * * @param paramName Name that will be used for the parameter in the XML * @param xmlType XMLType of the parameter * @param parameterMode one of IN, OUT or INOUT */ public void addParameter(QName paramName, QName xmlType, ParameterMode parameterMode) { Class javaType = null; TypeMapping tm = getTypeMapping(); if (tm != null) { javaType = tm.getClassForQName(xmlType); } addParameter(paramName, xmlType, javaType, parameterMode); } /** * Adds the specified parameter to the list of parameters for the * operation associated with this Call object. * * * Note: Not part of JAX-RPC specification. * * @param paramName Name that will be used for the parameter in the XML * @param xmlType XMLType of the parameter * @param javaType The Java class of the parameter * @param parameterMode one of IN, OUT or INOUT */ public void addParameter(QName paramName, QName xmlType, Class javaType, ParameterMode parameterMode) { if (operationSetManually) { throw new RuntimeException( Messages.getMessage("operationAlreadySet")); } if (operation == null) operation = new OperationDesc(); ParameterDesc param = new ParameterDesc(); byte mode = ParameterDesc.IN; if (parameterMode == ParameterMode.INOUT) { mode = ParameterDesc.INOUT; param.setIsReturn(true); } else if (parameterMode == ParameterMode.OUT) { mode = ParameterDesc.OUT; param.setIsReturn(true); } param.setMode(mode); param.setQName(new QName(paramName.getNamespaceURI(),Utils.getLastLocalPart(paramName.getLocalPart()))); param.setTypeQName( xmlType ); param.setJavaType( javaType ); operation.addParameter(param); parmAndRetReq = true; } /** * Adds the specified parameter to the list of parameters for the * operation associated with this Call object. * * @param paramName Name that will be used for the parameter in the XML * @param xmlType XMLType of the parameter * @param parameterMode one of IN, OUT or INOUT */ public void addParameter(String paramName, QName xmlType, ParameterMode parameterMode) { Class javaType = null; TypeMapping tm = getTypeMapping(); if (tm != null) { javaType = tm.getClassForQName(xmlType); } addParameter(new QName("", paramName), xmlType, javaType, parameterMode); } /** * Adds a parameter type and mode for a specific operation. Note that the * client code is not required to call any addParameter and setReturnType * methods before calling the invoke method. A Call implementation class * can determine the parameter types by using the Java reflection and * configured type mapping registry. * * @param paramName - Name of the parameter * @param xmlType - XML datatype of the parameter * @param javaType - The Java class of the parameter * @param parameterMode - Mode of the parameter-whether IN, OUT or INOUT * @exception JAXRPCException - if isParameterAndReturnSpecRequired returns * false, then addParameter MAY throw * JAXRPCException....actually Axis allows * modification in such cases */ public void addParameter(String paramName, QName xmlType, Class javaType, ParameterMode parameterMode) { addParameter(new QName("", paramName), xmlType, javaType, parameterMode); } /** * Adds a parameter type as a soap:header. * * @param paramName - Name of the parameter * @param xmlType - XML datatype of the parameter * @param parameterMode - Mode of the parameter-whether IN, OUT or INOUT * @param headerMode - Mode of the header. Even if this is an INOUT * parameter, it need not be in the header in both * directions. * @throws JAXRPCException - if isParameterAndReturnSpecRequired returns * false, then addParameter MAY throw * JAXRPCException....actually Axis allows * modification in such cases */ public void addParameterAsHeader(QName paramName, QName xmlType, ParameterMode parameterMode, ParameterMode headerMode) { Class javaType = null; TypeMapping tm = getTypeMapping(); if (tm != null) { javaType = tm.getClassForQName(xmlType); } addParameterAsHeader(paramName, xmlType, javaType, parameterMode, headerMode); } /** * Adds a parameter type as a soap:header. * @param paramName - Name of the parameter * @param xmlType - XML datatype of the parameter * @param javaType - The Java class of the parameter * @param parameterMode - Mode of the parameter-whether IN, OUT or INOUT * @param headerMode - Mode of the header. Even if this is an INOUT * parameter, it need not be in the header in both * directions. * @exception JAXRPCException - if isParameterAndReturnSpecRequired returns * false, then addParameter MAY throw * JAXRPCException....actually Axis allows * modification in such cases */ public void addParameterAsHeader(QName paramName, QName xmlType, Class javaType, ParameterMode parameterMode, ParameterMode headerMode) { if (operationSetManually) { throw new RuntimeException(
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -