C# 未填充SOAP响应对象参数

C# 未填充SOAP响应对象参数,c#,java,wsdl,jax-ws,C#,Java,Wsdl,Jax Ws,好的,我正在开发客户端和服务应用程序。Web服务是JAX-WS,客户端是C 这是申请信封: <s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Header> <a:Action s:mustUnderstand="1">http://service.client.contro

好的,我正在开发客户端和服务应用程序。Web服务是JAX-WS,客户端是C

这是申请信封:

<s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope">
  <s:Header>
    <a:Action s:mustUnderstand="1">http://service.client.controlbox.pupin.com/ClientService/getProgramRequest</a:Action>
    <a:MessageID>urn:uuid:0611ad42-9d6a-4231-b5dc-b184ff8d767b</a:MessageID>
    <a:ReplyTo>
      <a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
    </a:ReplyTo>
    <VsDebuggerCausalityData xmlns="http://schemas.microsoft.com/vstudio/diagnostics/servicemodelsink">uIDPo/TFchxPpdRKkxTMgu4zqLoAAAAA+TipUcLz4UqIiUeu7LDdk9hWXiZtaslHl/445+teciMACQAA</VsDebuggerCausalityData>
  </s:Header>
  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <getProgram xmlns="http://service.client.controlbox.pupin.com/">
      <macAddress xmlns="">234</macAddress>
    </getProgram>
  </s:Body>
</s:Envelope>
<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope" 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" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <S:Header>
    <Action xmlns="http://www.w3.org/2005/08/addressing" xmlns:S="http://www.w3.org/2003/05/soap-envelope" S:mustUnderstand="true">http://service.client.controlbox.pupin.com/ClientService/getPrograResponse</Action>
    <MessageID xmlns="http://www.w3.org/2005/08/addressing">uuid:c6aa9ecc-24d3-439a-b057-c03aca37eb1f</MessageID>
    <RelatesTo xmlns="http://www.w3.org/2005/08/addressing">urn:uuid:0611ad42-9d6a-4231-b5dc-b184ff8d767b</RelatesTo>
    <To xmlns="http://www.w3.org/2005/08/addressing">http://www.w3.org/2005/08/addressing/anonymous</To>
    <wsse:Security S:mustUnderstand="true">
      <wsu:Timestamp xmlns:ns14="http://docs.oasis-open.org/ws-sx/ws-secureconversation/200512" xmlns:ns13="http://schemas.xmlsoap.org/soap/envelope/" wsu:Id="_1">
        <wsu:Created>2013-05-07T10:25:28Z</wsu:Created>
        <wsu:Expires>2013-05-07T10:30:28Z</wsu:Expires>
      </wsu:Timestamp>
    </wsse:Security>
  </S:Header>
  <S:Body>
    <ns2:getProgramResponse xmlns:ns2="http://service.client.controlbox.pupin.com/">
      <return>
        <name>asd</name>
        <logo>
          <alpha>100</alpha>
          <media>
            <filePath>Tulips_2.jpg</filePath>
          </media>
          <offset>0;0;0;0</offset>
          <position>1</position>
        </logo>
        <programPlaylistList>
          <endTime>
            <nanos>0</nanos>
          </endTime>
          <endTimeCalculated>true</endTimeCalculated>
          <logoShown>false</logoShown>
          <playlist>
            <name>plejlista</name>
            <playlistMediaList>
              <duration>5</duration>
              <media>
                <filePath>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.jpg</filePath>
              </media>
            </playlistMediaList>
            <playlistMediaList>
              <duration>5</duration>
              <media>
                <filePath>Koala.jpg</filePath>
              </media>
            </playlistMediaList>
            <playlistMediaList>
              <duration>15</duration>
              <media>
                <filePath>Hydrangeas.jpg</filePath>
              </media>
            </playlistMediaList>
            <playlistMediaList>
              <duration>10</duration>
              <media>
                <filePath>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.jpg</filePath>
              </media>
            </playlistMediaList>
            <playlistMediaList>
              <duration>5</duration>
              <media>
                <filePath>Lighthouse.jpg</filePath>
              </media>
            </playlistMediaList>
          </playlist>
          <repeatedDaily>false</repeatedDaily>
          <startTime>
            <nanos>0</nanos>
          </startTime>
          <tickerDisabled>false</tickerDisabled>
          <weatherAfter>0</weatherAfter>
        </programPlaylistList>
        <updated>false</updated>
        <weather>
          <name>prognoza</name>
          <background>
            <name>
            </name>
            <filePath>background.png</filePath>
          </background>
          <duration>20</duration>
          <twoSlideWeather>false</twoSlideWeather>
        </weather>
      </return>
    </ns2:getProgramResponse>
  </S:Body>
</S:Envelope>
可以想象,proxy.getProgram234.logo==null为true

我在互联网上看到了类似的问题,每个人都说这是名称空间不匹配的问题,但我找不到我的问题,如果有人能帮我解决这个问题,我将不胜感激

请帮帮我,我真的被困在这里了。 谢谢

编辑

好的,我用java创建了服务客户端,同样的事情也在发生。看来我的Web服务出了问题


有人帮帮我,我很快就需要帮助,甚至没有人试图帮助…:

您可以尝试这样做:好吧,我不想自己解析响应,因为它是一个复杂的结构,我想让它正常工作
HttpsTransportBindingElement transport = new HttpsTransportBindingElement();

TransportSecurityBindingElement b_element = new TransportSecurityBindingElement();
b_element.DefaultAlgorithmSuite = new Basic128SecurityAlgorithmSuite();
b_element.IncludeTimestamp = true;
b_element.KeyEntropyMode = SecurityKeyEntropyMode.CombinedEntropy;
b_element.MessageSecurityVersion = MessageSecurityVersion.WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11;
b_element.SecurityHeaderLayout = SecurityHeaderLayout.Lax;

CustomBinding customBinding = new CustomBinding();
customBinding.Name = "secureBinding";
customBinding.Elements.Add(b_element);
customBinding.Elements.Add(transport);

ServiceRef.ClientServiceClient proxy = new ServiceRef.ClientServiceClient();
proxy.Endpoint.Binding = customBinding;
proxy.Endpoint.EndpointBehaviors.Add(new MessageInspectionBehavior());

Console.WriteLine(proxy.getProgram("234").logo==null);

Console.Read();