Hi,
you can only insert resource properties, that are defined in the
ResourceProperties document (which is represented by the ResourceProperties
element in the WsResource.wsdl) of the WsResource. In the sample case the
ResourceProperties are:
<xsd:element name="WsResourceProperties">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="wsrf-rl:CurrentTime" />
<xsd:element ref="wsrf-rl:TerminationTime" />
<xsd:element ref="wsrf-rp:QueryExpressionDialect"
minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="tns:MyProperty" minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
If you want to insert a property "Baz", you have to define it in the
WsResourceProperties element, similar to the MyProperty element.
<xsd:element ref="foo:Baz" minOccurs="0" macOccurs="unbounded"/>
The declaration of the "foo:Baz" element could be in an external
schema-file or another schema-section of the wsdl-file with the
targetNamespace "http://www.foo.com".
<xsd:schema
elementFormDefault="qualified"
targetNamespace="http://www.foo.com">
<xsd:element name="Baz" type="xsd:string"/>
</xsd:schema>
When using your own namespaces and prefixes you have to declare them at the
beginning of the wsdl-file like the other namespaces.
e.g.
xmlns:foo="http://www.foo.com"
I think that's it.
Christian
Mittwoch, 7. Februar 2007 13:29
To: <[email protected]>
cc:
From: "Rosberg Mattias" <[EMAIL PROTECTED]>
Subject: WSResourceClient.insertResourceProperty()
I'm using the wsrf sample as template and try to insert a new resource
property.
QName qname = new QName("http://www.foo.com", "baz", "foo");
Object[] values = {5};
client.insertResourceProperty(qname, values);
but I get an error message
<soap:Reason>
<soap:Text>[ID = 'PropertyNotInSchema'] There is no property named
'{http://www.foo.com}baz' defined in the schema. A property should not
have any operations or metadata applied to it if it is not in the WS-RP
document.</soap:Text>
</soap:Reason>
I have put the following in my muse.xml
...
<resource-type>
<context-path>WsResource</context-path>
...
</capability>
<init-param>
<param-name>validate-wsrp-schema</param-name>
<param-value>false</param-value>
</init-param>
</resource-type>
What does the validate-wsrp-schema parameter do? What do I have to do to be
able to add the resource property?
/Mattias
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]