当前位置: 代码迷 >> Web Service >> C#怎么调用axis2(使用了rampart,ws-policy)的java做的webservice
  详细解决方案

C#怎么调用axis2(使用了rampart,ws-policy)的java做的webservice

热度:541   发布时间:2016-05-02 02:47:11.0
C#如何调用axis2(使用了rampart,ws-policy)的java做的webservice
我用Java做的webservice,【tomcat+axis2+rampart模块+ws-policy】,
服务端是根据
Web Services Security with Apache Rampart – Part 1 ( Transport Level Security )

做出来的
客户端用java可以调试通过
但是在.net中如何调用呢,应该如何做

------最佳解决方案--------------------
webservice 应该是和平台无关的。 用何种语言写又有什么关系。。。
------其他解决方案--------------------
wsdl文件如下
<?xml version="1.0" encoding="UTF-8"?><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://service.rampart.tutorial" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://service.rampart.tutorial">
    <wsp:Policy xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="UTOverTransport">
        <wsp:ExactlyOne><wsp:All>
                <sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"><wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
<sp:TransportToken><wsp:Policy>
<sp:HttpsToken RequireClientCertificate="false"/>
</wsp:Policy>
</sp:TransportToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic256/>
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Lax/>
</wsp:Policy>
</sp:Layout>
</wsp:Policy>
</sp:TransportBinding>
<sp:SignedSupportingTokens xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"><wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
<sp:UsernameToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient"/>
</wsp:Policy>
</sp:SignedSupportingTokens>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
    <wsdl:types>
        <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://service.rampart.tutorial">
            <xs:element name="add">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element minOccurs="0" name="a" type="xs:int"/>
                        <xs:element minOccurs="0" name="b" type="xs:int"/>
                    </xs:sequence>
                </xs:complexType>
  相关解决方案