XML schema problems
| From: | Steve Fisk | Date: | Wed, 11 Jun 2003 08:18:01 +0000 |
| Subject: | XML schema problems | ||
| Groups: | php.soap | ||
| Request: | Send a blank email to php-soap+get-702@lists.php.net to get a copy of this message | ||
Ive noticed a problem while working with SOAP talking to a C# web service:
We are developing a website where the engine is written in Microsoft
languages (chiefly c#) and the web site that it drives is written in PHP
we are using SOAP to pass the information we need for each request from one
to the other.
The problem arose when we tried to write the login system Our login is a
membership number on one page followed by a password screen where it asks
you some pre-agreed security questions. We wanted to send the back end an
array of answers and therein lies the problem:
When we send an array of answers the schema looks like this:
<answerList>
<ns4:item>answer1</item>
<ns4:item>answer2</item>
<ns4:item>answer3</item>
</answerList>
where ns4 is the default namespace and the item tags denote array elements.
The problem is that the definition in the WSDL defines strings therefore
the schema should look like this:
<answerList>
<ns4:string>answer1</string >
<ns4:string>answer2</string >
<ns4:string>answer3</string >
</answerList>
This is the standard for Microsoft and the back end developers have to write
a big swathe of code to compensate for this problem.
In the end our solution was to send three separate answers is there any
way the schema can be more tightly defined in PHP so that this work is
unnecessary? We were discussing the problem and came up with the idea that
because PHP is largely typeless the item was to allow anything to be put
into the array but this is difficult when the code in other peoples systems
is typed
and a big part of the idea for SOAP is that it can work with
anybodys code in anybodys language who could receive the protocol.
Thanks
Steve Fisk
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.476 / Virus Database: 273 - Release Date: 24/04/2003
________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________