|
Posted by Paul Fisher on 11/09/08 11:18
Cantor wrote:
> 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:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:tns="urn:CreateUserSvs"
> xmlns:types="urn:CreateUserSvs/encodedTypes"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <soap:Body
> soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
> <tns:CreateUser>
> <UserID xsi:type="xsd:string">kirk</UserID>
> <UserKey xsi:type="xsd:string" />
> <Password xsi:type="xsd:string">hill</Password>
> <FirstName xsi:type="xsd:string">kirk</FirstName>
> <LastName xsi:type="xsd:string">hill</LastName>
> <Address xsi:type="xsd:string" />
> <City xsi:type="xsd:string" />
> <Province xsi:type="xsd:string" />
> <Country xsi:type="xsd:string" />
> <PostalCode xsi:type="xsd:string" />
> <EmailAddress xsi:type="xsd:string">khill@hotmail.com</EmailAddress>
> <RichContent xsi:type="xsd:boolean">false</RichContent>
> <VisionImpaired xsi:type="xsd:boolean">false</VisionImpaired>
> <Impaired xsi:type="xsd:boolean">false</Impaired>
> <LogonNotify xsi:type="xsd:boolean">false</LogonNotify>
> <EmailNotify xsi:type="xsd:boolean">false</EmailNotify>
> <Active xsi:type="xsd:boolean">false</Active>
> <Security xsi:type="xsd:int">0</Security>
> <ForceUpdate xsi:type="xsd:boolean">true</ForceUpdate>
> </tns:CreateUser></soap:Body></soap:Envelope>
>
> ------------------------------Inbound
>
> <b>Warning</b>: Missing argument 20 for CreateUser() in
> <b>C:\Websites\prod\api\CreateUserSvs.php</b> on line <b>392</b><br />
> <br />
> <b>Warning</b>: Missing argument 21 for CreateUser() in
> <b>C:\Websites\prod\api\CreateUserSvs.php</b> on line <b>392</b><br />
> <?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope
> SOAP-ENV:encodingStyle="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><faultcode>ERROR.USER_EXISTS</faultcode><faultactor></faultactor>
> <faultstring>The UserID specified exists, to update this user you must
> set ForceUpdate to true.</faultstring> <detail><soapVal
> xsi:type="xsd:string"></soapVal></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
>
In this case, the error message is not missing arguments on your part,
but missing arguments on the programmers of the PHP script's part. That
would be a (monster!) function call in the internal PHP source of the
service, where they only had nineteen parameters when there should've
been twenty-one. Give the programmers the error message, complete with
line and file, and see what they can do about it.
Also: "The br tag from namespace is not expected." really just means
that the br tag /has/ no namespace.
--
HAVE CASH READY
SINGLE FILE ONLY
------------------
KNOW YOUR SOUP
------------------
Navigation:
[Reply to this message]
|