axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anne Thomas Manes <atma...@gmail.com>
Subject Re: Axis client for document/literal or Wrapped service not working when trying to pass complex object as parameter
Date Wed, 22 Feb 2006 12:44:11 GMT
The WSDL you included in your first post does not follow the wrapped
convention. It includes the following message description:

** <http://localhost:8080/lms/services/MemberService?wsdl#><wsdl:messagename
="*registerMemberRequest*">*
*  <wsdl:part element="*tns1:in1*" name="*in0*" />*
*  <wsdl:part element="*tns1:in2*" name="*in1*" />*
*  <wsdl:part element="*tns1:in3*" name="*in2*" />
**  <wsdl:part element="*tns1:in4*" name="*in3*" />*
*</wsdl:message>

You must convert this to:

<wsdl:message name="registerMemberRequest">
    <wsdl:part name="parameters" element="tns1:registerMember"/>
</wsdl:message>

Anne

On 2/22/06, Sreenidhi N K <sreenidhi@aztecsoft.com> wrote:
>
> Thanks Anne for the quick response.
> I had gone through numerous resources on the Internet (including your
> blogs) to learn Axis document/literal and wrapped styles. I deployed the
> service as a wrapped service(WSDL attached below). My operation name is
> 'registerMember' and the tool generated a wrapper complex element with the
> name registerMember.
>  <element name="registerMember">
>     <complexType>
>      <sequence>
>       <element name="in0" type="tns2:MemberVO"/>
>       <element name="in1" type="tns2:AddressVO"/>
>       <element name="in2" type="tns2:AddressVO"/>
>       <element name="in3" type="tns2:ChannelVO"/>
>      </sequence>
>     </complexType>
>    </element>
>
> I generated client side code using WSDL2Java. It provided me with a
> locator class that I used to get hold of the service. Then I called the
> operation from the service method.
> My client code looks like the following
>             MemberVO member=populateMemberVO();
>             AddressVO mailing=populateMailingAddressVO();
>             AddressVO nonMailing=populateNonMailingAddressVO();
>             ChannelVO channel=populateChannelVO();
>
>             MemberServiceServiceLocator locator=new
> MemberServiceServiceLocator();
>             MemberService service= locator.getMemberService();
>             service.registerMember(member,mailing,nonMailing,channel);
>
> This throws the exception
> "org.xml.sax.SAXException: SimpleDeserializer encountered a child element,
> which is NOT expected, in something it was trying to deserialize"
>
> Do I need to do something special with WSDL2Java to let it know that the
> WSDL is that of a "Wrapped" service? From WSDL documentation I see that
>  -W, --noWrapped  --->     turn off support for "wrapped"
> document/literal.
> Since my service is Wrapped I hope I do not need to specify this command
> line switch.
> Please help me identify where I am going wrong
>
> Regards
> Sreenidhi N.K.
>
> -----Original Message-----
> *From:* Anne Thomas Manes [mailto:atmanes@gmail.com]
> *Sent:* Tuesday, February 21, 2006 7:22 PM
> *To:* axis-user@ws.apache.org
> *Subject:* Re: Axis client for document/literal or Wrapped service not
> working when trying to pass complex object as parameter
>
> When using document/literal, your messages may have at most one message
> part. The whole idea behind *document* style is that you are sending a
> *document*, not a set of parameters.
>
> The wrapped style is a WSDL convention that allows you to design a
> document style message, but to produce a Java interface that accepts
> parameters. It requires that you define a "wrapper" element for your
> parameters. Your message part must reference this wrapper element.
>
> See my blog entry on the wrapped style for more information:
> http://atmanes.blogspot.com/2005/03/wrapped-documentliteral-convention.html
>
>
> Anne
>
> On 2/21/06, Sreenidhi N K <sreenidhi@aztecsoft.com> wrote:
>
> > Hi,
> >
> > I have an Axis 1.3  web service with the operation name
> > registerMember(..) that takes four complex objects as parameters. When the
> > service is deployed as RPC style, the client works perfectly. When
> > style/usage is document/literal or wrapped I get the following exception.
> >
> > org.xml.sax.SAXException: SimpleDeserializer encountered a child
> > element, which is NOT expected, in something it was trying to deserialize
> >
> > I have another operation that takes one String parameter & the client is
> > able to call it.
> > Does this means that I can not use document/literal or Wrapped clients
> > passing complex objects using Axis? I generated the client side artifacts
> > using WSDL2JAVA.
> > I came across a blog http://www.jroller.com/page/aananiev?entry=hurdles_with_document_style_web
> >  that says that document/literal does not work with axis.
> > **
> > My WSDL file is attached below.
> >
> >   <?xml version="1.0" encoding="UTF-8" ?>
> >  *-* <http://localhost:8080/lms/services/MemberService?wsdl#> <
> > wsdl:definitions targetNamespace="*
> > http://localhost:8080/lms/services/MemberService*" xmlns:apachesoap="*http://xml.apache.org/xml-soap
> > *" xmlns:impl="* http://localhost:8080/lms/services/MemberService*"xmlns:intf
> > ="* http://localhost:8080/lms/services/MemberService*" xmlns:tns1="*http://webservices.lms.org
> > *" xmlns:tns2="*http://ui.member.core.lms.org *" xmlns:wsdl="*http://schemas.xmlsoap.org/wsdl/
> > *" xmlns:wsdlsoap="* http://schemas.xmlsoap.org/wsdl/soap/*" xmlns:xsd="
> > *http://www.w3.org/2001/XMLSchema *">
> >  *-* <http://localhost:8080/lms/services/MemberService?wsdl#><!--
> >
> > WSDL created by Apache Axis version: 1.3
> > Built on Oct 05, 2005 (05:23:37 EDT)
> >
> > * * -->
> >  *-* <http://localhost:8080/lms/services/MemberService?wsdl#> <
> > wsdl:types>
> >  *-* <http://localhost:8080/lms/services/MemberService?wsdl#> <schemaelementFormDefault
> > ="*qualified *" targetNamespace="*http://webservices.lms.org* " xmlns="*http://www.w3.org/2001/XMLSchema
> > *">
> >  * * <import namespace="* http://ui.member.core.lms.org*" />
> >  * * <element name="*in0*" type="*xsd:int*" />
> >  * * <element name="*in1*" type="*tns2:MemberVO*" />
> >  * * <element name="*in2*" type="*tns2:AddressVO*" />
> >  * * <element name="*in3*" type="*tns2:AddressVO*" />
> >  * * <element name="*in4*" type="*tns2:ChannelVO*" />
> > * * </schema >
> >  *-* <http://localhost:8080/lms/services/MemberService?wsdl#> <schemaelementFormDefault
> > ="*qualified *" targetNamespace="*http://localhost:8080/lms/services/MemberService
> > *" xmlns="*http://www.w3.org/2001/XMLSchema *">
> >  * * <import namespace="* http://ui.member.core.lms.org*" />
> >  * * <element name="*getMemberReturn*" type="*xsd:string*" />
> > * * </schema >
> >  *-* <http://localhost:8080/lms/services/MemberService?wsdl#> <schemaelementFormDefault
> > ="*qualified *" targetNamespace="*http://ui.member.core.lms.org *" xmlns
> > ="*http://www.w3.org/2001/XMLSchema *">
> >  *-* <http://localhost:8080/lms/services/MemberService?wsdl#> <
> > complexType name="*MemberVO* ">
> >  *-* <http://localhost:8080/lms/services/MemberService?wsdl#> <sequence>
> >  * * <element name="*accountNo*" nillable="*true*" type="*xsd:string*"/>
> >  * * <element name="*activeStatus*" nillable="*true*" type="*xsd:string*
> > " />
> >  * * <element name="*actualDob*" nillable="*true*" type="*xsd:string*"/>
> >  * * <element name="*actualDummyValue*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*actualFirstName*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*actualLastName*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*actualPhyCardTypeValue*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*address1*" nillable="*true*" type="*xsd:string*" />
> >  * * <element name="*address2*" nillable="*true*" type="*xsd:string*" />
> >  * * <element name="*altEmail*" nillable="*true*" type="*xsd:string*" />
> >  * * <element name="*anniversaryDate*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*annualIncome*" nillable="*true*" type="*xsd:string*
> > " />
> >  * * <element name="*birthDate*" nillable="*true*" type="*xsd:string*"/>
> >  * * <element name="*cancelFlag*" nillable="*true*" type="*xsd:string*"/>
> >  * * <element name="*cardAccountId*" nillable="*true*" type="*xsd:string
> > *" />
> >  * * <element name="*cardDisableId*" nillable="*true*" type="*xsd:string
> > *" />
> >  * * <element name="*cardDisableRemarks*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*cardDisabledDate*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*cardState*" nillable="*true*" type="*xsd:string*"/>
> >  * * <element name="*cardValidFrom*" nillable="*true*" type="*xsd:string
> > *" />
> >  * * <element name="*cardValidTo*" nillable="*true*" type="*xsd:string*"/>
> >  * * <element name="*checkValue*" nillable="*true*" type="*xsd:string*"/>
> >  * * <element name="*citizenship1*" nillable="*true*" type="*xsd:string*
> > " />
> >  * * <element name="*citizenship2*" nillable="*true*" type="*xsd:string*
> > " />
> >  * * <element name="*city*" nillable="*true*" type="*xsd:string*" />
> >  * * <element name="*creditCardNo*" nillable="*true*" type="*xsd:string*
> > " />
> >  * * <element name="*demographicsUpdatedDate*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*disableFlag*" nillable="*true*" type="*xsd:string*"/>
> >  * * <element name="*disableStatus*" nillable="*true*" type="*xsd:string
> > *" />
> >  * * <element name="*education*" nillable="*true*" type="*xsd:string*"/>
> >  * * <element name="*email*" nillable="*true*" type="*xsd:string*" />
> >  * * <element name="*employmentStatus*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*enrolSource*" nillable="*true*" type="*xsd:string*"/>
> >  * * <element name="*feePaid*" nillable="*true*" type="*xsd:string*" />
> >  * * <element name="*feePaymentDate*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*firstName*" nillable="*true*" type="*xsd:string*"/>
> >  * * <element name="*flagType*" nillable="*true*" type="*xsd:string*" />
> >  * * <element name="*fullName*" nillable="*true*" type="*xsd:string*" />
> >  * * <element name="*gender*" nillable="*true*" type="*xsd:string*" />
> >  * * <element name="*generateCard*" nillable="*true*" type="*xsd:string*
> > " />
> >  * * <element name="*globalParam*" nillable="*true*" type="*xsd:string*"/>
> >  * * <element name="*groupType*" nillable="*true*" type="*xsd:string*"/>
> >  * * <element name="*groupTypeId*" nillable="*true*" type="*xsd:string*"/>
> >  * * <element name="*identificationNumber*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*identificationType*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*isCardCancelled*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*isCardDisabled*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*isCardShred*" nillable="*true*" type="*xsd:string*"/>
> >  * * <element name="*isDeleted*" nillable="*true*" type="*xsd:string*"/>
> >  * * <element name="*isDummyMember*" nillable="*true*" type="*xsd:string
> > *" />
> >  * * <element name="*isMemberDeleted*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*isMemberDisabled*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*isMemberSigned*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*lastName*" nillable="*true*" type="*xsd:string*" />
> >  * * <element name="*loyCardNumber*" nillable="*true*" type="*xsd:string
> > *" />
> >  * * <element name="*loyCardType*" nillable="*true*" type="*xsd:string*"/>
> >  * * <element name="*maritalStatus*" nillable="*true*" type="*xsd:string
> > *" />
> >  * * <element name="*memberCardTypeDesc*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*memberCardTypeId*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*memberClass*" nillable="*true*" type="*xsd:string*"/>
> >  * * <element name="*memberClassId*" nillable="*true*" type="*xsd:string
> > *" />
> >  * * <element name="*memberDeleteRemarks*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*memberDeletedOn*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*memberFeeSlabId*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*memberFeeSlabName*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*memberFeeTypeId*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*memberFeeTypeName*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*memberId*" nillable="*true*" type="*xsd:string*" />
> >  * * <element name="*memberName*" nillable="*true*" type="*xsd:string*"/>
> >  * * <element name="*memberStatus*" nillable="*true*" type="*xsd:string*
> > " />
> >  * * <element name="*middleName*" nillable="*true*" type="*xsd:string*"/>
> >  * * <element name="*mobileNo*" nillable="*true*" type="*xsd:string*" />
> >  * * <element name="*nameDobFlag*" type="*xsd:boolean*" />
> >  * * <element name="*nationality*" nillable="*true*" type="*xsd:string*"/>
> >  * * <element name="*nominee*" nillable="*true*" type="*xsd:string*" />
> >  * * <element name="*nomineeRelation*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*occupationIndustry*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*occupationIndustryId*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*occupationType*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*occupationTypeId*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*pageNo*" nillable="*true*" type="*xsd:string*" />
> >  * * <element name="*pageSize*" nillable="*true*" type="*xsd:string*" />
> >  * * <element name="*parentCardNumber*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*parentMemberId*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*parentName*" nillable="*true*" type="*xsd:string*"/>
> >  * * <element name="*passportNo*" nillable="*true*" type="*xsd:string*"/>
> >  * * <element name="*phoneNo*" nillable="*true*" type="*xsd:string*" />
> >  * * <element name="*phoneZipFlag*" type="*xsd:boolean*" />
> >  * * <element name="*phyCardTypeValue*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*physicalCardType*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*physicalCardTypeId*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*primaryAddon*" nillable="*true*" type="*xsd:string*
> > " />
> >  * * <element name="*promotionalDesc*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*promotionalId*" nillable="*true*" type="*xsd:string
> > *" />
> >  * * <element name="*qualification*" nillable="*true*" type="*xsd:string
> > *" />
> >  * * <element name="*qualificationId*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*referenceCode*" nillable="*true*" type="*xsd:string
> > *" />
> >  * * <element name="*residentialStatus*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*residentialType*" nillable="*true*" type="*
> > xsd:string*" />
> >  * * <element name="*salutation*" nillable="*true*" type="*xsd:string*"/>
> >  * * <element name="*shredStatus*" nillable="*true*" type="*xsd:string*"/>
> >  * * <element name="*shredValue*" nillable="*true*<S
> >
> ...
>
> [Message clipped]

Mime
View raw message