日期:2014-05-17  浏览次数:20652 次

java调用远程wcf的问题
wsdl文件是这样的

<wsdl:service name="SDKService">
  <wsdl:port name="WSHttpBinding_ISDKService" binding="tns:WSHttpBinding_ISDKService">


<soap12:address location="http://localhost:8891/SDK"/>
  <wsa10:EndpointReference>
<wsa10:Address>http://localhost:8891/SDK</wsa10:Address>
</wsa10:EndpointReference>
</wsdl:port>
</wsdl:service>

使用wsimport生成java代码后,怎么修改代码可以远程访问呢?现在只能访问本地的wcf。
有个C#的示例可以通过修改.config来改这个endpointrefrence,但是没找到java修改的方法。
------解决方案--------------------

public ISDKService getWSHttpBindingISDKService() {
        return super.getPort(new QName("http://tempuri.org/", "WSHttpBinding_ISDKService"), ISDKService.class);
    }

------解决方案--------------------
上面的代码得到的总是http://localhost:8891/SDK
如果想远程访问怎么办呢?
wcf发布在192.168.1.2上。
------解决方案--------------------
人气不够啊,还是问题太白?肿么木有人解答呢