codestretch.java

来自「著名的uncle Bob的Agile software development的」· Java 代码 · 共 37 行

JAVA
37
字号
Vector d_params = new Vector();
d_params.addElement(
	new Parameter("name", String.class, "Robert", null));
d_params.addElement(
	new Parameter("id", int.class, new Integer(7734), null)

Call call = new Call();

call.setTargetObjectURI(d_objectUri);
call.setMethodName(d_methodName);
call.setEncodingStyleURI(d_encodingStyleURI);
call.setParams(d_params);

Response = d_resp;

// invoke the call.
try
{
    d_resp = call.invoke(s_url, "");
}
catch (SOAPException e)
{
    System.err.println("Caught SOAPException (" 
		+ e.getFaultCode() + "): " + e.getMessage());
}

Object rtnValue = null;
if (d_resp.generatedFault())
{
    outputFault(d_methodName, d_resp);
}
else
{
    Parameter ret = d_resp.getReturnValue();
    rtnValue = SoapUtils.fromByteArray((byte[]) ret.getValue());
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?