Hello everyone :)
I am writing some dotNET code to "consume" a web service written in
PHP. So far I have been getting some error messages and PHP seems to
place HTML text in front of the XML message. dotNET doesn't expect the
XML and then it chokes. This is what I get.
The <br> tag from namespace is not expected. Line 1, position 2.
I was able to capture the data going through the network and I've got
the outgoing and incoming messages. I put those at the end of the post
because they are too long.
Looking at them you can perfectly see the HTML I mentioned. In this
case the HTML part says I am missing arguments. That should be an error
message coded in SOAP. But there is more. There is an actual SOAP error
message, it looks like even when the call was bad it executed the code;
it must have put something on the missing parameters.
My biggest issue is that the HTML prevents me from doing proper error
handling on my side of the app. Is this fixable?
Arturo Hernandez
PD If it is fixable I'll comunicate the answer to my service provider.
And I do have a good relation with the programmers there.
----------------------------Outbound
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelop e xmlns:soap="htt p://schemas.xmlsoap .org/soap/envelope/"
xmlns:soapenc=" http://schemas.xmlsoap .org/soap/encoding/"
xmlns:tns="urn: CreateUserSvs"
xmlns:types="ur n:CreateUserSvs/encodedTypes"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema">
<soap:Body
soap:encodingSt yle="http://schemas.xmlsoap .org/soap/encoding/">
<tns:CreateUser >
<UserID xsi:type="xsd:s tring">kirk</UserID>
<UserKey xsi:type="xsd:s tring" />
<Password xsi:type="xsd:s tring">hill</Password>
<FirstName xsi:type="xsd:s tring">kirk</FirstName>
<LastName xsi:type="xsd:s tring">hill</LastName>
<Address xsi:type="xsd:s tring" />
<City xsi:type="xsd:s tring" />
<Province xsi:type="xsd:s tring" />
<Country xsi:type="xsd:s tring" />
<PostalCode xsi:type="xsd:s tring" />
<EmailAddress xsi:type="xsd:s tring">khill@ho tmail.com</EmailAddress>
<RichContent xsi:type="xsd:b oolean">false</RichContent>
<VisionImpair ed xsi:type="xsd:b oolean">false</VisionImpaired>
<Impaired xsi:type="xsd:b oolean">false</Impaired>
<LogonNotify xsi:type="xsd:b oolean">false</LogonNotify>
<EmailNotify xsi:type="xsd:b oolean">false</EmailNotify>
<Active xsi:type="xsd:b oolean">false</Active>
<Security xsi:type="xsd:i nt">0</Security>
<ForceUpdate xsi:type="xsd:b oolean">true</ForceUpdate>
</tns:CreateUser> </soap:Body></soap:Envelope>
------------------------------Inbound
<b>Warning</b>: Missing argument 20 for CreateUser() in
<b>C:\Websites\ prod\api\Create UserSvs.php</b> on line <b>392</b><br />
<br />
<b>Warning</b>: Missing argument 21 for CreateUser() in
<b>C:\Websites\ prod\api\Create UserSvs.php</b> on line <b>392</b><br />
<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope
SOAP-ENV:encodingSty le="http://schemas.xmlsoap .org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap .org/soap/envelope/"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap .org/soap/encoding/"
xmlns:si="http://soapinterop.org/xsd">
<SOAP-ENV:Body><SOAP-ENV:Fault><faul tcode>ERROR.USE R_EXISTS</faultcode><faul tactor></faultactor>
<faultstring>Th e UserID specified exists, to update this user you must
set ForceUpdate to true.</faultstring> <detail><soapVa l
xsi:type="xsd:s tring"></soapVal></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
I am writing some dotNET code to "consume" a web service written in
PHP. So far I have been getting some error messages and PHP seems to
place HTML text in front of the XML message. dotNET doesn't expect the
XML and then it chokes. This is what I get.
The <br> tag from namespace is not expected. Line 1, position 2.
I was able to capture the data going through the network and I've got
the outgoing and incoming messages. I put those at the end of the post
because they are too long.
Looking at them you can perfectly see the HTML I mentioned. In this
case the HTML part says I am missing arguments. That should be an error
message coded in SOAP. But there is more. There is an actual SOAP error
message, it looks like even when the call was bad it executed the code;
it must have put something on the missing parameters.
My biggest issue is that the HTML prevents me from doing proper error
handling on my side of the app. Is this fixable?
Arturo Hernandez
PD If it is fixable I'll comunicate the answer to my service provider.
And I do have a good relation with the programmers there.
----------------------------Outbound
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelop e xmlns:soap="htt p://schemas.xmlsoap .org/soap/envelope/"
xmlns:soapenc=" http://schemas.xmlsoap .org/soap/encoding/"
xmlns:tns="urn: CreateUserSvs"
xmlns:types="ur n:CreateUserSvs/encodedTypes"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema">
<soap:Body
soap:encodingSt yle="http://schemas.xmlsoap .org/soap/encoding/">
<tns:CreateUser >
<UserID xsi:type="xsd:s tring">kirk</UserID>
<UserKey xsi:type="xsd:s tring" />
<Password xsi:type="xsd:s tring">hill</Password>
<FirstName xsi:type="xsd:s tring">kirk</FirstName>
<LastName xsi:type="xsd:s tring">hill</LastName>
<Address xsi:type="xsd:s tring" />
<City xsi:type="xsd:s tring" />
<Province xsi:type="xsd:s tring" />
<Country xsi:type="xsd:s tring" />
<PostalCode xsi:type="xsd:s tring" />
<EmailAddress xsi:type="xsd:s tring">khill@ho tmail.com</EmailAddress>
<RichContent xsi:type="xsd:b oolean">false</RichContent>
<VisionImpair ed xsi:type="xsd:b oolean">false</VisionImpaired>
<Impaired xsi:type="xsd:b oolean">false</Impaired>
<LogonNotify xsi:type="xsd:b oolean">false</LogonNotify>
<EmailNotify xsi:type="xsd:b oolean">false</EmailNotify>
<Active xsi:type="xsd:b oolean">false</Active>
<Security xsi:type="xsd:i nt">0</Security>
<ForceUpdate xsi:type="xsd:b oolean">true</ForceUpdate>
</tns:CreateUser> </soap:Body></soap:Envelope>
------------------------------Inbound
<b>Warning</b>: Missing argument 20 for CreateUser() in
<b>C:\Websites\ prod\api\Create UserSvs.php</b> on line <b>392</b><br />
<br />
<b>Warning</b>: Missing argument 21 for CreateUser() in
<b>C:\Websites\ prod\api\Create UserSvs.php</b> on line <b>392</b><br />
<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope
SOAP-ENV:encodingSty le="http://schemas.xmlsoap .org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap .org/soap/envelope/"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap .org/soap/encoding/"
xmlns:si="http://soapinterop.org/xsd">
<SOAP-ENV:Body><SOAP-ENV:Fault><faul tcode>ERROR.USE R_EXISTS</faultcode><faul tactor></faultactor>
<faultstring>Th e UserID specified exists, to update this user you must
set ForceUpdate to true.</faultstring> <detail><soapVa l
xsi:type="xsd:s tring"></soapVal></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
Comment