Fwd: Re: Problems with SOAP_Fault

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rob, thanks for that. I have tried it, but it does not seem to work...

I think I shall submit a feature/bug request. (I have another thread
on the php-pear list, that is saying that this is not yet working (but
it should be !!!!)).

Many thanks for your help in this.

Chris...


---------- Forwarded message ----------
From: Rob Booth <rbooth@indyme.com>
Date: Tue, 20 Jul 2004 10:48:34 -0700
Subject: Re:  Re: Problems with SOAP_Fault
To: soap@lists.php.net

I've never done this, I've just always sent back the fault as it is and have
defined outside of my WSDL the fault codes that could be returned for my
clients to use.

However from looking at the WSDL.php code (note I haven't tested this) it
looks like all you  have to do is chage your __dispatch_map definition to
look like this:

$this->__dispatch_map['request'] =
   array(
       'in' => array('input' => 'string'),
       'out' => array('return string' => 'string'),
       'fault' => array('error' => 'string')
   );

Now I've not tried this and have no idea what it will or wont do.  But I
believe that it's going to allow you to define what is inside of your
SOAP_Fault so that you can return more than just a string, but that's just
speculation.

Rob

"Chris Covell" <chris.covell@gmail.com> wrote in message
a0f9298304072001184835ec87@mail.gmail.com">news:a0f9298304072001184835ec87@mail.gmail.com...


> Rob,
>
> many thanks for that. Yes, I was just returning the message as a
> string... silly !
>
> Going on from here, is there any way i can describe the fault return
> in the WSDL by using the dispatch_map method ? I have got and "in" and
> an "out", how do I get the dispatch_map to define a fault condition in
> the wsdl too?
>
> Cheers
>
>
> ---------- Forwarded message ----------
> From: Rob Booth <rbooth@indyme.com>
> Date: Mon, 19 Jul 2004 11:18:07 -0700
> Subject:  Re: Problems with SOAP_Fault
> To: soap@lists.php.net
>
> Chris,
>
>    You almost have it.  You just need to return the fault, not the message
> of the fault.  What I do is declare a $retVal and place either the results
> of my method, or the fault in that and return it.
>
> i.e.
>
> $retVal = 1;
>
> if (!true) {
>   $retVal = new SOAP_Fault("Expecting True", "Server", "MyNamespace", 1);
> }
>
> return $retVal;
>
> Rob
>
> "Chris Covell" <chris.covell@gmail.com> wrote in message
> a0f929830407190139439fbed8@mail.gmail.com">news:a0f929830407190139439fbed8@mail.gmail.com...
>
>
> > Hello there, Al tells me I am on the right list, so here is my
question...
> >
> > As a bit of background, I am using pear SOAP 0.8RC3 beta under
> php-4.3.4-1.1.
> >
> > I have a soap server process that works fine ! I have agot a client
> > that connects to it fine also. I have adopted the technique of using
> > the dispatch_map so that a wsdl is created automagically:
> >
> >                 $this->__dispatch_map['request'] =
> >                 array(  'in' => array('input' => 'string'),
> >                         'out' => array('return string' => 'string'),
> >                 );
> >
> > As you can see I have defined in and out parameters as strings.
> >
> > Now, I have a customer connecting to this server using a Java client.
> > He has built his client based on my wsdl. He wants me to return errors
> > as soap faults. I am doing it like this:
> >
> >                 $fault = new SOAP_Fault('Does not exist', '99');
> >                 return  $fault->message();
> >
> > The trouble is that he is seeing the SOAP fault data, but it is
> > wrapped up in a string, this is what he describes:
> >
> > "In case of error I expect your service to return something like this:
> >
> > <http>
> >   <soap:fault/>
> > </http>
> >
> > But actually your service is returning something like this:
> >
> > <http>
> >   <soap:return>
> >     &lt;soap:fault/gt&;
> >   </soap:return>
> > </http>
> >
> > The SOAP Fault is actually "masked" inside a normal result. In my
> > opinion you have do make a little change in your WSDL to define the
> > possible returned faults."
> >
> > So my question is:
> >
> > How do I return a soap fault in the way he describes ? Can I define a
> > "fault" out in my dispatch map -> wsdl ?
> >
> > Hopefully you can help me !
> >
> > Chris...
>
> --
> PHP Soap Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux