Axis2 调用WCF 的wshttpbinding 出现问题,谁帮忙看看万分感谢

问题描述

我用Axis2写的clint调用。netWCF开发的服务时报错,服务端本身没有问题一下是错误:log4j:WARNNoappenderscouldbefoundforlogger(org.apache.axis2.deployment.FileSystemConfigurator).log4j:WARNPleaseinitializethelog4jsystemproperly.1*********************[MessageContext:logID=urn:uuid:B35DA7955AD7EA6E4E1295269716165]2*********************nullorg.apache.axis2.AxisFault:Theserverdidnotrecognisetheactionwhichitreceived.atorg.apache.axis2.handlers.addressing.AddressingInFaultHandler.invoke(AddressingInFaultHandler.java:114)atorg.apache.axis2.engine.Phase.invoke(Phase.java:318)atorg.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:259)atorg.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:165)atorg.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:364)atorg.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421)atorg.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)atorg.apache.axis2.client.OperationClient.execute(OperationClient.java:165)atorg.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:556)atorg.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:532)atTestClient.main(TestClient.java:103)JAVA代码如下:ConfigurationContextctx=ConfigurationContextFactory.createConfigurationContextFromFileSystem("./client-repo",null);ServiceClientsender=newServiceClient(ctx,null);Optionsoptions=newOptions();options.setTimeOutInMilliSeconds(600000L);options.setAction("TYKY.cMashup/2011/01/10/3.0/IPlatformServiceProvider/ValidateUser");options.setTo(TARGET_EPR);//options.setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED,Boolean.TRUE);options.setProperty(Configuration.MESSAGE_TYPE,"text/xml;charset=utf-8");options.setProperty(Configuration.CONTENT_TYPE,"text/xml;charset=utf-8");options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);options.setProperty(RampartMessageData.KEY_RAMPART_POLICY,loadPolicy("client-repo/policys/PlatfromServeive.xml"));options.setTimeOutInMilliSeconds(600000L);sender.setOptions(options);sender.engageModule("rampart");sender.engageModule("addressing");OMElementmethod=null;OMElementfromWriter=null;OMFactoryfactory=OMAbstractFactory.getOMFactory();OMNamespaceomNs=factory.createOMNamespace("TYKY.cMashup/2011/01/10/3.0/","xs");method=factory.createOMElement("ValidateUser",omNs);fromWriter=factory.createOMElement("token",omNs);fromWriter.addChild(factory.createOMText(fromWriter,"ssss"));method.addChild(fromWriter);OMElementresult=sender.sendReceive(method);System.out.println("sendTempMessage:"+result.getFirstElement().getText());一下是wsdl;<?xmlversion="1.0"encoding="utf-8"?>-<wsdl:definitionsname="PlatformServiceProvider"targetNamespace="http://tempuri.org/"xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"xmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"xmlns:tns="http://tempuri.org/"xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"xmlns:i0="TYKY.cMashup/2011/01/10/3.0"xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy"xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract"xmlns:wsa10="http://www.w3.org/2005/08/addressing"xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata">-<wsp:Policywsu:Id="WSHttpBinding_IPlatformServiceProvider_policy">-<wsp:ExactlyOne>-<wsp:All>-<wsrm:RMAssertionxmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"><wsrm:InactivityTimeoutMilliseconds="600000"/><wsrm:AcknowledgementIntervalMilliseconds="200"/></wsrm:RMAssertion><wsaw:UsingAddressing/></wsp:All></wsp:ExactlyOne></wsp:Policy><wsdl:importnamespace="TYKY.cMashup/2011/01/10/3.0"location="http://192.9.206.185:8888/PlatformServices.svc?wsdl=wsdl0"/><wsdl:types/>-<wsdl:bindingname="WSHttpBinding_IPlatformServiceProvider"type="i0:IPlatformServiceProvider"><wsp:PolicyReferenceURI="#WSHttpBinding_IPlatformServiceProvider_policy"/><soap12:bindingtransport="http://schemas.xmlsoap.org/soap/http"/>-<wsdl:operationname="ValidateUser"><soap12:operationsoapAction="TYKY.cMashup/2011/01/10/3.0/IPlatformServiceProvider/ValidateUser"style="document"/>-<wsdl:input><soap12:bodyuse="literal"/></wsdl:input>-<wsdl:output><soap12:bodyuse="literal"/></wsdl:output></wsdl:operation></wsdl:binding>-<wsdl:servicename="PlatformServiceProvider">-<wsdl:portname="WSHttpBinding_IPlatformServiceProvider"binding="tns:WSHttpBinding_IPlatformServiceProvider"><soap12:addresslocation="http://192.9.206.185:8888/PlatformServices.svc"/>-<wsa10:EndpointReference><wsa10:Address>http://192.9.206.185:8888/PlatformServices.svc</wsa10:Address></wsa10:EndpointReference></wsdl:port></wsdl:service></wsdl:definitions>哪位高手帮忙看看,万分感谢

解决方案

解决方案二:
把配置文件中的WSHttpBinding改成basicHttpBinding就可以啦!

时间: 2024-08-12 10:33:39

Axis2 调用WCF 的wshttpbinding 出现问题,谁帮忙看看万分感谢的相关文章

关于AXIS2 调用WCF的问题

问题描述 大家好,我使用AXIS2调用WCF的时候遇到了如下的错误:Exceptioninthread"main"org.apache.axis2.AxisFault:MustUnderstandcheckfailedforheaderhttp://www.w3.org/2005/08/addressing:Action我通过两种方法调用都是一样的错误,axis2的工具生成的方法以及手写的方法,手写的方法如下:packagews;importjavax.xml.namespace.QN

wcf-如何将WCF服务寄宿在MVC,求大神帮忙,万分感谢

问题描述 如何将WCF服务寄宿在MVC,求大神帮忙,万分感谢 我在一个解决方案下建立两个项目,一个MVC项目,一个WCF服务库,我想当我将MVC发布的同时,WCF服务也可以被其他项目调用,该如何做? 解决方案 没必要,mvc本身是托管在iis上的,你的wcf也可以托管在iis上.

关于Axis2调用WCF WSHttpbinding的问题

问题描述 我现在在写一个Axis2调用WCFWSHttpbinding的Demo.BasicHttpbinding没有问题.关键在于我的WCFWSHttpbinding的header里面居然有RequestSecurityTokenResponse和Policy尝试用axis2/Rampart来调用,也不正确,先用STSClient(SecurityTokenService)来得到Token,然后再去提交WS访问想问几个问题1)是否WCF下WSHttpbinding默认是把RequestSecu

COM(VB/VBA/Script)利用服务标记调用WCF服务之四:使用配置文件

这几天友人同学说他在COM利用服务标记调用WCF服务的时候遇到一个问题,就是他返回的的Soap消息 大于65536这个wsHttpBinding的缺省值,引发调用错误.需要将MaxReceivedMessageSize更改成可以容纳 大消息内容的值.在我前面的三篇文章中使用的都是缺省的wsHttpBinding,所以不存在这个问题.现在 需要更改缺省值自然就需要增加配置来达到目的.目前最关键的问题就是:是否能让VB/VBA/Script来使 用配置文件呢?如果可以,那如何让VB,VBA, Scr

web service-gSoap可以访问WCF绑定wshttpbinding方式的WebService吗?

问题描述 gSoap可以访问WCF绑定wshttpbinding方式的WebService吗? WebService 服务端是用C#用WCF写的,想用C++访问WebService的服务器,就用了gSoap2.8.试了几次发现gSoap似乎只能访问basicHttpbinding方式的WCF,而不能访问WsHttpBinding方式的WCF.不知道是我哪里用的不对,还是gSoap就是不能调用wsHttpbinding的WCF? 解决方案 查了一些例子,也都是访问BasicHttpbinding的

总结C#动态调用WCF接口的两种方法_C#教程

如何使用 1.第一种方式比较简单,而且也是大家喜欢的,因为不需要任何配置文件就可解决,只需知道服务契约接口和服务地址就可以调用. 2.使用Invoke的方式,但是需要在调用客户端配置WCF,配置后在Invoke类里封装服务契约接口即可. 客户端调用DEMO //第一种方式 string url = "http://localhost:3000/DoubleService.svc"; IDoubleService proxy = WcfInvokeFactory.CreateServic

Winform 调用WCF客户端,所有服务端方法在运行的时候均找不到(编译没有问题)

  今天在开发过程中遇到了一个很恶心的问题,就是Form窗体ShowDialog的时候,直接报出下面的错误: 有关调用实时(JIT)调试而不是此对话框的详细信息, 请参见此消息的结尾. ************** 异常文本 ************** System.MissingMethodException: 找不到方法:"XXX.XXX.DataObject.SPI.DataObjectColumn[] XXX.XXX.WCFClient.WCFService.ServiceClient

ExtJS调用WCF系列

第三节:ExtJS调用WCF系列-----添加,修改,删除(2) 第三节:ExtJS调用WCF系列-----添加,修改,删除(1) 第二节:ExtJS调用WCF系列-----分页排序列表实现 第一节:ExtJS调用WCF系列-----实现JSON传递

第二节:ExtJS调用WCF系列-----分页排序列表实现

打开第一节中的那个项目,新建一个Paging.aspx的页面来实现分页列表. 这次我们使用一个测试的数据库CompanyInfoDB,里面有两张表,部门和员工,并外键关联,数据库调用采用Linq的Sqlmetal 命令方式,在Visual Studio 2008的命令提示符中输入以下命令:D:\Program Files\Microsoft Visual Studio 9.0\VC>sqlmetal /conn:server=172.16.1.52;database=CompanyInfoDB;