首页 新闻 会员 周边

.net 调用 java的webservice ,遇上 <wsse:Security> 错误

0
悬赏园豆:100 [已解决问题] 解决于 2014-08-29 09:06

服务方提供了 webservice

wsdl里面有 jaxb:version="2.0"

我使用vs2013 生成了调用代理,主要方法如下

在config文件里面是

<system.serviceModel>
        <bindings>
            <basicHttpBinding>
              <binding name="ICustomerServiceSOAP11Binding" >
               
              </binding>
            </basicHttpBinding>
        </bindings>
        <client>
          <endpoint address="http://....:8080/uapws/service/nc.fdc.ws.services.icustomer.ICustomerService"
              binding="basicHttpBinding" bindingConfiguration="ICustomerServiceSOAP11Binding"
              contract="NcService.ICustomerServicePortType" name="ICustomerServiceSOAP11port_http">
          </endpoint>
        </client>
    </system.serviceModel>

我在程序中调用代码如下

CustomerServicePortTypeClient client = new  CustomerServicePortTypeClient();
string s= client.initCustomers("abc");

然后就遇上异常

  An error was discovered processing the <wsse:Security> header

请问该如何处理?

另外问一下,生成的代理类使用方式。

谢谢!

Simple is best的主页 Simple is best | 初学一级 | 园豆:20
提问于:2014-08-28 09:41
< >
分享
最佳答案
0

最后是ws提供方修改了ws后,问题解决。

谢谢各位

Simple is best | 初学一级 |园豆:20 | 2014-08-29 09:05

原来你也被队友坑了~哈哈~

幻天芒 | 园豆:37175 (高人七级) | 2014-08-29 09:54
其他回答(4)
0

请起头不正确吗,感觉是。

我们用.net调用jax发布的WebService,一直报400错误,最后还是用soapUI这个工具查看请求报文,然后手动构造WebRequest来解决的呢~

收获园豆:50
幻天芒 | 园豆:37175 (高人七级) | 2014-08-28 09:49
0

你在VS里面添加WEB引用的时候就会生成代理类的呀,引用地址输入http://xxx/OperaUser.asmx?wsdl 这样就会生成代理类的。

我最近也是调用java的webservice,没有你说的情况,另外,你的java webservice是用什么架构发布的?java发布webservice有好几种架构呢,不同的架构在使用的时候,数据格式像是有点小差别。

收获园豆:25
Alex_QY1987 | 园豆:1888 (小虾三级) | 2014-08-28 10:11
0

对这个问题不是很了解,搜索了下,给你个连接参考,虽然是java的,应该也有参考价值:

 

http://blog.sina.com.cn/s/blog_77a2a8b301015fls.html

收获园豆:25
519740105 | 园豆:5810 (大侠五级) | 2014-08-28 10:12
0

请问java端怎么改的了?

玩吧华华 | 园豆:201 (菜鸟二级) | 2015-04-20 16:51

这部分不是我开发的,不清楚

支持(0) 反对(0) Simple is best | 园豆:20 (初学一级) | 2015-08-22 19:57
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册