-1

I currently program a WCF client that interacts with a SOAP Web service. My problem is that my response objects always zero remain, even the simple types. There is no exception occur.

WSDL Location: https://sandbox-soap.billsafe.de/wsdl/V209

THX 4 Help!

App.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.diagnostics>
        <sources>
            <source name="System.ServiceModel.MessageLogging" switchValue="Verbose,ActivityTracing">
                <listeners>
                    <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                        <filter type="" />
                    </add>
                    <add name="BillSAFESServiceMessageLoggingListener">
                        <filter type="" />
                    </add>
                </listeners>
            </source>
        </sources>
        <sharedListeners>
            <add initializeData="BillSAFE.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
                name="BillSAFESServiceMessageLoggingListener" traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack">
                <filter type="" />
            </add>
        </sharedListeners>
    </system.diagnostics>
    <system.serviceModel>
        <behaviors>
            <endpointBehaviors>
                <behavior name="BillSAFEServiceBehavior">
                    <callbackDebug includeExceptionDetailInFaults="true" />
                </behavior>
            </endpointBehaviors>
        </behaviors>
        <bindings>
            <customBinding>
                <binding name="BillSAFEServiceBinding" receiveTimeout="00:01:00">
                    <textMessageEncoding messageVersion="Soap11" />
                    <httpsTransport />
                </binding>
            </customBinding>
        </bindings>
        <client>
            <endpoint address="https://sandbox-soap.billsafe.de/V209" behaviorConfiguration="BillSAFEServiceBehavior"
                binding="customBinding" bindingConfiguration="BillSAFEServiceBinding"
                contract="BillSAFE.V209.IBillSAFEService" name="BillSAFEServiceSandbox"
                kind="" endpointConfiguration="" />
        </client>
        <diagnostics performanceCounters="Default">
            <messageLogging logEntireMessage="true" logKnownPii="true" logMalformedMessages="true"
                logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />
        </diagnostics>
    </system.serviceModel>
</configuration>

IBillSAFEService.cs

[ServiceContract(Namespace = "urn:BillSAFE")]
public interface IBillSAFEService
{
    [OperationContract(Name = "getAgreedHandlingCharges"/*, Action = "urn:BillSAFEAction", ReplyAction = "*"*/)]
    GetAgreedHandlingChargesResponse GetAgreedHandlingCharges(GetAgreedHandlingChargesRequest request);

    [OperationContract(Name = "getAgreedHandlingCharges"/*, Action = "urn:BillSAFEAction", ReplyAction = "*"*/)]
    Task<GetAgreedHandlingChargesResponse> GetAgreedHandlingChargesAsync(GetAgreedHandlingChargesRequest request);
}

BillSAFEServiceClient.cs

public class BillSAFEServiceClient : ClientBase<IBillSAFEService>, IBillSAFEService, IDisposable
{
    public BillSAFEServiceClient(string endpointConfigurationName)
        : base(endpointConfigurationName)
    {

    }

    public GetAgreedHandlingChargesResponse GetAgreedHandlingCharges(GetAgreedHandlingChargesRequest request)
    {
        try
        {
            return this.Channel.GetAgreedHandlingCharges(request);
        }
        catch (Exception)
        {
            throw;
        }
    }

    public Task<GetAgreedHandlingChargesResponse> GetAgreedHandlingChargesAsync(GetAgreedHandlingChargesRequest request)
    {
        try
        {
            return this.Channel.GetAgreedHandlingChargesAsync(request);
        }
        catch (Exception)
        {
            throw;
        }
    }
}

GetAgreedHandlingChargesRequest.cs

[MessageContract(WrapperName = "getAgreedHandlingChargesRequest", WrapperNamespace = "urn:BillSAFE", IsWrapped = true)]
public class GetAgreedHandlingChargesRequest : Request
{

}

GetAgreedHandlingChargesResponse.cs

[MessageContract(WrapperName = "getAgreedHandlingChargesResponse", WrapperNamespace = "urn:BillSAFE", IsWrapped = true)]
public class GetAgreedHandlingChargesResponse : Response
{
    [MessageBodyMember(Name = "agreedCharge", Namespace = "urn:BillSAFE")]
    public ICollection<AgreedHandlingCharge> AgreedCharge { get; set; }

    public GetAgreedHandlingChargesResponse()
    {
        this.AgreedCharge = new List<AgreedHandlingCharge>();
    }
}

Response.cs

[MessageContract(WrapperNamespace = "urn:BillSAFE", IsWrapped = true)]
public abstract class Response
{
    [MessageBodyMember(Name = "ack")]
    public string Ack { get; set; }

    [MessageBodyMember(Name = "errorList")]
    public ICollection<Error> ErrorList { get; set; }

    protected Response()
    {
        //this.Ack = V209.Ack.Error;
        this.ErrorList = new List<Error>();
    }
}

Request.cs

[MessageContract(WrapperNamespace = "urn:BillSAFE", IsWrapped=true)]
public abstract class Request
{
    [MessageBodyMember(Name = "merchant", Namespace = "urn:BillSAFE")]
    public Merchant Merchant { get; set; }

    [MessageBodyMember(Name = "application", Namespace = "urn:BillSAFE")]
    public Application Application { get; set; }
}

E2ETraceEvent (Request)

<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
<EventID>0</EventID>
<Type>3</Type>
<SubType Name="Information">0</SubType>
<Level>8</Level>
<TimeCreated SystemTime="2013-01-17T20:54:31.1064522Z" />
<Source Name="System.ServiceModel.MessageLogging" />
<Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />
<Execution ProcessName="vstest.executionengine.x86" ProcessID="8812" ThreadID="8" />
<Channel />
<Computer>SEBASTIAN-PC</Computer>
</System>
<ApplicationData>
<TraceData>
<DataItem>
<MessageLogTraceRecord Time="2013-01-17T21:54:31.1064522+01:00" Source="TransportSend" Type="System.ServiceModel.Dispatcher.OperationFormatter+OperationFormatterMessage" xmlns="http://schemas.microsoft.com/2004/06/ServiceModel/Management/MessageTrace">
<Addressing>
<Action>urn:BillSAFE/IBillSAFEService/getAgreedHandlingCharges</Action>
<To>https://sandbox-soap.billsafe.de/V209</To>
</Addressing>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<VsDebuggerCausalityData xmlns="http://schemas.microsoft.com/vstudio/diagnostics/servicemodelsink">uIDPo4Y6WSDqKJ5EkZhFjJEu4DAAAAAAs2bp4OEOTEWhpHQOICljk07jg5xHVctBqgCzT6DCuOAACQAA</VsDebuggerCausalityData>
</s:Header>
<s:Body>
<getAgreedHandlingChargesRequest xmlns="urn:BillSAFE">
<application xmlns:a="http://schemas.datacontract.org/2004/07/BillSAFE.V209" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:signature>###########</a:signature>
<a:version>>###########</a:version>
</application>
<merchant xmlns:a="http://schemas.datacontract.org/2004/07/BillSAFE.V209" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:id>>###########</a:id>
<a:license>>###########</a:license>
</merchant>
</getAgreedHandlingChargesRequest>
</s:Body>
</s:Envelope>
</MessageLogTraceRecord>
</DataItem>
</TraceData>
<System.Diagnostics xmlns="http://schemas.microsoft.com/2004/08/System.Diagnostics">
<LogicalOperationStack></LogicalOperationStack>
<Timestamp>752163894457</Timestamp>
<Callstack>
bei System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
bei System.Environment.get_StackTrace()
bei System.Diagnostics.TraceEventCache.get_Callstack()
bei System.Diagnostics.XmlWriterTraceListener.WriteFooter(TraceEventCache eventCache)
bei System.Diagnostics.XmlWriterTraceListener.TraceData(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, Object data)
bei System.Diagnostics.TraceSource.TraceData(TraceEventType eventType, Int32 id, Object data)
bei System.ServiceModel.Diagnostics.MessageLogger.LogInternal(MessageLoggingSource source, Object data)
bei System.ServiceModel.Diagnostics.MessageLogger.LogInternal(MessageLogTraceRecord record)
bei System.ServiceModel.Diagnostics.MessageLogger.LogMessageImpl(Message& message, XmlReader reader, MessageLoggingSource source)
bei System.ServiceModel.Diagnostics.MessageLogger.LogMessage(Message& message, XmlReader reader, MessageLoggingSource source)
bei System.ServiceModel.Channels.TextMessageEncoderFactory.TextMessageEncoder.WriteMessage(Message message, Int32 maxMessageSize, BufferManager bufferManager, Int32 messageOffset)
bei System.ServiceModel.Channels.HttpOutput.SerializeBufferedMessage(Message message)
bei System.ServiceModel.Channels.HttpOutput.SendAsyncResult.SendWithoutChannelBindingToken()
bei System.ServiceModel.Channels.HttpOutput.SendAsyncResult.Send()
bei System.ServiceModel.Channels.HttpOutput.SendAsyncResult..ctor(HttpOutput httpOutput, HttpResponseMessage httpResponseMessage, Boolean suppressEntityBody, TimeSpan timeout, AsyncCallback callback, Object state)
bei System.ServiceModel.Channels.HttpOutput.BeginSendCore(HttpResponseMessage httpResponseMessage, TimeSpan timeout, AsyncCallback callback, Object state)
bei System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelAsyncRequest.SendWebRequest()
bei System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelAsyncRequest.BeginSendRequest(Message message, TimeSpan timeout)
bei System.ServiceModel.Channels.RequestChannel.BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, Object state)
bei System.ServiceModel.Dispatcher.RequestChannelBinder.BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, Object state)
bei System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.StartSend(Boolean completedSynchronously)
bei System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.FinishEnsureOpen(IAsyncResult result, Boolean completedSynchronously)
bei System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.StartEnsureOpen(Boolean completedSynchronously)
bei System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.FinishEnsureInteractiveInit(IAsyncResult result, Boolean completedSynchronously)
bei System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.StartEnsureInteractiveInit()
bei System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.Begin()
bei System.ServiceModel.Channels.ServiceChannel.BeginCall(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, TimeSpan timeout, AsyncCallback callback, Object asyncState)
bei System.ServiceModel.Channels.ServiceChannel.BeginCall(ServiceChannel channel, ProxyOperationRuntime operation, Object[] ins, AsyncCallback callback, Object asyncState)
bei System.Threading.Tasks.TaskFactory`1.FromAsyncImpl[TArg1,TArg2,TArg3](Func`6 beginMethod, Func`2 endFunction, Action`1 endAction, TArg1 arg1, TArg2 arg2, TArg3 arg3, Object state, TaskCreationOptions creationOptions)
bei System.Threading.Tasks.TaskFactory`1.FromAsync[TArg1,TArg2,TArg3](Func`6 beginMethod, Func`2 endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, Object state)
bei System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.CreateGenericTask[T](ServiceChannel channel, ProxyOperationRuntime operation, Object[] inputParameters)
bei System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.CreateGenericTask(ServiceChannel channel, ProxyOperationRuntime operation, Object[] inputParameters)
bei System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.CreateTask(ServiceChannel channel, IMethodCallMessage methodCall, ProxyOperationRuntime operation)
bei System.ServiceModel.Channels.ServiceChannelProxy.InvokeTaskService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
bei System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
bei System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
bei BillSAFE.V209.IBillSAFEService.GetAgreedHandlingChargesAsync(GetAgreedHandlingChargesRequest request)
bei BillSAFE.V209.BillSAFEServiceClient.GetAgreedHandlingChargesAsync(GetAgreedHandlingChargesRequest request) in d:\Eigene Dokumente\Visual Studio 2012\Projects\BillSAFEManager\BillSAFE\V209\BillSAFEServiceClient.cs:Zeile 149.
bei BillSAFE.UnitTest.BillSAFEServiceClientUnitTest.<GetAgreedHandlingChargesAsyncTestMethod>d__2.MoveNext() in d:\Eigene Dokumente\Visual Studio 2012\Projects\BillSAFEManager\BillSAFE.UnitTest\BillSAFEServiceClientUnitTest.cs:Zeile 67.
bei System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
bei System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
bei BillSAFE.UnitTest.BillSAFEServiceClientUnitTest.GetAgreedHandlingChargesAsyncTestMethod()
bei System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
bei System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
bei System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
bei Microsoft.VisualStudio.TestPlatform.MSTestFramework.TestMethodRunner.DefaultTestMethodInvoke(Object[] args)
bei Microsoft.VisualStudio.TestPlatform.MSTestFramework.TestMethodRunner.RunTestMethod()
bei Microsoft.VisualStudio.TestPlatform.MSTestFramework.TestMethodRunner.ExecuteTest(TestExecutionOutputs testExecutionOutputs)
bei Microsoft.VisualStudio.TestPlatform.MSTestFramework.TestMethodRunner.ExecuteInternal(TestExecutionOutputs testExecutionOutputs)
bei Microsoft.VisualStudio.TestPlatform.MSTestFramework.TestMethodRunner.Execute()
bei Microsoft.VisualStudio.TestPlatform.MSTestFramework.UnitTestRunner.RunInternal(TestMethod testMethod, Boolean isDataDriven)
bei Microsoft.VisualStudio.TestPlatform.MSTestFramework.UnitTestRunner.RunSingleTest(String name, String fullClassName, Boolean isAsync)
</Callstack>
</System.Diagnostics>
</ApplicationData>
</E2ETraceEvent>

E2ETraceEvent (Response)

<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
<EventID>0</EventID>
<Type>3</Type>
<SubType Name="Information">0</SubType>
<Level>8</Level>
<TimeCreated SystemTime="2013-01-17T20:54:31.5263682Z" />
<Source Name="System.ServiceModel.MessageLogging" />
<Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" />
<Execution ProcessName="vstest.executionengine.x86" ProcessID="8812" ThreadID="12" />
<Channel />
<Computer>SEBASTIAN-PC</Computer>
</System>
<ApplicationData>
<TraceData>
<DataItem>
<MessageLogTraceRecord Time="2013-01-17T21:54:31.5253905+01:00" Source="TransportReceive" Type="System.ServiceModel.Channels.BufferedMessage" xmlns="http://schemas.microsoft.com/2004/06/ServiceModel/Management/MessageTrace">
<HttpResponse>
<StatusCode>OK</StatusCode>
<StatusDescription>OK</StatusDescription>
<WebHeaders>
<Connection>close</Connection>
<Vary>Accept-Encoding</Vary>
<Content-Encoding></Content-Encoding>
<Content-Length>241</Content-Length>
<Content-Type>text/xml; charset=utf-8</Content-Type>
<Date>Thu, 17 Jan 2013 20:54:31 GMT</Date>
<Server>Apache</Server>
</WebHeaders>
</HttpResponse>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:BillSAFE">
<s:Header xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"></s:Header>
<SOAP-ENV:Body>
<ns1:getAgreedHandlingChargesResponse>
<ack xmlns="">ERROR</ack>
<errorList xmlns="">
<code>305</code>
<message>No data to return</message>
</errorList>
</ns1:getAgreedHandlingChargesResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
</MessageLogTraceRecord>
</DataItem>
</TraceData>
<System.Diagnostics xmlns="http://schemas.microsoft.com/2004/08/System.Diagnostics">
<LogicalOperationStack></LogicalOperationStack>
<Timestamp>752164731996</Timestamp>
<Callstack>
bei System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
bei System.Environment.get_StackTrace()
bei System.Diagnostics.TraceEventCache.get_Callstack()
bei System.Diagnostics.XmlWriterTraceListener.WriteFooter(TraceEventCache eventCache)
bei System.Diagnostics.XmlWriterTraceListener.TraceData(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, Object data)
bei System.Diagnostics.TraceSource.TraceData(TraceEventType eventType, Int32 id, Object data)
bei System.ServiceModel.Diagnostics.MessageLogger.LogInternal(MessageLoggingSource source, Object data)
bei System.ServiceModel.Diagnostics.MessageLogger.LogInternal(MessageLogTraceRecord record)
bei System.ServiceModel.Diagnostics.MessageLogger.LogMessageImpl(Message& message, XmlReader reader, MessageLoggingSource source)
bei System.ServiceModel.Diagnostics.MessageLogger.LogMessage(Message& message, XmlReader reader, MessageLoggingSource source)
bei System.ServiceModel.Channels.HttpInput.ProcessHttpAddressing(Message message)
bei System.ServiceModel.Channels.HttpInput.ParseMessageAsyncResult.BeginParse()
bei System.ServiceModel.Channels.HttpInput.BeginParseIncomingMessage(HttpRequestMessage httpRequestMessage, AsyncCallback callback, Object state)
bei System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelAsyncRequest.ProcessResponse(HttpWebResponse response, WebException responseException)
bei System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
bei System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelAsyncRequest.OnGetResponse(IAsyncResult result)
bei System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
bei System.Net.LazyAsyncResult.Complete(IntPtr userToken)
bei System.Net.ContextAwareResult.CompleteCallback(Object state)
bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Net.ContextAwareResult.Complete(IntPtr userToken)
bei System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
bei System.Net.HttpWebRequest.ProcessResponse()
bei System.Net.HttpWebRequest.SetResponse(CoreResponseData coreResponseData)
bei System.Net.HttpWebRequest.SetAndOrProcessResponse(Object responseOrException)
bei System.Net.ConnectionReturnResult.SetResponses(ConnectionReturnResult returnResult)
bei System.Net.Connection.ReadComplete(Int32 bytesRead, WebExceptionStatus errorStatus)
bei System.Net.Connection.ReadCallback(IAsyncResult asyncResult)
bei System.Net.Connection.ReadCallbackWrapper(IAsyncResult asyncResult)
bei System.Net.LazyAsyncResult.Complete(IntPtr userToken)
bei System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
bei System.Net.Security._SslStream.ProcessFrameBody(Int32 readBytes, Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
bei System.Net.Security._SslStream.ReadFrameCallback(AsyncProtocolRequest asyncRequest)
bei System.Net.AsyncProtocolRequest.CompleteRequest(Int32 result)
bei System.Net.FixedSizeReader.CheckCompletionBeforeNextRead(Int32 bytes)
bei System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)
bei System.Net.LazyAsyncResult.Complete(IntPtr userToken)
bei System.Net.ContextAwareResult.CompleteCallback(Object state)
bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Net.ContextAwareResult.Complete(IntPtr userToken)
bei System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
bei System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
bei System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
</Callstack>
</System.Diagnostics>
</ApplicationData>
</E2ETraceEvent>

Test Method

    [TestMethod]
    public async Task GetAgreedHandlingChargesAsyncTestMethod()
    {
        using (BillSAFEServiceClient serviceClient = new BillSAFEServiceClient("BillSAFEServiceSandbox"))
        {
            try
            {
                GetAgreedHandlingChargesResponse response = await serviceClient.GetAgreedHandlingChargesAsync(new GetAgreedHandlingChargesRequest()
                {
                    Merchant = this.GetMerchant(),
                    Application = this.GetApplication()
                });

                if (response.Ack == "")
                {

                }
            }
            catch (Exception)
            {
                throw;
            }
        }
    }

@Alan

[DataContract(Name = "getAgreedHandlingChargesRequest")]
[MessageContract(WrapperName = "getAgreedHandlingChargesRequest", WrapperNamespace = "urn:BillSAFE", IsWrapped = true)]
public class GetAgreedHandlingChargesRequest : Request
{

}

[DataContract(Name = "getAgreedHandlingChargesResponse")]
[MessageContract(WrapperName = "getAgreedHandlingChargesResponse", WrapperNamespace = "urn:BillSAFE", IsWrapped = true)]
public class GetAgreedHandlingChargesResponse : Response
{
    #region Properties

    /// <summary>
    /// 
    /// </summary>
    [DataMember(Name = "agreedCharge")]
    [MessageBodyMember(Name = "agreedCharge", Namespace = "urn:BillSAFE")]
    public ICollection<AgreedHandlingCharge> AgreedCharge { get; set; }

    #endregion

    #region Constructor

    /// <summary>
    /// 
    /// </summary>
    public GetAgreedHandlingChargesResponse()
    {
        this.AgreedCharge = new List<AgreedHandlingCharge>();
    }

    #endregion
}

[DataContract]
[MessageContract(WrapperNamespace = "urn:BillSAFE", IsWrapped = true)]
public abstract class Response
{
    #region Properties

    /// <summary>
    /// 
    /// </summary>
    [DataMember(Name = "ack")]
    [MessageBodyMember(Name = "ack")]
    public string Ack { get; set; }

    /// <summary>
    /// 
    /// </summary>
    [DataMember(Name = "errorList")]
    [MessageBodyMember(Name = "errorList")]
    public ICollection<Error> ErrorList { get; set; }

    #endregion

    #region Constructor

    /// <summary>
    /// 
    /// </summary>
    protected Response()
    {
        //this.Ack = V209.Ack.Error;
        this.ErrorList = new List<Error>();
    }

    #endregion
}

[DataContract]
[MessageContract(WrapperNamespace = "urn:BillSAFE", IsWrapped=true)]
public abstract class Request
{
    #region Properties

    /// <summary>
    /// 
    /// </summary>
    [DataMember(Name = "merchant")]
    [MessageBodyMember(Name = "merchant", Namespace = "urn:BillSAFE")]
    public Merchant Merchant { get; set; }

    /// <summary>
    /// 
    /// </summary>
    [DataMember(Name = "application")]
    [MessageBodyMember(Name = "application", Namespace = "urn:BillSAFE")]
    public Application Application { get; set; }

    #endregion
}
Asesjix
  • 3,891
  • 3
  • 16
  • 19

2 Answers2

1

okay, I just found the error I looked again just xml response. where all properties have no namespace. this must be stated specifically.

SOAP Response

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:BillSAFE">
<s:Header xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"></s:Header>
<SOAP-ENV:Body>
<ns1:getAgreedHandlingChargesResponse>
<ack xmlns="">ERROR</ack>
<errorList xmlns="">
<code>305</code>
<message>No data to return</message>
</errorList>
</ns1:getAgreedHandlingChargesResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

C#

[MessageContract(WrapperNamespace = "urn:BillSAFE", IsWrapped = true)]
public abstract class Response
{
    #region Properties

    /// <summary>
    /// 
    /// </summary>
    [MessageBodyMember(Name = "ack", Namespace = "")]
    public Ack Ack { get; set; }

    /// <summary>
    /// 
    /// </summary>
    [MessageBodyMember(Name = "errorList", Namespace = "")]
    public ICollection<Error> ErrorList { get; set; }

    #endregion

    #region Constructor

    /// <summary>
    /// 
    /// </summary>
    protected Response()
    {
        this.Ack = V209.Ack.Error;
        this.ErrorList = new List<Error>();
    }

    #endregion
}
Asesjix
  • 3,891
  • 3
  • 16
  • 19
  • While you're at it, remove those try/catch blocks. `try { ... } catch (Exception) {throw;}` is the same thing as `...`, but doesn't waste as much time. – John Saunders Jan 18 '13 at 09:19
0

On your classes: Merchant, Application, Error, etc. add [DataContract] above the class declaration and [DataMember] above all properties like so:

[DataContract]
public class Merchant
{
    [DataMember] 
    public int SomeVariable { get; set; }

    ...
}

Also, I noticed some capitalization differences between your MessageBodyMember name and the class name, have you tried to change those to be identical?

alan
  • 6,705
  • 9
  • 40
  • 70
  • That doesn't work. Have I already tested. Show: http://msdn.microsoft.com/en-us/library/vstudio/ms751464(v=vs.90).aspx – Asesjix Jan 17 '13 at 20:59
  • Even response.ACK is null. – Asesjix Jan 17 '13 at 21:05
  • 2
    Sometimes the namespace, as in C# namespace can cause issues if there's a mismatch between what's generated between client and server. I've maybe even seen the Namespace property of the ServiceContract attribute cause a problem like this if it doesn't match what's on the server as well. Make sure you're namespaces are in sync between client and server across the board. No matter which attribute you're using (ServiceContract, MessageBodyMember, etc.). – A-Dubb Jan 17 '13 at 21:08
  • I have this problem now more are 3 days. I have tested the namespaces definitely already 10 times. It is also so that the request works without problems, only the response seems to be not filled. also once the configuration attribute callbackDebug.includeExceptionDetailInFaults enabled is an exception would be generated. – Asesjix Jan 17 '13 at 21:17
  • The example you added does not show how you attempted to add [DataContract], etc. to your class and properties. Can you please replace the TestMethod with an example of this? – alan Jan 17 '13 at 21:20
  • Thanks! Now I can't tell from the example, but did you continue to add [DataContract] and [DataMember] to all custom classes in the hierarchy? Or did you stop at the first tier? – alan Jan 17 '13 at 21:28
  • The "model" classes have all the time been the attributes [DataContract] and [DataMember] such as the "Merchant" class – Asesjix Jan 17 '13 at 21:31
  • I've updated my answer (look towards the bottom), please check it out an let me know if it helps. – alan Jan 17 '13 at 22:11
  • I have tested that already out. so that the classes and properties the same names have as the data objects in the wsdl. – Asesjix Jan 18 '13 at 08:16