java Server无法处理请求值不能为null

时间:2013-03-12 12:21:48

标签: java web-services apache tomcat

我遇到了这个例外:

  

服务器无法处理请求。 --->值不能为null。参数名称:输入

如何找到参数:input?而且,我如何解决根问题?我正在从Java客户端调用ASP.net中的Web方法。

这是代码:

public org.tempuri.UpdateInsuredDetails_Output recieveMDMDataInsuredDetails(
        org.tempuri.UpdateInsuredDetails_Input l_input)
        throws java.rmi.RemoteException {
    if (super.cachedEndpoint() == null) {
        throw new org.apache.axis.NoEndPointException();
    }
    org.apache.axis.client.Call _call = createCall();
    _call.setOperation(_operations[2]);
    _call.setUseSOAPAction(true);
    _call.setSOAPActionURI("http://tempuri.org/RecieveMDMDataInsuredDetails");
    _call.setEncodingStyle(null);
    _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR,
            Boolean.FALSE);
    _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS,
            Boolean.FALSE);
    _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
    _call.setOperationName(new javax.xml.namespace.QName(
            "http://tempuri.org/", "RecieveMDMDataInsuredDetails"));
    setRequestHeaders(_call);

    setAttachments(_call);
    try {
        logger.info("this is where i get the error:");
        java.lang.Object _resp = _call
                .invoke(new java.lang.Object[] { l_input });
        if (_resp instanceof java.rmi.RemoteException) {
            throw (java.rmi.RemoteException) _resp;
        } else {
            extractAttachments(_call);
            try {
                return (org.tempuri.UpdateInsuredDetails_Output) _resp;
            } catch (java.lang.Exception _exception) {
                return (org.tempuri.UpdateInsuredDetails_Output) org.apache.axis.utils.JavaUtils
                        .convert(
                                _resp,
                                org.tempuri.UpdateInsuredDetails_Output.class);
            }
        }
    } catch (org.apache.axis.AxisFault axisFaultException) {
        throw axisFaultException;
    }
}

这就是我如何调用recieveMDMDataInsuredDetails方法:

InsuredDetailsLocator MDP_locator =new InsuredDetailsLocator(); 
            MDP_locator.setInsuredDetailsSoapEndpointAddress("http://mgnt184:8056/MDP_InsuredDetails_WS/InsuredDetails.asmx?wsdl");
            InsuredDetailsSoapStub service= (InsuredDetailsSoapStub)MDP_locator.getInsuredDetailsSoap(); 
            UpdateInsuredDetails_Input request_MDP =new UpdateInsuredDetails_Input();
            request_MDP.setSystemName(urlProps.getProperty("xxx"));
            request_MDP.setSystemPassword(urlProps.getProperty("xxxx"));

            request_MDP.setMS_ZIHUY(insuree.getMsZihuy());
            request_MDP.setKOD_CHEVRA(insuree.getKodChevra());
            request_MDP.setFAMILY_NAME(insuree.getFamilyName());
            request_MDP.setFIRST_NAME(insuree.getFirstName());
            request_MDP.setKOD_MIN(insuree.getKodMin());
//calling the method:   
UpdateInsuredDetails_Output response_MDP= service.recieveMDMDataInsuredDetails(request_MDP);

可能是input,它是xml文件中的那个:

<wsdl:portType name="InsuredDetailsSoap">
<wsdl:operation name="GetInsuredDetails">
<wsdl:input message="tns:GetInsuredDetailsSoapIn" />
<wsdl:output message="tns:GetInsuredDetailsSoapOut" />
</wsdl:operation>
<wsdl:operation name="UpdateInsuredDetails">
<wsdl:input message="tns:UpdateInsuredDetailsSoapIn" />
<wsdl:output message="tns:UpdateInsuredDetailsSoapOut" />
</wsdl:operation>
<wsdl:operation name="RecieveMDMDataInsuredDetails">
<wsdl:input message="tns:RecieveMDMDataInsuredDetailsSoapIn" />
<wsdl:output message="tns:RecieveMDMDataInsuredDetailsSoapOut" />
</wsdl:operation>
</wsdl:portType>

1 个答案:

答案 0 :(得分:0)

好像在说l_inputnull ......而且不应该这样。

l_inputrecieveMDMDataInsuredDetails方法的参数。

因此,我得出结论使用无效参数调用方法。看看(你的?)代码调用方法的位置,等等。


如果这没有帮助,请将问题的例外的完整堆栈跟踪与调用recieveMDMDataInsuredDetails的代码一起添加。

(请修复你的代码中的拼写错误。这会让我的大脑受伤!“收到” - &gt;“收到”!!!)