You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by mateamargo <ma...@gmail.com> on 2008/10/09 16:18:23 UTC

Null attribute using PHP as a client

The problem is that CXF is lefting the sceneobject's attribute "name" as
null.

I'm using PHP as the client.

In my development environment I have PHP 5.2.4, and 5.2.0 in the staging.

The webservice is not working well on staging because the SOAP messages are
different, but I wonder if they are malformed or CXF is not interpreting it
as it should.

I'm attatching two XML files with the same request, both formed differently.
http://www.nabble.com/file/p19899943/soap-development.xml
soap-development.xml 
http://www.nabble.com/file/p19899943/soap-staging.xml soap-staging.xml 

As you can see, on both files the sceneobject has the name attribute setted
to "avatar".

Any ideas?
-- 
View this message in context: http://www.nabble.com/Null-attribute-using-PHP-as-a-client-tp19899943p19899943.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Null attribute using PHP as a client

Posted by Daniel Kulp <dk...@apache.org>.
I know VERY little about the PHP soap client stuff.    I think there is a way 
to get it to use the WSDL.    If you can, I would definitely do that.   

Looking at:
http://us2.php.net/manual/en/function.soap-soapclient-construct.php

Looks like:
$client = new SoapClient("some.wsdl");
would work.    Point that at the endpoint with the ?wsdl flag and let php get 
the information it needs from there.

Dan


On Thursday 09 October 2008 2:06:00 pm mateamargo wrote:
> dkulp wrote:
> > If using a <jaxws:endpoint> thing, just add:
> >         <jaxws:properties>
> >             <entry key="schema-validation-enabled" value="true" />
> >         </jaxws:properties>
> > as a child element.
>
> I did it and everything exploded :). (in development, which previously
> worked).
> I got this error
>
> > Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element
> > 'arg0'.
>
> Is there anything that supports the soap encoding?



-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Re: Null attribute using PHP as a client

Posted by mateamargo <ma...@gmail.com>.

dkulp wrote:
> 
> If using a <jaxws:endpoint> thing, just add:
>         <jaxws:properties>
>             <entry key="schema-validation-enabled" value="true" />
>         </jaxws:properties>
> as a child element.
> 

I did it and everything exploded :). (in development, which previously
worked).
I got this error



> Unmarshalling Error: cvc-elt.1: Cannot find the declaration of element
> 'arg0'. 
> 

Is there anything that supports the soap encoding?
-- 
View this message in context: http://www.nabble.com/Null-attribute-using-PHP-as-a-client-tp19899943p19904227.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Null attribute using PHP as a client

Posted by Daniel Kulp <dk...@apache.org>.
On Thursday 09 October 2008 1:15:24 pm mateamargo wrote:
> dkulp wrote:
> > My suggestion would be to turn on schema validation on the server side.
> > It
> > should provide you with a nice error message if something isn't expected.
> >
> > That said, I think the development message is completely wrong.   It's
> > using
> > id/ref things which implies soap encoding which jaxb won't handle.
>
> Why is it working if can't handle it?, I though this was something like
> SOAP version mismatching.

JAXB pretty much just ignores anything it doesn't "expect".   Thus, in this 
case, what you would get is a default "room" object (or whatever), but it 
wouldn't have all the fields filled in as would the one the ref points to.

Turning on schema validation would definitely point some of these things out.

> Btw, how do I enable schema validation?

How are you deploying your endpoint?

If using a <jaxws:endpoint> thing, just add:
        <jaxws:properties>
            <entry key="schema-validation-enabled" value="true" />
        </jaxws:properties>
as a child element.

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Re: Null attribute using PHP as a client

Posted by mateamargo <ma...@gmail.com>.

dkulp wrote:
> 
> 
> My suggestion would be to turn on schema validation on the server side.  
> It 
> should provide you with a nice error message if something isn't expected.
> 
> That said, I think the development message is completely wrong.   It's
> using 
> id/ref things which implies soap encoding which jaxb won't handle.   
> 

Why is it working if can't handle it?, I though this was something like SOAP
version mismatching.

Btw, how do I enable schema validation?
-- 
View this message in context: http://www.nabble.com/Null-attribute-using-PHP-as-a-client-tp19899943p19903367.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Null attribute using PHP as a client

Posted by Daniel Kulp <dk...@apache.org>.
My suggestion would be to turn on schema validation on the server side.   It 
should provide you with a nice error message if something isn't expected.

That said, I think the development message is completely wrong.   It's using 
id/ref things which implies soap encoding which jaxb won't handle.   

Dan


On Thursday 09 October 2008 10:18:23 am mateamargo wrote:
> The problem is that CXF is lefting the sceneobject's attribute "name" as
> null.
>
> I'm using PHP as the client.
>
> In my development environment I have PHP 5.2.4, and 5.2.0 in the staging.
>
> The webservice is not working well on staging because the SOAP messages are
> different, but I wonder if they are malformed or CXF is not interpreting it
> as it should.
>
> I'm attatching two XML files with the same request, both formed
> differently. http://www.nabble.com/file/p19899943/soap-development.xml
> soap-development.xml
> http://www.nabble.com/file/p19899943/soap-staging.xml soap-staging.xml
>
> As you can see, on both files the sceneobject has the name attribute setted
> to "avatar".
>
> Any ideas?



-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog