Re: error in WSIF or WS? or both?

"邹志乐" <[email protected]> Thu, 13 Apr 2006 23:26:09 +0800
Newsgroups gmane.comp.apache.webservices.wsif.user
Message-ID <[email protected]>
The problem is probably like this: you specified the type definition of your
fault part with the "type" attribute, not an "element" attribute. so if you
invoke the part.getElementName() it returns null. It means that
part.getElementName() returns actually the name of an element in the "types"
part in the wsdl document, and the element is used to specify the type of
your fault part. Hope it works:)
Best Regards
robin



2006/4/12, Jackson, Douglas <[email protected]>:
>
>  Hi!
>
> If you use an Element rather than a type it would probably work.  The code
> seems to be
>
> erroneous though.
>
>
>
> <element name=" PMServiceException" type=" PMServiceExceptionType"/>
>
> <complexType name="PMServiceExceptionType">
>
>   <sequence>
>
>   <element name="errorID" nillable="true" type="soapenc:string" />
>
>   <element name="message" nillable="true" type="soapenc:string" />
>
>   </sequence>
>
> </complexType>
>
> …
>
> <wsdl:message name="PMServiceException">
>
>   <wsdl:part name="fault" element="tns1:PMServiceException" />
>
> </wsdl:message>
>
>
>
> -Doug.
>
>
>  ------------------------------
>
> *From:* Ly, An V [mailto:[email protected]]
> *Sent:* Tuesday, April 11, 2006 3:09 PM
> *To:* [email protected]
> *Subject:* error in WSIF or WS? or both?
>
>
>
> Hi,
>
>
>
> I'm getting a NullPointerException during an exceptional condition when I
> try to invoke an Axis service.
>
>
>
> The error points to the line marked below with >>>>, in
> WSIFOperation_ApacheAxis.java:
>
>
>
>                 Map faults = portTypeOperation.getFaults();
>
>                 Iterator iter = faults.values().iterator();
>
>                 while(iter.hasNext())
>
>                 {
>
>                     javax.wsdl.Fault opFault = (javax.wsdl.Fault
> )iter.next();
>
>                     // Assuming that there is only one part, fetch it.
>
>                     javax.wsdl.Message wsdlFaultMsg = opFault.getMessage
> ();
>
>                     Map parts = wsdlFaultMsg.getParts();
>
>                     Part wsdlFaultPart =
> (Part)parts.values().iterator().next();
>
> >>>>            if( wsdlFaultPart.getElementName().equals(faultQName)
> )
>
>                     {
>
>                         faultMsg.setName( wsdlFaultMsg.getQName().getLocalPart()
> );
>
>                         faultMsg.setObjectPart( wsdlFaultPart.getName(),
> faultElement );
>
>                         faultMsg.setMessageDefinition(wsdlFaultMsg);
>
>                         break;
>
>                     }
>
>                 }
>
>
>
> The problem seems to be that the returned element name is null.
>
>
>
> In the debugger, the parts field of the message is a HashMap with a null
> entrySet. So I'm wondering if the iterator should be checked before doing
> anything?
>
>
>
> The fault in question is decribed as follows:
>
>
>
> <complexType name="PMServiceException">
>
>   <sequence>
>
>   <element name="errorID" nillable="true" type="soapenc:string" />
>
>   <element name="message" nillable="true" type="soapenc:string" />
>
>   </sequence>
>
> </complexType>
>
> …
>
> <wsdl:message name="PMServiceException">
>
>   <wsdl:part name="fault" type="tns1:PMServiceException" />
>
> </wsdl:message>
>
>
>
> Did nillable throw something off here in WSIF, the WS or both?
>
>
>
> Any ideas on what could be wrong and how to fix it?
>
>
>
> Thank you for your help!
>
>
>
> An
>
>
>
>
>