请求未创建

时间:2014-02-21 10:41:18

标签: c# wcf soap

我创建了一个wcf客户端,它发出获取数据的请求。 当我打电话给服务时,请求本身没有创建。 我将所有标头信息发送到服务,它不发送请求。 该请求使用SOAP,

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"         xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" 
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">
<soap:Header>
    <VisSvcHeaders xmlns="http://dai.es.VisSvc/2010/svc">
        <packNGo>false</packNGo>
    </VisSvcHeaders>
    <wsa:Action>http://vissvc.esi.daimler.com/2010/svc/getData</wsa:Action>
    <wsa:From>
        <wsa:Address>Vis</wsa:Address>
    </wsa:From>
    <wsa:MessageID>urn:uuid:795b9745-4867-4f05-af5a-  87704920a6dd</wsa:MessageID>
    <wsa:ReplyTo>
         <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
    </wsa:ReplyTo>
    <wsa:To>https://vissvc.e.corpintra.net/VisSvcNative/DAIESIVisService</wsa:To>
    <wsse:Security>
        <wsu:Timestamp wsu:Id="Timestamp-6bf652ad-6f2e-4312-ae4f-5807c5f21e38">
            <wsu:Created>2014-02-19T08:41:48Z</wsu:Created>
            <wsu:Expires>2014-02-19T08:46:48Z</wsu:Expires>
        </wsu:Timestamp>
    </wsse:Security>
</soap:Header>
<soap:Body>
    <getData xmlns="http://dai.esi.VisSvc/2010/svc">
        <part xmlns="">
            <number xmlns="http://dai.es.VisSvc/2010/bo">43</number>
            <referenceConfiguration xmlns="http://dai.esi.VisSvc/2010/bo">
                <lifecycle xmlns="">Rel</lifecycle>
            </referenceConfiguration>
            <mode xmlns="http://dai.es.VisSvc/2010/bo">open</mode>
        </part>
    </getData>
</soap:Body>

如何以此发送请求,我正在使用的代码是

       ServiceReference2.ServicePortTypeClient svc = new     ServiceReference2.ServicePortTypeClient();
       WebRequest request = WebRequest.Create("http://vissvc- test.e.intra.net/SvcNative/VisService");
       ServiceReference2.PartType part = new ServiceReference2.PartType();
       part.number = "43";        
       ServiceReference2.ResponseType res = svc.getData(part);
       Console.WriteLine(res);

此getData()请求未发送或创建此类请求。

我正在使用.net c#4.0。

0 个答案:

没有答案