Hi all
I'm doing a WebService for returning item prices based on a query of items.
The WebService must conform to a WSDL that has been already been defined.
http://biblstandard.dk/acq/serviceman/pricequery.wsdl
This gives me a dilemma, because NAV generates the WSDL automatically.
I can expose a CodeUnit Function and set a XMLPort as VAR Parameter, this gives me a WSDL that has the right Request structure, but
not exactly like the standard.
The
reply structure is real problem - you can only specify simple types like Text as an return value - not an XML structure as return value of a function.
For your amusement and to clarify, here's examples of the XML Request and Reply
Request:
<PriceQuery>
- <Customer>
<CustomerIDType>AB-123</CustomerIDType>
<CustomerID>ABCD</CustomerID>
</Customer>
- <Material>
<MatIDType>IDx</MatIDType>
<MatID>1234567899</MatID>
</Material>
- <Material>
<MatIDType>IDx</MatIDType>
<MatID>1234567899</MatID>
</Material>
</PriceQuery>
Response:
- <PriceQueryResponse>
- <MaterialPrice>
- <Material>
<MatIDType>IDx</MatIDType>
<MatID>1234567899</MatID>
</Material>
- <Price>
<PriceType>LockedPrice</PriceType>
<Amount>111</Amount>
<Currency>DKK</Currency>
<ValidToDate>01012013</ValidToDate>
</Price>
</MaterialPrice>
</PriceQueryResponse>
Now, should I give up on using XML ports and ignore the WSDL? (and use BigText as parameter for the Webservice CodeUnit function)
And what should I use as a reply value?
Any pointers to what direction to go in, would be appreciated.
Answers
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
The output has a different XML root element, than input.
And and XMLport/XMLdocument can only have one Root.
So Bigtext Input/Output it is...
-
Except I still have the problem of the WSDL not being as the client wants so, I might end up using some ASP.net Proxy, to do that. :roll:
Johannes Sebastian
MB7-840,MB7-841
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
We did run into the same problem, and more, like namespaces, webservices that require different input-output structures (2 xml port var's). And every time we solved a problem a new problem popped up.
Finaly we decided on buiding a WEBService Broker, that solved all the problems, authentication an logging also, and is capable in handling all kind of xslt translations.
The solution is not for free, because the project was build for us by ASP.NET specialists, and we need to get back some money for it.
If anyone is interested, please send a mail.
Benno