You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by pierre betz <pi...@gmail.com> on 2008/08/13 14:33:29 UTC

problem with the extension / restriction base elements

Ok, I don't really know if the problem is regarding axis2 or not.

I'm using a rpc/literal wsdl.

The send/request part of the web service, using soap, is working well.

The problem is, when I have a look at the response sent by axis2 (1.4), I
can see that some elements have a xsi:type  in the declaration, like :

 <?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
 <soapenv:Body>
  <ns3:SearchVslUserResponse xmlns:ns3="
http://url.com/2008/webservice/2008/User/operations/">

   <UserList xmlns:ns2="http://url.com/2008/schema/2008/UserTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="ns2:UserListType">

    <PagingData>
     <Page xsi:nil="1" />
     <PageSize xsi:nil="1" />
     <NumberOfRecords>1</NumberOfRecords>
    </PagingData>

     <User xsi:type="ns2:UserType">
        <UserId>000774</UserId>
     </User>

   </UserList>
  </ns3:SearchVslUserResponse>
 </soapenv:Body>
</soapenv:Envelope>

As you can see, the UserId have no xsi:type , but the VslUser has .

In fact, I really need to delete the "xsi:type=...."   because the soap
response is retrieved by a php page which create an array using the soap
tags.
I can't modify the php files, and they are looking for a <User> tag, which
here is not present.. because of the "xsi:type=....".

Is there any way to delete the "xsi:type=...." tag ??

the User is defined in a schema by :

<complexType name="UserType">
        <complexContent>
            <extension base="tns:UserBase">
                <sequence>
                    <element name="UserId" type="int"/>
                </sequence>
            </extension>
        </complexContent>
</complexType>


And I can modify the extension  or the way it is created.. because of the
number of similar cases in my files.



Does anyone have an idea of what can I do ?

As I understood, if the element is not a root element (like the UserType
because it extend the UserBase), the soap part will by described with the
xsi:type.


before, with axis 1.4, I did not have this problem, so I think it's because
of axis2 , but don't really know what to do..



Any ideas would be greateful.. :) thanks at least to have read this message
:)

Thanks
Pierre

Re: problem with the extension / restriction base elements

Posted by pierre betz <pi...@gmail.com>.
Ok.. I can't change the php pages, and we just use the result of a soapcall
in php to create the arrays.

So, If I want to correct the problem, I need to use something else thant
extension base=tns:UserBase ?
or there is another possibility ?







2008/8/14 Amila Suriarachchi <am...@gmail.com>

> this is because you have used the tns:UserBase type in the element and you
> actually
> attaching a UserType object at runtime. So you can set UserType in your
> refering element.
>
> But however I think your problem is with parsing the xml with the php
> script.
>
> <User xsi:type="ns2:UserType">
>          <UserId>000774</UserId>
>      </User>
>
> your php script should identify the User Element irrespective whether there
> is xsi:type or not.
>
> thanks,
> Amila.
>
>

Re: problem with the extension / restriction base elements

Posted by Amila Suriarachchi <am...@gmail.com>.
this is because you have used the tns:UserBase type in the element and you
actually
attaching a UserType object at runtime. So you can set UserType in your
refering element.

But however I think your problem is with parsing the xml with the php
script.

<User xsi:type="ns2:UserType">
         <UserId>000774</UserId>
     </User>

your php script should identify the User Element irrespective whether there
is xsi:type or not.

thanks,
Amila.


On Thu, Aug 14, 2008 at 12:13 PM, pierre betz <pi...@gmail.com> wrote:

> still no ideas ? sorry to post again.. but I'm totally blocked now and
> can't go on in my project because of that...
>
>
> Thanks
> Pierre
>
>
>
>
>
>


-- 
Amila Suriarachchi,
WSO2 Inc.

Re: problem with the extension / restriction base elements

Posted by pierre betz <pi...@gmail.com>.
still no ideas ? sorry to post again.. but I'm totally blocked now and can't
go on in my project because of that...


Thanks
Pierre