Happy Business Starts Here

Payment object : EffectiveDate: INVALID_VALUE "date string can not be less than 19 charactors"

Highlighted
Senior Tutor

Payment object : EffectiveDate: INVALID_VALUE "date string can not be less than 19 charactors"

Am seeing the the below error when making payment, when I use a WSDL version greater than a.68.0 in C# .NET

The error is with the EffectiveDate field, which is generated by the svcutil as a DateTime Field. Per the documentation, all DateTime fields have been changed to Date from a.69.0 and above. However, the svcutil generates it as a DateTime field. I am not sure how to assign a Date value to this DateTime field.

 

 

Payment object : INVALID_VALUE "date string can not be less than 19 charactors"

 

- Errors {Error[1]} Error[]
- [0] {Error} Error
Code INVALID_VALUE ErrorCode?
CodeSpecified true bool
Field null string
Message "date string can not be less than 19 charactors" string
codeField INVALID_VALUE ErrorCode?
codeFieldSpecified true bool
fieldField null string
messageField "date string can not be less than 19 charactors" string

6 REPLIES 6
Support SME

Re: Payment object : EffectiveDate: INVALID_VALUE "date string can not be less than 19 characto

Hi @jmichael,

 

As per documentation 

 

Please  have a look at the following links from our Knowledge Centre which might be relevant to your query:

 

https://knowledgecenter.zuora.com/DC_Developers/SOAP_API/AB_Getting_started_with_the__SOAP_API/C_Dat...

 

https://knowledgecenter.zuora.com/CB_Billing/WA_Dates_in_Zuora/A_Date_and_dateTime_Format

 

Are you able to provide us with the data whicih gets passed through your C# .NET application?






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

Support SME

Re: Payment object : EffectiveDate: INVALID_VALUE "date string can not be less than 19 characto

Hello @jmichael,

 

Could you let me know how did you parameter svcutil, have you used the "svcutil /t:metadata https://www.zuora.com/apps/services/a/69.0" command?

 

Also, could you confirm which EffectiveDate field are you referring to exactly, as a number of object have this same field.

 

While I can't test this in C# .NET, all my test query() calls on EffectiveDate fields using 69.0+ resulted in dates being returned and not dateTimes.



If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

Senior Tutor

Re: Payment object : EffectiveDate: INVALID_VALUE "date string can not be less than 19 characto

Hi Omar,

Thanks for your response. I looked at the links you have added in your comments before posting the question. The issue here is something to do with how the C# proxy is being generated from the WSDL. I have given below the C# code which I am passing as well as the Payment object in the proxy. If you look at the section 3. below of the Payment class from the proxy, you will see that the EffectiveDate is generated as a DateTime field.

 

1. C# Code

 var payment = new Payment
            {
                AccountId = "2c92c0f84c510073014c62fddc1f173e",
                AppliedCreditBalanceAmount = 10,
                AppliedCreditBalanceAmountSpecified = true,
                Amount = 10,
                AmountSpecified = true,
                AppliedInvoiceAmount = 10,
                PaymentMethodId = "2c92c0f953cfa2d80153f160efef0f25",
                Status = "Processed",
                Type = "Electronic",
                EffectiveDate = DateTime.Now,
                EffectiveDateSpecified = true,

            };

2. Payment object value in C# Debug Window
-        payment    {Payment}    Payment
        AccountId    "2c92c0f84c510073014c62fddc1f173e"    string
        Amount    10    decimal?
        AmountSpecified    true    bool
        AppliedCreditBalanceAmount    10    decimal?
        AppliedCreditBalanceAmountSpecified    true    bool
        AppliedInvoiceAmount    10    decimal?
        AppliedInvoiceAmountSpecified    true    bool
+        EffectiveDate    {4/7/2016 8:39:38 AM}    System.DateTime?
        EffectiveDateSpecified    true    bool
        PaymentMethodId    "2c92c0f953cfa2d80153f160efef0f25"    string
        Status    "Processed"    string
        SubmittedOn    null    System.DateTime?
        SubmittedOnSpecified    false    bool
        Type    "Electronic"    string
        accountIdField    "2c92c0f84c510073014c62fddc1f173e"    string
        amountField    10    decimal?
        amountFieldSpecified    true    bool
        appliedCreditBalanceAmountField    10    decimal?
        appliedCreditBalanceAmountFieldSpecified    true    bool
        appliedInvoiceAmountField    10    decimal?
        appliedInvoiceAmountFieldSpecified    true    bool
+        effectiveDateField    {4/7/2016 8:39:38 AM}    System.DateTime?
        effectiveDateFieldSpecified    true    bool
        paymentMethodIdField    "2c92c0f953cfa2d80153f160efef0f25"    string
        statusField    "Processed"    string
        submittedOnField    null    System.DateTime?
        submittedOnFieldSpecified    false    bool
        typeField    "Electronic"    string

 

3. Given below is the Payment Object from the proxy which is generated

public partial class Payment : zObject

{
    
    private System.Nullable<System.DateTime> effectiveDateField;
    
    private bool effectiveDateFieldSpecified;
    
    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute(DataType="date", IsNullable=true, Order=15)]
    public System.Nullable<System.DateTime> EffectiveDate
    {
        get
        {
            return this.effectiveDateField;
        }
        set
        {
            this.effectiveDateField = value;
        }
    }
    
}

Senior Tutor

Re: Payment object : EffectiveDate: INVALID_VALUE "date string can not be less than 19 characto

Hi Viktor,

The EffectiveDate field I am referring to is for the Payment Class

The parameter I used is :

svcutil /t:code /out:ZuoraService.cs /config:../app.config /mergeconfig  /ctSmiley Frustratedystem.Collections.Generic.List`1  zuora.a.75.0.wsdl

 

I tried the parameter you suggested:

svcutil /t:metadata https://www.zuora.com/apps/services/a/69.0

I get the following error:

c:\E_Drive Backup_01282016\Test Projects\Bandwidth.com\Bandwidth.com\Zuora>Zuora
ProxyGenerator.bat

c:\E_Drive Backup_01282016\Test Projects\Bandwidth.com\Bandwidth.com\Zuora>ec
ho off
'echo' is not recognized as an internal or external command,
operable program or batch file.

c:\E_Drive Backup_01282016\Test Projects\Bandwidth.com\Bandwidth.com\Zuora>REM s
vcutil /t:code /out:ZuoraService.cs /config:../app.config /mergeconfig  /ctSmiley Frustratedyst
em.Collections.Generic.List`1  zuora.a.75.0.wsdl

c:\E_Drive Backup_01282016\Test Projects\Bandwidth.com\Bandwidth.com\Zuora>svcut
il /t:metadata https://www.zuora.com/apps/services/a/69.0
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 4.0.30319.1]
Copyright (c) Microsoft Corporation.  All rights reserved.

Attempting to download metadata from 'https://www.zuora.com/apps/services/a/69.0
' using WS-Metadata Exchange or DISCO.
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 4.0.30319.1]
Copyright (c) Microsoft Corporation.  All rights reserved.

Error: Cannot obtain Metadata from https://www.zuora.com/apps/services/a/69.0

If this is a Windows (R) Communication Foundation service to which you have acce
ss, please check that you have enabled metadata publishing at the specified addr
ess.  For help enabling metadata publishing, please refer to the MSDN documentat
ion at http://go.microsoft.com/fwlink/?LinkId=65455.


WS-Metadata Exchange Error
    URI: https://www.zuora.com/apps/services/a/69.0

    Metadata contains a reference that cannot be resolved: 'https://www.zuora.co
m/apps/services/a/69.0'.

    <?xml version="1.0" encoding="utf-16"?><Fault xmlns="http://www.w3.org/2003/
05/soap-envelope"><Code><Value>Client</Value></Code><Reason><Text xml:lang="en-U
S">The endpoint reference (EPR) for the Operation not found is http://www.zuora.
com/apps/services/a/69.0 and the WSA Action = null</Text></Reason><Detail xmlns:
soapenv="http://www.w3.org/2003/05/soap-envelope"><Exception xmlns="">org.apache
.axis2.AxisFault: The endpoint reference (EPR) for the Operation not found is ht
tp://www.zuora.com/apps/services/a/69.0 and the WSA Action = null
        at org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPha
se.java:88)
        at org.apache.axis2.engine.Phase.invoke(Phase.java:333)
        at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:264)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:163)
        at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostReq
uest(HTTPTransportUtils.java:275)
        at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:1
31)
        at com.zuora.api.util.ZuoraAxisServlet.doPost(ZuoraAxisServlet.java:85)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:208)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52
)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:208)
        at com.temp.HttpStatusExceptionFilter.doFilter(HttpStatusExceptionFilter
.java:25)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:208)
        at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.do
FilterInternal(OpenSessionInViewFilter.java:198)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerR
equestFilter.java:76)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:122)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:505)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:170)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:103)
        at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:68
3)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:423)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp
11Processor.java:1079)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
AbstractProtocol.java:620)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoin
t.java:316)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskTh
read.java:61)
        at java.lang.Thread.run(Thread.java:745)
</Exception></Detail></Fault>


HTTP GET Error
    URI: https://www.zuora.com/apps/services/a/69.0

    The document at the url https://www.zuora.com/apps/services/a/69.0 was not r
ecognized as a known document type.
The error message from each known type may help you fix the problem:
- Report from 'XML Schema' is 'The root element of a W3C XML Schema should be <s
chema> and its namespace should be 'http://www.w3.org/2001/XMLSchema'.'.
- Report from 'DISCO Document' is 'Discovery document at the URL https://www.zuo
ra.com/apps/services/a/69.0 could not be found.'.
  - The document format is not recognized (the content type is '').
- Report from 'WSDL Document' is 'There is an error in XML document (1, 2).'.
  - <html xmlns=''> was not expected.

Senior Tutor

Re: Payment object : EffectiveDate: INVALID_VALUE "date string can not be less than 19 characto

This issue has been fixed. It was my mistake. I was using an endpoint https://apisandbox.zuora.com/apps/services/a/57.0

and trying to use a WSDL from version 75.

For some reason the service works for WSDL versions upto 68 using https://apisandbox.zuora.com/apps/services/a/57.0 and breaks for versions from 69, possibly due to the DateTime changes

Zuora Alumni

Re: Payment object : EffectiveDate: INVALID_VALUE "date string can not be less than 19 characto

Thanks for sharing your solution!



If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √