近日,在项目中需要引用java发布的WebService,添加服务引用后,调用一切正常。
配置如下:
<system.serviceModel> <bindings> <basicHttpBinding> <binding name="SecurityServiceImplServiceSoapBinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"/> </basicHttpBinding> </bindings> <client> <endpoint address="http://10.10.10.10:80/securityService" binding="basicHttpBinding" bindingConfiguration="SecurityServiceImplServiceSoapBinding" contract="Service.ISecurityService" name="SecurityServiceImplPort" /> </client> </system.serviceModel>
部署到IIS6上,服务无法调用,折腾一下午,终于搞清是由于配置文件的原因:
修改后如下:
<system.serviceModel> <bindings> <wsHttpBinding> <binding name="WSHttpBinding_IUpService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" useDefaultWebProxy="true" allowCookies="false"> <security mode="None" /> </binding> </wsHttpBinding> </bindings> <client> <endpoint address="http://10.10.10.10:80/UpService/UPService.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IUpService" contract="PermissionService.IUpService" name="WSHttpBinding_IUpService" /> </client> </system.serviceModel>
修改了一下配置,服务正常调用.
原因大概是用于的vs版本大概比较高,所以生成的WebService配置文件,IIS6无法识别,配置文件需要详细列出配置详情。