1

here's a problem I just stumbled into:

I have an php based web service which returns statistical data about customers in the form of WSDL-complex types. The actual complex type consists of

xsd:string
xsd:int
xsd:float

Now, since my web service is sort of an adapter to an existing system I can't realy controll what values are packed into that complex type. I.e. it can - and does - happen that fields defined as xsd:float are simply set to '' by the php application.

This is no problem as long as a php based system consumes the service, but of course typed frameworks - like .NET - choke on casting '' to float and throw nasty exceptions.

Since I can't controll what values reliably what goed into my complex types I'm looking for another way of handling invalid data in my web service.

Did anyone run into this too? I'd appreciate and thoughts and ideas; thanks in advance!

K

1 Answer 1

2

Why don't you use type casting?

xsd:<?=(string) $string?>
xsd:<?=(int) $int?>
xsd:<?=(float) $float?>

This would put things exactly like you want them, or have I misinterpreted the question?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.