Connecting to a PHP SOAP Extension webservice with

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I'm working with a customer who is implementing a simple webservice with
the PHP Soap Extension.  It's supposed to define one method, taking a
string and returning a string.  I'm trying to access this webservice from
ASP.NET, and Microsoft's deserializer complains.

First problem is that the wsdl is declared rpc/encoded.  MS's wsdl.exe
complains that this violates the WS-I Basic Profile.  But ignoring that,
when I try to access the webservice, the call works, but I get errors on
trying to parse the response.

The guts of his wsdl:

  <xsd:schema [...]>
    <simpleType name="XmlOut">
      <restriction base = "xsd:string"/>

<message name="XmlTestResponse">
  <part name="result" type="tns:XmlOut"/>

<portType name="XXXPortType">
  <operation name="XmlTest">
    <output message="tns:XmlTestResponse"/>

The SOAP Response:

<?xml version="1.0" encoding="UTF-8"?>
    xmlns:SOAP-ENV=" /"
    xmlns:ns1=" "
    xmlns:xsd=" "
    xmlns:xsi=" "
    xmlns:ns2=" "
    xmlns:SOAP-ENC=" /"
    SOAP-ENV:encodingStyle=" /">
      <result xsi:type="ns2:XmlOut">
        Test Message

The error is in trying to deserialize "result":

   "Cannot assign object of type System.Xml.XmlNode[] to an object of
   type System.String."

Anyone have any ideas as to what is going on?  Does this have anything to
do with the rpc/encoded vs. document/literal issue that wsdl.exe was
complaining about?

We must remember that law is force, and that, consequently, the proper
functions of the law cannot morally extend beyond the proper functions
of force.
        - Frederic Bastiat

Re: Connecting to a PHP SOAP Extension webservice with


Quoted text here. Click to load it

LOL... see what I've done, Jerry? ;-)

Quoted text here. Click to load it

This would appear to be a problem with ASP.NET's XML parsing  -
ASP.NET seems to be complaining about trying to cast a response object
of type 'result' into a string.

As I see it, there is nothing wrong with the response from the PHP
'thing'; it's all down to what you do with it from there in your ASP

You might be better off asking in an ASP.NET newsgroup.

Quoted text here. Click to load it

I think it's more likely to be an XML issue, specifically something to
do with typecasting. Not knowing anything about ASP.NET I'm afraid I
can't help you. Others might have more to offer.

Re: Connecting to a PHP SOAP Extension webservice with

On Sat, 15 Aug 2009 03:42:32 +0100, internetwebthing wrote:

Quoted text here. Click to load it

I did that, and didn't receive much help.  I eventually figured out how
to extract the raw SOAP response from .NET's web-service objects, so I
could parse it myself.

Security is mostly a superstition.  It does not exist in nature, nor
do the children of men as a whole experience it.  Avoiding danger in
the end is no safer in the long run than outright exposure.  Life is a
daring adventure or nothing.
        - Helen Keller

Site Timeline