Short version:
With Hotfix 2 installed, generates a WS Encoding Error:
[FaultEvent fault=[RPC Fault faultString="Cannot resolve element
definition for name 'UsernameToken'" faultCode="EncodingError"
faultDetail="null"]
the ws has a simple header:
ws.addSimpleHeader("UsernameToken", "", "username", username);
ws.addSimpleHeader("UsernameToken", "", "password", password);
Anyone with an idea on how to get this to work?
Thanks,
Paul
--- In [email protected], "paulwelling" <[EMAIL PROTECTED]> wrote:
>
> Hello List,
>
> Under 2.0, 2.0.1, and 2.0.1 HF1 my simple header was being Encoded
> correctly:
>
> ws.addSimpleHeader("UsernameToken", "", "username", username);
> ws.addSimpleHeader("UsernameToken", "", "password", password);
>
> creates...
>
> <SOAP-ENV:Header>
> <UsernameToken>
> <username>
> paul
> </username>
> </UsernameToken>
> <UsernameToken>
> <password>
> 123450
> </password>
> </UsernameToken>
> </SOAP-ENV:Header>
>
>
> There was no reference in the WSDL to UsernameToken, and all was good
> and happy and Flex encoded the WS requests...
>
> ---
>
> I needed to move to HF2 to use/test a fix to ArrayCollections.
>
> Now running the same code & WSDL on HF2 I get:
> [FaultEvent fault=[RPC Fault faultString="Cannot resolve element
> definition for name 'UsernameToken'" faultCode="EncodingError"
> faultDetail="null"]
>
> ---
>
> Someone off list was nice enough to suggest that I add the following
> complexType to my WSDL, to aid Flex in the encoding:
>
>
> <wsdl:definitions targetNamespace="http://service.abcd.com">
> <wsdl:types>
> <xsd:schema attributeFormDefault="qualified"
> elementFormDefault="qualified" targetNamespace="http://model.abcd.com">
>
> <xsd:complexType name="UsernameToken">
> <xsd:sequence>
> <xsd:element name="username" maxOccurs="1"
> minOccurs="0" type="xsd:string"/>
> <xsd:element name="password" maxOccurs="1"
> minOccurs="0" type="xsd:string"/>
> </xsd:sequence>
> </xsd:complexType>
>
> ...
>
> And adding the enclosing namespace to the method call:
>
> ws.addSimpleHeader("UsernameToken", "http://model.abcd.com",
> "username", username);
> ws.addSimpleHeader("UsernameToken", "http://model.abcd.com",
> "password", password);
>
>
>
> The only difference that has made was to change the fault message:
> [FaultEvent fault=[RPC Fault faultString="Cannot resolve element
> definition for name 'http://model.abcd.com::UsernameToken'"
> faultCode="EncodingError" faultDetail="null"]
>
>
> ---
>
> I am really stuck. I need the fix to HF2 for ArrayCollections, but
> can't run it because it breaks the WS requests, because they can't get
> Encoded and out on the wire.
>
> Does anyone know how to get Flex to encode this correctly on HF2...?
> Has anyone else run into WS encoding issues on HF2..?
>
> Many thanks,
> Paul
>