Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » BPEL Designer » Creating a new XML node (allowed by schema)
Creating a new XML node (allowed by schema) [message #672222] Fri, 20 May 2011 11:31 Go to next message
Eclipse UserFriend
Originally posted by: Christian Bruckhoff

Hi.

I need your help. I've received this [1] bpel message. Now I need to a
assign a new node, '<qualityRemark>value</qualityRemark>' to this
message. The schema [2, 3, 4] allows this node, but I don't know, how I
have to assign it correctly. If I do it like this [5] then i get a
selection failure.

How I have to assign this correctly?

Regards
Christian

--------------------------------------

[1]:
<message>
<parameters>
<getSensorDataListResponse
xmlns="http://databasewebservice.webservices.pegelsuite.uni_koblenz.de"
xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns2="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:ns3="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:ns4="http://xhydro.org/minimal/2009/09"
xmlns:ns5="http://watergauge.types.webservices.pegelsuite.uni_koblenz.de" xmlns:ns6="http://sensordata.types.webservices.pegelsuite.uni_koblenz.de"
xmlns:ns7="http://databasewebservice.webservices.pegelsuite.uni_koblenz.de"
xmlns:ns8="http://sensordatalist.types.webservices.pegelsuite.uni_koblenz.de">
<sensorDataList
xmlns="http://sensordatalist.types.webservices.pegelsuite.uni_koblenz.de">
<waterGauge
xmlns="http://watergauge.types.webservices.pegelsuite.uni_koblenz.de">
<locationName>MAINZ</locationName>
<ipAddress>localhost</ipAddress>
<getTimeSeriesPath>:9875/getTimeSeries/service
</getTimeSeriesPath>
<sensorCount>4</sensorCount>
<maxSensorDeviation>2.5</maxSensorDeviation>
</waterGauge>
<sensorData
xmlns="http://sensordata.types.webservices.pegelsuite.uni_koblenz.de">
<sensorNumber>1</sensorNumber>
<parameter>W</parameter>
<value>213.0</value>
<unit>cm</unit>
</sensorData>
<sensorData
xmlns="http://sensordata.types.webservices.pegelsuite.uni_koblenz.de">
<sensorNumber>2</sensorNumber>
<parameter>W</parameter>
<value>213.0</value>
<unit>cm</unit>
</sensorData>
</getSensorDataListResponse>
</parameters>
</message>

--------------------------------------

[2]:
<?xml version="1.0" encoding="utf-16"?>
<xsd:schema attributeFormDefault="unqualified"
elementFormDefault="qualified" version="1.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wg="http://watergauge.types.webservices.pegelsuite.uni_koblenz.de"
xmlns:sd="http://sensordata.types.webservices.pegelsuite.uni_koblenz.de"
xmlns="http://sensordatalist.types.webservices.pegelsuite.uni_koblenz.de" targetNamespace="http://sensordatalist.types.webservices.pegelsuite.uni_koblenz.de">

<xsd:import
namespace="http://watergauge.types.webservices.pegelsuite.uni_koblenz.de" schemaLocation="waterGauge.xsd"
/>
<xsd:import
namespace="http://sensordata.types.webservices.pegelsuite.uni_koblenz.de" schemaLocation="sensorData.xsd"
/>

<xsd:element name="sensorDataList" type="sensorDataListType" />

<xsd:complexType name="sensorDataListType">
<xsd:sequence>
<xsd:element ref="wg:waterGauge" />
<xsd:element ref="sd:sensorData" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>

</xsd:schema>

--------------------------------------

[3]:
<?xml version="1.0" encoding="utf-16"?>
<xsd:schema attributeFormDefault="unqualified
elementFormDefault="qualified" version="1.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://watergauge.types.webservices.pegelsuite.uni_koblenz.de"
targetNamespace="http://watergauge.types.webservices.pegelsuite.uni_koblenz.de">

<xsd:element name="waterGauge" type="waterGaugeType" />

<xsd:complexType name="waterGaugeType">
<xsd:sequence>
<xsd:element name="locationNumber" type="xsd:string" />
<xsd:element name="locationName" type="xsd:string" minOccurs="0" />
<xsd:element name="ipAddress" type="xsd:string" minOccurs="0" />
<xsd:element name="getTimeSeriesPath" type="xsd:string" minOccurs="0" />
<xsd:element name="sensorNumber" type="xsd:integer" minOccurs="0" />
<xsd:element name="sensorCount" type="xsd:integer" minOccurs="0" />
<xsd:element name="parameter" type="xsd:string" minOccurs="0" />
<xsd:element name="maxSensorDeviation" type="xsd:double"
minOccurs="0" />
<xsd:element name="qualityRemark" type="xsd:double" minOccurs="0" />
<xsd:element name="from" type="xsd:dateTime" minOccurs="0" />
<xsd:element name="to" type="xsd:dateTime" minOccurs="0" />
<xsd:element name="timeStamp" type="xsd:dateTime" minOccurs="0" />
</xsd:sequence>
</xsd:complexType>

</xsd:schema>

--------------------------------------

[4]:
<?xml version="1.0" encoding="utf-16"?>
<xsd:schema attributeFormDefault="unqualified"
elementFormDefault="qualified" version="1.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://sensordata.types.webservices.pegelsuite.uni_koblenz.de"
targetNamespace="http://sensordata.types.webservices.pegelsuite.uni_koblenz.de">

<xsd:element name="sensorData" type="sensorDataType" />

<xsd:complexType name="sensorDataType">
<xsd:sequence>
<xsd:element name="sensorNumber" type="xsd:integer" />
<xsd:element name="parameter" type="xsd:string" />
<xsd:element name="value" type="xsd:double" />
<xsd:element name="unit" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>

</xsd:schema>

--------------------------------------

[5]:
<bpel:assign validate="no" name="assignStoreQualityRemark">
<bpel:copy>
<bpel:from>
<bpel:literal xml:space="preserve">
<tns:storeQualityRemark
xmlns:sd="http://sensordata.types.webservices.pegelsuite.uni_koblenz.de"
xmlns:sdl="http://sensordatalist.types.webservices.pegelsuite.uni_koblenz.de"
xmlns:tns="http://databasewebservice.webservices.pegelsuite.uni_koblenz.de"
xmlns:wg="http://watergauge.types.webservices.pegelsuite.uni_koblenz.de"
xmlns:xhydro="http://xhydro.org/minimal/2009/09"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<sdl:sensorDataList></sdl:sensorDataList>
</tns:storeQualityRemark>
</bpel:literal>
</bpel:from>
<bpel:to part="parameters" variable="storeQualityRemarkRequest" />
</bpel:copy>
<bpel:copy>
<bpel:from>

<![CDATA[$compareSensorDataRequest.compareSensorDataRequestPart/sdl:sensorDataList]]>
</bpel:from>
<bpel:to>
<![CDATA[$storeQualityRemarkRequest.parameters/sdl:sensorDataList]]>
</bpel:to>
</bpel:copy>
<bpel:copy>
<bpel:from variable="qualityRemark"></bpel:from>
<bpel:to part="parameters" variable="storeQualityRemarkRequest">
<bpel:query
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
<![CDATA[sdl:sensorDataList/wg:waterGauge/wg:qualityRemark]]>
</bpel:query>
</bpel:to>
</bpel:copy>
</bpel:assign>
Re: Creating a new XML node (allowed by schema) [message #675906 is a reply to message #672222] Wed, 01 June 2011 21:40 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Hi Christian,

In general, the structure of your "to" variable must be completely initialized with a literal. I'm not sure what the structure of your storeQualityRemarkRequest variable is, but I'm guessing it's more than just the single <sdl:sensorDataList> element.

HTH
Bob
Re: Creating a new XML node (allowed by schema) [message #675973 is a reply to message #675906] Thu, 02 June 2011 08:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Christian Bruckhoff

Am 01.06.2011 23:40, schrieb Bob Brodt:
> Hi Christian,
>
> In general, the structure of your "to" variable must be completely
> initialized with a literal. I'm not sure what the structure of your
> storeQualityRemarkRequest variable is, but I'm guessing it's more than
> just the single <sdl:sensorDataList> element.
>
> HTH
> Bob

Hi.

You're right! <sdl:sensorDataList> itself contains one <wg:waterGauge>
element and some <sd:sensorData> elements, which also contain some elements.

But how I have to initialize this, if i don't know the exact number of
<sd:sensorData> elements needed?

Regards!
Christian
Re: Creating a new XML node (allowed by schema) [message #676076 is a reply to message #675973] Thu, 02 June 2011 13:52 Go to previous message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

I think you only need to include one complete element for lists (maxoccurs="unbounded"). For "choice" types you only need to include one element from the list of choices. Have you tried using the BPEL Designer's Assign Details property sheet tab to do the initialization for you?
Previous Topic:problems in resolving XSDTypeDefinitionProxy
Next Topic:Eclipse BPEL - Apache ODE - MySql database
Goto Forum:
  


Current Time: Tue Mar 19 05:46:05 GMT 2024

Powered by FUDForum. Page generated in 0.02220 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top