Skip to Content
0
Former Member
Oct 23, 2006 at 01:45 PM

Mapping-Problem

13 Views

Hi,

I wrote a web service that create a SELECT on a JDBC. My first WSDL allows to ask for 3 different columns. If only one column should be in the WHERE statement, the other two shouldn't appear in the payload. This works.

My second web service is designed like the first one. The problem: I did anywhere a mistake I couldn't found. If I fill all fields that appear in the JDBC key-field it works. If I ask for only one, the following mistake appears:

<b>Cannot produce target element /ns0:MT_Hardware_DB_request/STATEMENT/TABLENAME/key1/type. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target</b>

This happened, because he wants all key fields:

<?xml version="1.0" encoding="UTF-8"?>

<ns1:MT_Hardware_DB_request xmlns:ns1="http://namespace">

<STATEMENT>

<TABLENAME action="SELECT">

<TABLE>dbo.myTable</TABLE>

<access>

<model> </model>

<type> </type>

<manufacturer> </manufacturer>

<class> </class>

<price> </price>

<description> </description>

</access>

<key1>

<model compareOperation="LIKE">%P%</model>

<b><type compareOperation=""/>

<class compareOperation=""/></b>

</key1>

</TABLENAME>

</STATEMENT>

</ns1:MT_Hardware_DB_request>

The bold key types will not be produced if I only fill the model key in my web service. But why it works in my first web service? Also there are only those key fields generated whose have an input in web service.

My Mapping looks like this:

source field -> Java mapping that checks if field is empty -> ifWithoutElse -> target field

The Then-Part is filled with source field, means, target field is only create, when source field has an input.

Any ideas?

thanks