webservie的调用方式的一个问题,还存在疑惑

1,问题
(1)
    <wsdl:service name="UaService">
        <wsdl:port name="UaServiceSOAP11port_http" binding="ns0:UaServiceSOAP11Binding">
            <soap:address location="http://11.0.2.20:9080/UAWeb/services/UaService"/>
        </wsdl:port>
        <wsdl:port name="UaServiceSOAP12port_http" binding="ns0:UaServiceSOAP12Binding">
            <soap12:address location="http://11.0.2.20:9080/UAWeb/services/UaService"/>
        </wsdl:port>
        <wsdl:port name="UaServiceHttpport" binding="ns0:UaServiceHttpBinding">
            <http:address location="http://11.0.2.20:9080/UAWeb/services/UaService"/>
        </wsdl:port>
    </wsdl:service>

此wsdl是通过was生产的
用动态调用方式会报错DynamicInvoker,空指针异常
(2)
	<wsdl:service name="UaService">
		<wsdl:documentation>   
           服务地址描述  
       </wsdl:documentation>
		<wsdl:port name="UaServer" binding="tns:UaServerBinding">
			<soap:address location="http://localhost:8080/UaService/UAAuth"/>
		</wsdl:port>
	</wsdl:service>

此种方式DynamicInvoker不会报异常,
DynamicInvoker依赖于wsdl
这个问题是与多个service元素绑定多个特定地址有关么?

2,换一种调用方式,也是不行
String reqStr = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><CAPRoot><SessionHeader><ServiceCode>CAP01001</ServiceCode><Version>2009062411025800</Version><ActionCode>0</ActionCode><TransactionID>99002200912181234567890</TransactionID><SrcSysID>99002</SrcSysID><DstSysID>99</DstSysID><ReqTime>20091218172818</ReqTime><DigitalSign/></SessionHeader><SessionBody><AuthReq><AuthInfo><AccountType>2000003</AccountType><AccountID>01088018352</AccountID><PWDType>00</PWDType><Password>333333</Password></AuthInfo></AuthReq></SessionBody></CAPRoot>";
String endpoint = " http://172.19.17.27:9000/auth/services/UaService";
Service service = new Service();
Call call = null;
call = (Call) service.createCall();
call.setOperationName(new javax.xml.namespace.QName(endpoint, "authReq"));
call.setTargetEndpointAddress(new java.net.URL(endpoint));
String responseInfo = (String) call.invoke(new Object[] { reqStr });
System.out.println("return value is: " + responseInfo);


3,通过生产的方式调用,可以处理。

你可能感兴趣的:(java,xml,.net)