我是使用C#代码的.Net开发人员。我的任务是调用我的同事用Java编写的Web服务。
他们提供了一些网址(www.example.com/service?wsdl)。我在.net项目解决方案中添加了这个,并创建了一个服务对象
javaendclient proxy=new javaendclient();
proxy.Getdata();
当我调用getdata()
方法时,我收到错误:
“处理标题时发现错误”
检查了java soap标题后。如下所示:
<soap:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" oap:mustUnderstand="1">
<xenc:EncryptedKey xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" Id="EK-7D1EE1EB6DD2FD216F145032375083860">
<xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<wsse:SecurityTokenReference>
<ds:X509Data>
<ds:X509IssuerSerial>
<ds:X509IssuerName>CN=myeg-ws,C=MY</ds:X509IssuerName>
<ds:X509SerialNumber>1424752876</ds:X509SerialNumber>
</ds:X509IssuerSerial>
</ds:X509Data>
</wsse:SecurityTokenReference>
</ds:KeyInfo>
<xenc:CipherData>
<xenc:CipherValue>
jL+B6Zx2Gww3s6EuqN7Vgr2lddCe99HSGoxwy1kUQJvzTlSeAEj6/C4Pf97XX38NG4jOiFXUdv26pBdiIKuhx6K6CEDGIf4bvMk3eWQ85VcerMcDo
</xenc:CipherValue>
</xenc:CipherData>
<xenc:ReferenceList>
<xenc:DataReference URI="#ED-74"/>
<xenc:DataReference URI="#ED-75"/>
</xenc:ReferenceList>
</xenc:EncryptedKey>
<xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" Id="ED-74"
Type="http://www.w3.org/2001/04/xmlenc#Element">
<xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<wsse:SecurityTokenReference xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-
secext-1.0.xsd" xmlns:wsse11="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd"
wsse11:TokenType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#EncryptedKey">
<wsse:Reference URI="#EK-7D1EE1EB6DD2FD216F145032375083860"/>
</wsse:SecurityTokenReference>
</ds:KeyInfo>
<xenc:CipherData>
<xenc:CipherValue>/iWlPbyLxf9y59jRawZe4YyF3rMUPhW72bBjSHh32LlphYgCfY1Xp2YV9S4SypcLe9TkCP3KPzvoOnmTSkWUw3yCVopWx
</xenc:CipherValue>
</xenc:CipherData>
</xenc:EncryptedData>
<wsu:Timestamp wsu:Id="TS-71">
<wsu:Created>2015-12-17T03:42:30.807Z</wsu:Created>
<wsu:Expires>2015-12-17T03:47:30.807Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</soap:Header>
请帮助我如何使用wcf或webservices从.net客户端发送上述java webservice的请求...