Page 1 of 1

Adding subsribers via soap - date format problem

Posted: Tue Apr 29, 2008 9:37 am
by jacpad
Hi all,
I have a problem adding subscribers with user defined fields to our system via the webservice.
The subsribers are successfully added to the DB, but the fields with type date seems to be ignored. I tried some formats now and I want to ask which format the webservice accepts ? Is this documented somewhere - I can't find anything about it.

Thanks for any help
Patrik

Posted: Tue Apr 29, 2008 1:50 pm
by maschoff
You can find the webservices documentation in the download section of project OpenEMM at SourceForge:

http://sourceforge.net/project/showfile ... _id=168937

Posted: Tue Apr 29, 2008 2:01 pm
by jacpad
Thanks, but the documentation does not mention the format for a user defined date type field. Only the parameter type for the soap call (StringArrayType) is given.

split of dates

Posted: Wed Apr 30, 2008 9:28 am
by maschoff
You have to split a date like this:

necessary parts:
- fieldname_DAY_DATE
- fieldname_MONTH_DATE
- fieldname_YEAR_DATE

optional parts:
- fieldname_HOUR_DATE
- fieldname_MINUTE_DATE
- fieldname_SECOND_DATE

Does this help?

Posted: Wed Apr 30, 2008 1:26 pm
by jacpad
Thanks a lot, this is the information I was looking for.
I couldn't find it in any documentation.

ma == best :)

edit: Looks like the webservice doesn't want my dates anyway.
I tried like you wrote (including time parameter), but none of the dates where written to the database and I didn't even get an exception just the ID. So I still in need for help....

Posted: Wed Apr 30, 2008 1:37 pm
by maschoff
Well, I sit next door to the core developers ... If you can confirm that it works for you I will add this information to the webservice documentation.

Posted: Wed Apr 30, 2008 2:36 pm
by jacpad
As I wrote in my edit - sorry I didn't see your answer that moment - the date values are not written to the database. I could post or send the soap request. Or maybe is there a switch to log everything ?

Posted: Wed Apr 30, 2008 3:24 pm
by maschoff
Posting your SOAP request would be the easiest.

Posted: Wed Apr 30, 2008 3:28 pm
by jacpad
ok - so here is my request:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:agnitas-webservice"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:addSubscriber>
<in0 xsi:type="SOAP-ENC:string">account</in0>
<in1 xsi:type="SOAP-ENC:string">pw</in1>
<in2 xsi:type="xsd:boolean">true</in2>
<in3 xsi:type="SOAP-ENC:string">email</in3>
<in4 xsi:type="xsd:boolean">false</in4>
<in5 xsi:type="ns1:StringArrayType">
<x xsi:type="xsd:string">firstname</x>
<x xsi:type="xsd:string">lastname</x>
<x xsi:type="xsd:string">email</x>
<x xsi:type="xsd:string">udef_home_country</x>
<x xsi:type="xsd:string">udef_home_city</x>
<x xsi:type="xsd:string">
udef_home_newsletter_DAY_DATE
</x>
<x xsi:type="xsd:string">
udef_home_newsletter_MONTH_DATE
</x>
<x xsi:type="xsd:string">
udef_home_newsletter_YEAR_DATE
</x>
<x xsi:type="xsd:string">
udef_home_newsletter_HOUR_DATE
</x>
<x xsi:type="xsd:string">
udef_home_newsletter_MINUTE_DATE
</x>
<x xsi:type="xsd:string">
udef_home_newsletter_SECOND_DATE
</x>
<x xsi:type="xsd:string">udef_home_customer_DAY_DATE</x>
<x xsi:type="xsd:string">
udef_home_customer_MONTH_DATE
</x>
<x xsi:type="xsd:string">
udef_home_customer_YEAR_DATE
</x>
<x xsi:type="xsd:string">
udef_home_customer_HOUR_DATE
</x>
<x xsi:type="xsd:string">
udef_home_customer_MINUTE_DATE
</x>
<x xsi:type="xsd:string">
udef_home_customer_SECOND_DATE
</x>
<x xsi:type="xsd:string">udef_home_contact_type</x>
</in5>
<in6 xsi:type="ns1:StringArrayType">
<x xsi:type="xsd:string">Horst</x>
<x xsi:type="xsd:string">Klotz</x>
<x xsi:type="xsd:string">test@aol.com</x>
<x xsi:type="xsd:string">DE</x>
<x xsi:type="xsd:string">Berlin</x>
<x xsi:type="xsd:string">14</x>
<x xsi:type="xsd:string">9</x>
<x xsi:type="xsd:string">2006</x>
<x xsi:type="xsd:string">0</x>
<x xsi:type="xsd:string">0</x>
<x xsi:type="xsd:string">0</x>
<x xsi:type="xsd:string">26</x>
<x xsi:type="xsd:string">7</x>
<x xsi:type="xsd:string">2007</x>
<x xsi:type="xsd:string">0</x>
<x xsi:type="xsd:string">0</x>
<x xsi:type="xsd:string">0</x>
<x xsi:type="xsd:string">C</x>
</in6>
</ns1:addSubscriber>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Bug fixed

Posted: Fri May 02, 2008 10:40 am
by maschoff
We found a bug and posted the bug fix to the SourceForge bugtracker here:

http://sourceforge.net/tracker/index.ph ... tid=848488

Could you please confirm that the fix works for you? Thank you!

Posted: Fri May 02, 2008 12:01 pm
by jacpad
This is looking very good - yes, the date values are inserted correctly now.
Thanks to you and the developers for the fast reponse on this issue.

Best regards
Patrik