c#WSDL没有Header但是请求了

时间:2015-03-08 09:44:01

标签: c# soap header wsdl

即使应用程序与最近制作的应用程序类似,也可以用正确的术语改写,也许我可以更好地理解我的问题,因为我到目前为止尝试了一个解决方案失败,而我发现的解决方案不适用于我的情况< / p>

摘要:我第一次处理网络服务,肥皂,附属物,所以原谅我无知的绝对。 (也是为了糟糕的英语)

我在用java编写的web服务器机构上有一个wsdl,它不包含客户端,并且各种调用没有标题,但它总是需要,每次调用。

问题:我用端点安静地创建客户端,我连接到Web服务器响应我,我读取了服务器的所有参数(我不需要任何东西)。 (所以我创建了隧道)

只是尝试使用任何wsdl进行调用,输入wsdl.result res = wsdl.getvalore(parameters),由于消息中缺少标题,我总是会收到错误,例如:私钥不是在X.509证书中。 (但不需要私钥来感受Web服务的支持)或No Security Header。

以XML格式的soap消息为例。对于BODY部分没问题,但如何添加标题? 感谢所有能帮助我的人。 问候。

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
	<soapenv: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" soapenv:mustUnderstand="1">
			<wsu:Timestamp wsu:Id="TS-3">
				<wsu:Created>2014-09-09T08:23:50.725Z</wsu:Created>
				<wsu:Expires>2014-09-09T08:28:50.725Z</wsu:Expires>
			</wsu:Timestamp>
			<wsse:BinarySecurityToken EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="X509-00000000000000000000000000000000">qtgOKG92iPHI/XLXGxFmg6Vnqmdg=</wsse:BinarySecurityToken>
			<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="SIG-4">
				<ds:SignedInfo>
					<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
						<ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="soapenv"/>
					</ds:CanonicalizationMethod>
					<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
					<ds:Reference URI="#TS-3">
						<ds:Transforms>
							<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
								<ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="wsse soapenv"/>
							</ds:Transform>
						</ds:Transforms>
						<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
						<ds:DigestValue>hK3A/dZmQfIGDx9p7/8zV31iWDQ=</ds:DigestValue>
					</ds:Reference>
				</ds:SignedInfo>
				<ds:SignatureValue>JlWXCRS6NEz9pl5gD9PBedQj6OMxBDXkLhIwGjncl4IsC1DzPoIVEJmIp/D679ba+pi692gvGpLn</ds:SignatureValue>
				<ds:KeyInfo Id="KI-00000000000000000000000000000000">
					<wsse:SecurityTokenReference wsu:Id="STR-00000000000000000000000000000000">
						<wsse:Reference URI="#X509-00000000000000000000000000000000" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/>
					</wsse:SecurityTokenReference>
				</ds:KeyInfo>
			</ds:Signature>
		</wsse:Security>
	</soapenv:Header>
	<soapenv:Body>
		<scat:getPrescrizioneFirmata xmlns:scat="www.aaa.regione.it/Schemas/AAA_WEB/SERVICE/">
			<scat:datiOperatore>
				<scat:codStruttura>001001</scat:codStruttura>
				<scat:codiceFiscale>PPPTTT00P01R000T</scat:codiceFiscale>
				<scat:ruoloIstituzionale>Rrr000000</scat:ruoloIstituzionale>
			</scat:datiOperatore>
			<scat:datiApplicativo>
				<scat:applDigest>gredfgggjnbhtdybvvhghggvvbvb=</scat:applDigest>
				<scat:created>2014-09-09T10:23:522+0200</scat:created>
				<scat:nome>ABC</scat:nome>
				<scat:nonce>ZQJzbirixuhvfa8NtoQa</scat:nonce>
				<scat:produttore>PIPPO</scat:produttore>
				<scat:versione>20.03</scat:versione>
			</scat:datiApplicativo>
			<scat:identificativoRicetta>001001001001001</scat:identificativoRicetta>
		</scat:getPrescrizioneFirmata>
	</soapenv:Body>
</soapenv:Envelope>​

0 个答案:

没有答案