Errors on a first step
Hi all.
I practically didn’t work with API before, so I took an example from here
http://wiki.dwscoalition.org/wiki/index.php/XML-RPC_Protocol_Method:_postevent
as it is, and and got an error
faultCode Client faultStringApplication failed during request deserialization:
XML or text declaration not at start of entity at line 1, column 1, byte 1 at /home/dw/current/extlib/lib/perl5/x86_64-linux-gnu-thread-multi/XML/Parser.pm line 187.
Could anyone please tell me which client is needed to work with and in what field ?
Thank you all in advance
UPD
Fixed, by replace ESC 0D 0A by
$ReturnTextPostTestMessage01.Replace("`r`n","")
I practically didn’t work with API before, so I took an example from here
http://wiki.dwscoalition.org/wiki/index.php/XML-RPC_Protocol_Method:_postevent
as it is, and and got an error
XML or text declaration not at start of entity at line 1, column 1, byte 1 at /home/dw/current/extlib/lib/perl5/x86_64-linux-gnu-thread-multi/XML/Parser.pm line 187.
Could anyone please tell me which client is needed to work with and in what field ?
Thank you all in advance
UPD
Fixed, by replace ESC 0D 0A by
$ReturnTextPostTestMessage01.Replace("`r`n","")

no subject
no subject
code:
----
function PostTestMessage01{
param([string]$F_UserID, [string]$F_UserPass)
$ReturnTextPostTestMessage01 = ''
$Now = Get-Date
$ReturnTextPostTestMessage01 = '
LJ.XMLRPC.postevent
username
' + $F_UserID + '
'
$ReturnTextPostTestMessage01 = $ReturnTextPostTestMessage01 +
# auth_method
'auth_method
cookie
'
$ReturnTextPostTestMessage01 = $ReturnTextPostTestMessage01 +
'event
This is a test post 001 Alpha
subject
Test subject 002 B
lineendings
pc
year
' + ($Now.Year.ToString()) + '
mon
' + ($Now.Month.ToString()) + '
day
'+ $Now.Day.ToString() +'
hour
' +$Now.Hour.ToString() + '
min
' + $Now.Minute.ToString() + '
'
return $ReturnTextPostTestMessage01
}
$Body4Post = PostTestMessage01 $DreamUsername $DreamPass
$DreamAnswer002 = Invoke-WebRequest -Uri $DreamUrlxmlrpc -Method Post -Body $Body4Post -ContentType "text/xml"
no subject
no subject
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00000000 0D 0A 3C 3F 78 6D 6C 20 76 65 72 73 69 6F 6E 3D ....<
yes, there are
0D 0A
faultCodeClientfaultStringApplication failed during request deserialization:
not well-formed (invalid token) at line 1, column 1, byte 2 at /home/dw/current/extlib/lib/perl5/x86_64-linux-gnu-thread-multi/XML/Parser.pm line 187.
so I fixed it inccorrect way
$ReturnTextPostTestMessage01 = $ReturnTextPostTestMessage01.Replace("`r`n","`0") #incorrect - 3F 3E !---00!--- 3C 6D
with differenet error (let it be here as example)
faultCodeClientfaultStringApplication failed during request deserialization:
not well-formed (invalid token) at line 1, column 1, byte 2 at /home/dw/current/extlib/lib/perl5/x86_64-linux-gnu-thread-multi/XML/Parser.pm line 187.
and after check
$ReturnTextPostTestMessage01 = $ReturnTextPostTestMessage01.Replace("`r`n","")
it's look better - just "Invalid password"
faultCode101faultStringInvalid password
Thanks a lot
After some another stupid fixes such as "(space) /int>" - it's works.c
Thanks again
no subject