wcf soap 1.1 response object not deserializing












0















I've got a .NET 4.5 client calling a soap service method. The method gets called correctly over the wire using fiddler, I can tell the response is coming back and the method call succeeded.



Sample method call response:



<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<executeResponse>
<Number>EEI0002278</Number>
<SysID>a2750b4fdbb9a7c0b6e69b3c8a9619ff</SysID>
<Status>200</Status>
<Message>COI case generated</Message>
</executeResponse>
</SOAP-ENV:Body>




My Client .config file



 <system.serviceModel>
<bindings>
<customBinding>
<binding name="WsHttpSoap11">
<security enableUnsecuredResponse="true" authenticationMode="CertificateOverTransport" />
<textMessageEncoding messageVersion="Soap11" />
<context />
<httpsTransport authenticationScheme="Basic" />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="https://gateway-cs.company.com:8888/COICaseGenerator.do"
binding="customBinding" bindingConfiguration="WsHttpSoap11"
contract="ServiceNowSoap" name="Soap11" />
</client>
</system.serviceModel>


Data Contract:



[DataContract(Namespace = "http://www.company.com/COICaseGenerator")]
public class executeResponse
{

private string numberField;
private string sysIDField;
private string statusField;
private string messageField;

[DataMember(Name="Number", Order = 0)]
public string Number
{
get
{
return this.numberField;
}
set
{
this.numberField = value;
}
}

[DataMember(Name = "SysID", Order = 1)]
public string SysID
{
get
{
return this.sysIDField;
}
set
{
this.sysIDField = value;
}
}

[DataMember(Name = "Status", Order = 2)]
public string Status
{
get
{
return this.statusField;
}
set
{
this.statusField = value;
}
}

[DataMember(Name = "Message", Order = 3)]
public string Message
{
get
{
return this.messageField;
}
set
{
this.messageField = value;
}
}

[OnDeserialized()]
public void OnDeserialized(StreamingContext c)
{
//if (MyCustonObj == null)
//{
// MyCustonObj = new MyCustomClass();
// MyCustonObj.MyStrData = "Overridden in serialization";
//}
}

[OnDeserializing()]
public void OnDeserializing(StreamingContext c)
{
//if (MyCustonObj == null)
//{
// MyCustonObj = new MyCustomClass();
// MyCustonObj.MyStrData = "Overridden in deserializing";
//}
}

[OnSerialized()]
public void OnSerialized(StreamingContext c)
{
// if you wan to do somehing when serialized here or just remove them

}

[OnSerializing()]
public void OnSerializing(StreamingContext c)
{
// if you wan to do somehing during serializing here or just remove them
}
}


Svcutil.exe generated:



[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(Namespace="", ConfigurationName="ServiceNowSoap")]
public interface ServiceNowSoap
{

[System.ServiceModel.OperationContractAttribute()]
executeResponse execute(CoiCase coiCase);

[System.ServiceModel.OperationContractAttribute()]
void executeAsync();
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public interface ServiceNowSoapChannel : ServiceNowSoap, System.ServiceModel.IClientChannel
{
}

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public partial class ServiceNowSoapClient : System.ServiceModel.ClientBase<ServiceNowSoap>, ServiceNowSoap
{

public ServiceNowSoapClient()
{
}

public ServiceNowSoapClient(string endpointConfigurationName) :
base(endpointConfigurationName)
{
}

public ServiceNowSoapClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}

public ServiceNowSoapClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress)
{
}

public void executeAsync()
{
base.Channel.executeAsync();
}

public executeResponse execute(CoiCase coiCase)
{
return base.Channel.execute(coiCase);
}
}


Problem:



Calling service method (executeResponse execute(CoiCase coiCase))
returns null. Even though the response message looks correct in fiddler.



and the following deserialize methods are never called. I set breakpoints but they are never hit.



public void OnDeserialized(StreamingContext c)
public void OnDeserializing(StreamingContext c)
public void OnSerialized(StreamingContext c)
public void OnSerializing(StreamingContext c)









share|improve this question

























  • if the deserialize methods are initiated from your ServiceNowSoapClient class you have to remove the attribute [System.Diagnostics.DebuggerStepThroughAttribute()] in order for the debugger to hit the code

    – Popo
    Nov 21 '18 at 16:44
















0















I've got a .NET 4.5 client calling a soap service method. The method gets called correctly over the wire using fiddler, I can tell the response is coming back and the method call succeeded.



Sample method call response:



<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<executeResponse>
<Number>EEI0002278</Number>
<SysID>a2750b4fdbb9a7c0b6e69b3c8a9619ff</SysID>
<Status>200</Status>
<Message>COI case generated</Message>
</executeResponse>
</SOAP-ENV:Body>




My Client .config file



 <system.serviceModel>
<bindings>
<customBinding>
<binding name="WsHttpSoap11">
<security enableUnsecuredResponse="true" authenticationMode="CertificateOverTransport" />
<textMessageEncoding messageVersion="Soap11" />
<context />
<httpsTransport authenticationScheme="Basic" />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="https://gateway-cs.company.com:8888/COICaseGenerator.do"
binding="customBinding" bindingConfiguration="WsHttpSoap11"
contract="ServiceNowSoap" name="Soap11" />
</client>
</system.serviceModel>


Data Contract:



[DataContract(Namespace = "http://www.company.com/COICaseGenerator")]
public class executeResponse
{

private string numberField;
private string sysIDField;
private string statusField;
private string messageField;

[DataMember(Name="Number", Order = 0)]
public string Number
{
get
{
return this.numberField;
}
set
{
this.numberField = value;
}
}

[DataMember(Name = "SysID", Order = 1)]
public string SysID
{
get
{
return this.sysIDField;
}
set
{
this.sysIDField = value;
}
}

[DataMember(Name = "Status", Order = 2)]
public string Status
{
get
{
return this.statusField;
}
set
{
this.statusField = value;
}
}

[DataMember(Name = "Message", Order = 3)]
public string Message
{
get
{
return this.messageField;
}
set
{
this.messageField = value;
}
}

[OnDeserialized()]
public void OnDeserialized(StreamingContext c)
{
//if (MyCustonObj == null)
//{
// MyCustonObj = new MyCustomClass();
// MyCustonObj.MyStrData = "Overridden in serialization";
//}
}

[OnDeserializing()]
public void OnDeserializing(StreamingContext c)
{
//if (MyCustonObj == null)
//{
// MyCustonObj = new MyCustomClass();
// MyCustonObj.MyStrData = "Overridden in deserializing";
//}
}

[OnSerialized()]
public void OnSerialized(StreamingContext c)
{
// if you wan to do somehing when serialized here or just remove them

}

[OnSerializing()]
public void OnSerializing(StreamingContext c)
{
// if you wan to do somehing during serializing here or just remove them
}
}


Svcutil.exe generated:



[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(Namespace="", ConfigurationName="ServiceNowSoap")]
public interface ServiceNowSoap
{

[System.ServiceModel.OperationContractAttribute()]
executeResponse execute(CoiCase coiCase);

[System.ServiceModel.OperationContractAttribute()]
void executeAsync();
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public interface ServiceNowSoapChannel : ServiceNowSoap, System.ServiceModel.IClientChannel
{
}

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public partial class ServiceNowSoapClient : System.ServiceModel.ClientBase<ServiceNowSoap>, ServiceNowSoap
{

public ServiceNowSoapClient()
{
}

public ServiceNowSoapClient(string endpointConfigurationName) :
base(endpointConfigurationName)
{
}

public ServiceNowSoapClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}

public ServiceNowSoapClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress)
{
}

public void executeAsync()
{
base.Channel.executeAsync();
}

public executeResponse execute(CoiCase coiCase)
{
return base.Channel.execute(coiCase);
}
}


Problem:



Calling service method (executeResponse execute(CoiCase coiCase))
returns null. Even though the response message looks correct in fiddler.



and the following deserialize methods are never called. I set breakpoints but they are never hit.



public void OnDeserialized(StreamingContext c)
public void OnDeserializing(StreamingContext c)
public void OnSerialized(StreamingContext c)
public void OnSerializing(StreamingContext c)









share|improve this question

























  • if the deserialize methods are initiated from your ServiceNowSoapClient class you have to remove the attribute [System.Diagnostics.DebuggerStepThroughAttribute()] in order for the debugger to hit the code

    – Popo
    Nov 21 '18 at 16:44














0












0








0








I've got a .NET 4.5 client calling a soap service method. The method gets called correctly over the wire using fiddler, I can tell the response is coming back and the method call succeeded.



Sample method call response:



<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<executeResponse>
<Number>EEI0002278</Number>
<SysID>a2750b4fdbb9a7c0b6e69b3c8a9619ff</SysID>
<Status>200</Status>
<Message>COI case generated</Message>
</executeResponse>
</SOAP-ENV:Body>




My Client .config file



 <system.serviceModel>
<bindings>
<customBinding>
<binding name="WsHttpSoap11">
<security enableUnsecuredResponse="true" authenticationMode="CertificateOverTransport" />
<textMessageEncoding messageVersion="Soap11" />
<context />
<httpsTransport authenticationScheme="Basic" />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="https://gateway-cs.company.com:8888/COICaseGenerator.do"
binding="customBinding" bindingConfiguration="WsHttpSoap11"
contract="ServiceNowSoap" name="Soap11" />
</client>
</system.serviceModel>


Data Contract:



[DataContract(Namespace = "http://www.company.com/COICaseGenerator")]
public class executeResponse
{

private string numberField;
private string sysIDField;
private string statusField;
private string messageField;

[DataMember(Name="Number", Order = 0)]
public string Number
{
get
{
return this.numberField;
}
set
{
this.numberField = value;
}
}

[DataMember(Name = "SysID", Order = 1)]
public string SysID
{
get
{
return this.sysIDField;
}
set
{
this.sysIDField = value;
}
}

[DataMember(Name = "Status", Order = 2)]
public string Status
{
get
{
return this.statusField;
}
set
{
this.statusField = value;
}
}

[DataMember(Name = "Message", Order = 3)]
public string Message
{
get
{
return this.messageField;
}
set
{
this.messageField = value;
}
}

[OnDeserialized()]
public void OnDeserialized(StreamingContext c)
{
//if (MyCustonObj == null)
//{
// MyCustonObj = new MyCustomClass();
// MyCustonObj.MyStrData = "Overridden in serialization";
//}
}

[OnDeserializing()]
public void OnDeserializing(StreamingContext c)
{
//if (MyCustonObj == null)
//{
// MyCustonObj = new MyCustomClass();
// MyCustonObj.MyStrData = "Overridden in deserializing";
//}
}

[OnSerialized()]
public void OnSerialized(StreamingContext c)
{
// if you wan to do somehing when serialized here or just remove them

}

[OnSerializing()]
public void OnSerializing(StreamingContext c)
{
// if you wan to do somehing during serializing here or just remove them
}
}


Svcutil.exe generated:



[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(Namespace="", ConfigurationName="ServiceNowSoap")]
public interface ServiceNowSoap
{

[System.ServiceModel.OperationContractAttribute()]
executeResponse execute(CoiCase coiCase);

[System.ServiceModel.OperationContractAttribute()]
void executeAsync();
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public interface ServiceNowSoapChannel : ServiceNowSoap, System.ServiceModel.IClientChannel
{
}

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public partial class ServiceNowSoapClient : System.ServiceModel.ClientBase<ServiceNowSoap>, ServiceNowSoap
{

public ServiceNowSoapClient()
{
}

public ServiceNowSoapClient(string endpointConfigurationName) :
base(endpointConfigurationName)
{
}

public ServiceNowSoapClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}

public ServiceNowSoapClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress)
{
}

public void executeAsync()
{
base.Channel.executeAsync();
}

public executeResponse execute(CoiCase coiCase)
{
return base.Channel.execute(coiCase);
}
}


Problem:



Calling service method (executeResponse execute(CoiCase coiCase))
returns null. Even though the response message looks correct in fiddler.



and the following deserialize methods are never called. I set breakpoints but they are never hit.



public void OnDeserialized(StreamingContext c)
public void OnDeserializing(StreamingContext c)
public void OnSerialized(StreamingContext c)
public void OnSerializing(StreamingContext c)









share|improve this question
















I've got a .NET 4.5 client calling a soap service method. The method gets called correctly over the wire using fiddler, I can tell the response is coming back and the method call succeeded.



Sample method call response:



<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<executeResponse>
<Number>EEI0002278</Number>
<SysID>a2750b4fdbb9a7c0b6e69b3c8a9619ff</SysID>
<Status>200</Status>
<Message>COI case generated</Message>
</executeResponse>
</SOAP-ENV:Body>




My Client .config file



 <system.serviceModel>
<bindings>
<customBinding>
<binding name="WsHttpSoap11">
<security enableUnsecuredResponse="true" authenticationMode="CertificateOverTransport" />
<textMessageEncoding messageVersion="Soap11" />
<context />
<httpsTransport authenticationScheme="Basic" />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="https://gateway-cs.company.com:8888/COICaseGenerator.do"
binding="customBinding" bindingConfiguration="WsHttpSoap11"
contract="ServiceNowSoap" name="Soap11" />
</client>
</system.serviceModel>


Data Contract:



[DataContract(Namespace = "http://www.company.com/COICaseGenerator")]
public class executeResponse
{

private string numberField;
private string sysIDField;
private string statusField;
private string messageField;

[DataMember(Name="Number", Order = 0)]
public string Number
{
get
{
return this.numberField;
}
set
{
this.numberField = value;
}
}

[DataMember(Name = "SysID", Order = 1)]
public string SysID
{
get
{
return this.sysIDField;
}
set
{
this.sysIDField = value;
}
}

[DataMember(Name = "Status", Order = 2)]
public string Status
{
get
{
return this.statusField;
}
set
{
this.statusField = value;
}
}

[DataMember(Name = "Message", Order = 3)]
public string Message
{
get
{
return this.messageField;
}
set
{
this.messageField = value;
}
}

[OnDeserialized()]
public void OnDeserialized(StreamingContext c)
{
//if (MyCustonObj == null)
//{
// MyCustonObj = new MyCustomClass();
// MyCustonObj.MyStrData = "Overridden in serialization";
//}
}

[OnDeserializing()]
public void OnDeserializing(StreamingContext c)
{
//if (MyCustonObj == null)
//{
// MyCustonObj = new MyCustomClass();
// MyCustonObj.MyStrData = "Overridden in deserializing";
//}
}

[OnSerialized()]
public void OnSerialized(StreamingContext c)
{
// if you wan to do somehing when serialized here or just remove them

}

[OnSerializing()]
public void OnSerializing(StreamingContext c)
{
// if you wan to do somehing during serializing here or just remove them
}
}


Svcutil.exe generated:



[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(Namespace="", ConfigurationName="ServiceNowSoap")]
public interface ServiceNowSoap
{

[System.ServiceModel.OperationContractAttribute()]
executeResponse execute(CoiCase coiCase);

[System.ServiceModel.OperationContractAttribute()]
void executeAsync();
}

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public interface ServiceNowSoapChannel : ServiceNowSoap, System.ServiceModel.IClientChannel
{
}

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public partial class ServiceNowSoapClient : System.ServiceModel.ClientBase<ServiceNowSoap>, ServiceNowSoap
{

public ServiceNowSoapClient()
{
}

public ServiceNowSoapClient(string endpointConfigurationName) :
base(endpointConfigurationName)
{
}

public ServiceNowSoapClient(string endpointConfigurationName, string remoteAddress) :
base(endpointConfigurationName, remoteAddress)
{
}

public ServiceNowSoapClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress)
{
}

public void executeAsync()
{
base.Channel.executeAsync();
}

public executeResponse execute(CoiCase coiCase)
{
return base.Channel.execute(coiCase);
}
}


Problem:



Calling service method (executeResponse execute(CoiCase coiCase))
returns null. Even though the response message looks correct in fiddler.



and the following deserialize methods are never called. I set breakpoints but they are never hit.



public void OnDeserialized(StreamingContext c)
public void OnDeserializing(StreamingContext c)
public void OnSerialized(StreamingContext c)
public void OnSerializing(StreamingContext c)






.net wcf soap .net-4.5






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 21 '18 at 14:46









Aria

2,6431832




2,6431832










asked Nov 21 '18 at 5:41









pcazarpcazar

376




376













  • if the deserialize methods are initiated from your ServiceNowSoapClient class you have to remove the attribute [System.Diagnostics.DebuggerStepThroughAttribute()] in order for the debugger to hit the code

    – Popo
    Nov 21 '18 at 16:44



















  • if the deserialize methods are initiated from your ServiceNowSoapClient class you have to remove the attribute [System.Diagnostics.DebuggerStepThroughAttribute()] in order for the debugger to hit the code

    – Popo
    Nov 21 '18 at 16:44

















if the deserialize methods are initiated from your ServiceNowSoapClient class you have to remove the attribute [System.Diagnostics.DebuggerStepThroughAttribute()] in order for the debugger to hit the code

– Popo
Nov 21 '18 at 16:44





if the deserialize methods are initiated from your ServiceNowSoapClient class you have to remove the attribute [System.Diagnostics.DebuggerStepThroughAttribute()] in order for the debugger to hit the code

– Popo
Nov 21 '18 at 16:44












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53405864%2fwcf-soap-1-1-response-object-not-deserializing%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53405864%2fwcf-soap-1-1-response-object-not-deserializing%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

Does disintegrating a polymorphed enemy still kill it after the 2018 errata?

A Topological Invariant for $pi_3(U(n))$