473,395 Members | 1,905 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

HTML in front of XML while using SOAP. Please help.

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">kh***@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>

Jul 17 '05 #1
2 3305
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">kh***@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
------------------
Jul 17 '05 #2
NC
Cantor wrote:

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. .... My biggest issue is that the HTML prevents me from doing
proper error handling on my side of the app. Is this
fixable?


Yes, but you need to fix the provider, not the client...

Cheers,
NC

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Michael Barrido | last post by:
Greetings! I have a project that needs to access a web service. My problem is this web service is provided via CGI. I cannot do a "Web Reference" to it to add in my dotnet project. I'm planning to...
4
by: Alex | last post by:
I need to display html info on an Access form. To do this I am using the Micorsoft Web Browser control which uses shdocvw.dll The problem with this is that a. the control is not resizable....
8
by: FS Liu | last post by:
Hi, I am writing ATL Service application (XML Web service) in VS.NET C++. Are there any sample programs that accept XML as input and XML as output in the web service? Thank you very much.
1
by: JTrigger | last post by:
I need to call a .Net web service that takes an array or object as a parameter from a PERL client. I have been trying to use the PERL SOAP::Lite package to do this without success. I can call one...
0
by: GeeeTeee | last post by:
Hi, Has anyone out there managed to write a C# Web Service client which can add ebXML data to the SOAP Enveloper? And if so, could you please give me some pointers? I just can't figure out how...
3
by: Sydney | last post by:
Hi, I am trying to construct a WSE 2.0 security SOAP request in VBScript on an HTML page to send off to a webservice. I think I've almost got it but I'm having an issue generating the nonce...
2
by: lprisr | last post by:
Hi, I have double byte characters in the content that I am returning using Web Services. However, the encoding in the xml file returned by Web Services is utf-8 and I am unable to read the...
1
by: akumar8k | last post by:
when i am excusing the below code i am getting the error. Error 1 − <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> − <SOAP-ENV:Body> −
10
by: jollysr | last post by:
Could someone please help me convert the following XML to HTML page? <?xml version="1.0" encoding="UTF-16"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.