Describing algorithms (xml)
Heya guys (and girls :p),
I need some help here. I am about to start a new project and I'm kinda at a loss on what to do.
The idea is to create a site where I can fill in a questionair (a webforms thus). The forms are created by using different kind of XML files. One kind of XML file describes the form fields (the questions), another describes the algorithms behind the questions. With the algorithms I should be able to process the answers on my questions and do statistical calculations.
The creation of forms doesn't really look like it's going to be a problem, but the algorithms are... How can I solve the issue on having an XML file describing things like 'if x>100 && z <= y do this...' and making the link to Java alike code. I don't really fancy writing an analyzer from scratch (although if it needs to be done so shall it be :p). Are there any description languages available who can solve this prob? Java classes? At the moment I'm thinking of using the Struts framework with XForms, Jakatra BCEL (code generator), some database stuff and probably some Beans along the path. Any input/ suggestions /technologies would put yall on my hall of fame :p
Thnx in advance
Jurgen
The following Business Rule Solution uses POJO's and XML and meets the following criteria!
Business Rule Solutions should be:
Non-Industry Specific
Appropriate and Affordable for any size business
Enterprise-class solution (scalable, optimized, extensible)
Remember: All businesses have business rules, and all businesses need an efficient way of managing and executing these business rules.
What Business Rule Solutions should provide:
Input Validation & Data Integrity
Integration & Data Transformation
Analytics
Interpret clients Business Policies & Behaviors and clients run-time
data and execute the appropriate process related workflow efficiently.
The Return on Investment:
ROI continues every day, week, month and year into the future!
Simplify all program development through component reuse.
Lowers software maintenance by a magnitude.
Manages & Protects a company assets (Business Rules) in one
repository.
Provide Business Agility and Competitive Advantage!
Further, I believe Business Rule Solutions are a higher level of abstraction of services that all other applications should use to implement the Model-View-Controller design pattern!
Run the Demo!
Use the Contact Us! page for quicker responses. http://www.agilebusinessrulecomponents.com
Similar Messages
-
Describing algorithms (xml/ struts / xforms ?)
Heya guys (and girls :p),
I need some help here. I am about to start a new project and I'm kinda at a loss on what to do.
The idea is to create a site where I can fill in a questionair (a webforms thus). The forms are created by using different kind of XML files. One kind of XML file describes the form fields (the questions), another describes the algorithms behind the questions. With the algorithms I should be able to process the answers on my questions and do statistical calculations.
The creation of forms doesn't really look like it's going to be a problem, but the algorithms are... How can I solve the issue on having an XML file describing things like 'if x>100 && z <= y do this...' and making the link to Java alike code. I don't really fancy writing an analyzer from scratch (although if it needs to be done so shall it be :p). Are there any description languages available who can solve this prob? Java classes? At the moment I'm thinking of using the Struts framework with XForms, Jakatra BCEL (code generator), some database stuff and probably some Beans along the path. Any input/ suggestions /technologies would put yall on my hall of fame :p
Thnx in advance
JurgenCross posting is a b a d n e w s r o u n d t h e s e p a r t s ...
-
Anamitra,
I didn't get a chance to work on this issue.
From my understanding I have quickly created a test wsdl and test xsd.
I don't know whether it will work. I have not tested it. It needs many
corrections.
Take a look at the attached wsdl and xsd and let me know your suggestion.
Scenario:
1. Exposed method:
public String requestPurchaseOrder(String poXML)
2. poXML should be of type po.xsd
3. Validation - ?? No Idea. For now manual validation.
I guess we both have similar requirement, if you get it working before me,
please post your finding.
Thanks,
Karthik.
"Anamitra" <[email protected]> wrote in message
news:[email protected]...
>
Hi karthik
I still dont get how the poXML can be represented by a schema in a WSDL.Can you
give me a sample wsdl for that?
Thanks
Anamitra
"Karthik V" <[email protected]> wrote:
Manoj:
Sorry, I got confused when you said, "the runtime will strip the xml
tags".
After your explanation, I understand that the runtime is actually going
to
perform some conversion without any loss of data.
To conclude, logically,
public void test(String poXML) is valid, and poXML can be represented
by
a schema definition.
When I get a chance, I'm going to create a quick example of this use
case
and post it.
Thanks,
/k
"manoj cheenath" <[email protected]> wrote in message
news:[email protected]...
java.lang.String is mapped to xsd:string which means the xml
should look like:
<foo xsi:type=xsd:string >sometext without any xml tags</foo>
So if there are xml tags inside the string you passed
in, runtime need to replace the tags with > and
<.
On the other end the runtime will again replace
etc back to < or >. So you will get back theright XML. But on the wire it will be plain text
not XML.
So, if you dont want to convert to string, then you should use
javax.xml.soap.SOAPElement or org.w3c.Element as
your parameter type instead of java.lang.String.
http://manojc.com
"Karthik V" <[email protected]> wrote in message
news:[email protected]...
Manoj:
I do not understand how the runtime will strip the xml.
I think Anamitra's requirement of:
public void test(String poXML)
is very valid and a simple requirement.
Infact, my requirement too is similar..
1. Expose a method which takes in a String object.
2. Define how the String is going to look like (using xsd).
3. Instead of defining the schema in WSDL, we would like to import
the
schema and use it.
4. Later use the schema to validate the incoming request.
In real time most of us would like to work with String because ofits
simplicity.
Is there any reason why the implementation for such a simple usecase is
so
confusing?
/k
"manoj cheenath" <[email protected]> wrote in message
news:[email protected]...
public void test( String poXML )
is not the best solution for you, i think, because
in this case the runtime will strip the xml tags
inside poXML. so the envelope will look like:
<m:my-method>
<poXML>sdfjds >some thing < something else...</poXML>
</m:my-method>
instead of:
<m:my-method>
<poXML>some thing <foo> something else</foo></poXML>
</m:my-method>
Will that be ok for you? Else, you can use DOM or
javax.xml.soap.SOAPElement:
public void test( org.w3c.Dom poXML );
It looks like there is bug in WLS 7.0.2. The CR for this
is CR104719. Please contact support if you need a patch.
If you do clientgen on the WSDL, it is going to generate
the classes (value types) for you. It looks like you do not
want to do data binding. Take a look at DII client with generic
type-mapping. Will this help you?
package examples.jaxrpc.call5;
import java.net.URL;
import javax.xml.soap.SOAPConstants;
import javax.xml.rpc.ServiceFactory;
import javax.xml.rpc.Service;
import javax.xml.rpc.Call;
import javax.xml.rpc.ParameterMode;
import javax.xml.namespace.QName;
import javax.xml.rpc.encoding.TypeMapping;
import javax.xml.rpc.encoding.TypeMappingRegistry;
import javax.xml.soap.SOAPElement;
import weblogic.webservice.encoding.GenericTypeMapping;
import weblogic.webservice.core.soap.SOAPElementImpl;
public class MSInterop{
public static void main( String[] args ) throws Exception{
//dont parse wsdl till we set the typemapping
System.setProperty( "weblogic.webservice.servicenamechecking",
"false" );
//create service factory
ServiceFactory factory = ServiceFactory.newInstance();
//define qnames
String targetNamespace = "http://soapinterop.org/";
QName serviceName = new QName( targetNamespace, "SimpleTest"
QName portName = new QName( targetNamespace, "SimpleTestSoap");
QName operationName = new QName( "http://soapinterop.org/",
"echoStruct" );
URL wsdlLocation = new URL(
"http://www.mssoapinterop.org/asmx/simple.asmx?WSDL" );
//create service
Service service = factory.createService( wsdlLocation,serviceName );
TypeMappingRegistry registry =
service.getTypeMappingRegistry();
>>>>>
registry.register( SOAPConstants.URI_NS_SOAP_ENCODING,
new GenericTypeMapping() );
//create call
Call call = service.createCall( portName, operationName );
//construct struct
SOAPElement elem = new SOAPElementImpl( "inputStruct", null,null );
elem.addChildElement( "varInt" ).addTextNode( "1" );
elem.addChildElement( "varString" ).addTextNode( "samplestring" );
elem.addChildElement( "varFloat" ).addTextNode( "2.2" );
System.out.println( elem );
try{
SOAPElement res = (SOAPElement)call.invoke(new Object[]{elem } );
System.out.println( res );
}catch( javax.xml.rpc.JAXRPCException e ){
e.printStackTrace();
e.getLinkedCause().printStackTrace();
Call echoFloat = service.createCall( portName,
new QName( "http://soapinterop.org/", "echoFloat" ) );
System.out.println( echoFloat.invoke( new Object[]{new
Float(100.0)} ) );
http://manojc.com
"Anamitra" <[email protected]> wrote in message
news:[email protected]...
Hi Bruce
I think the wsdl that you sent was very near to what I was
looking
for.
But I
would try to make the requirement more clear: The points below
are
listed
in order
of priority:
1>First and foremost I am looking to create a Webservice such
that
it
exposes
a method which takes in a java.lang.String
public void test(String poXML)
But in the WSDL I want to show the user the schema definition
for
the
po
XML.
And would desire that the Webservices framework do the schema
validation
of the
incoming xml. But I dont thing this works as the wsdl generated
always
says the
type is "xsd:string". So I started looking into the 2nd option:
2>Create a doc/literal type service and expose that method as:
public void test(POXMLBean poXML)
This generated the reqd schema in the wsdl level but the client
is
being
forced
to use the POXMLBean to invoke the method. I would ideally want
the
client
to
just deal with the XML of the pobean as described in the
generated
schema
definition.
For example the client using JAXRPC should be say doing the code
like
this:
String poXML = "<po> <order>000</order> </po>"
call.invoke(poXML").
Is this possible? I am not able to do this. My primary important
thing
is
that
the client has to deal with XML and not with anything else. The
client
shouldnot
have to deal with POXMLBean. This is what I am trying to acheive
and
not
able
to.
3> So that leaves me to the last option which is not that good:
ie I keep my original approach:
public void test(String poXML)
and somehow via wsdl:documentation say that the schema for this
poXML
is
this...
But I cannot change the type in the parameter poXML from
xs:string
right?
Bottom line is there any way for the client to pass string/byte[]
xml
data
to
the webservice - but still be able to look into the WSDL and
see
what
the
reqd
XML structure should be? I thought doc/literal should do it -
but
using
weblogic
I am not able to do it. Can u help me with this pls.
thanks
Anamitra
Bruce Stephens <[email protected]> wrote:
Hello,
See what you think of this example of using import. It seems
to
describe your exact use case:
http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/Retai
l
er.wsdl
(Disclaimer, anyone could have found this via public UDDI.)
The issue I believe that Anamitra sees is the gap between the
runtime
and the toolset.
Bruce
Anamitra wrote:
Hi Karthik
I am a bit confused as to what you mean when u say "import".
The
generated
webservices.xml
contains a <types> and a <type-mapping> element. I suppose
u r
asking
me to put
the xsd definition in the <types> section - right?
If the method is like this:
public String doit(String msg)
How do I attach the <xs:string> type "msg" to the actual
XML
schema
that I just
imported?
I dont know whether I am asking stupid questions or not -
but I
would
have ideall
liked to see my "msg" of type say "PurchaseOrder" which is
the
schema
that I imported.
And the external client should just be able to give the
"PurchaseOrder"
xml to
the Webservice and invoke the "doit" method.
Am I making any sense?
thanks
Anamitra
"Karthik V" <[email protected]> wrote:
I doubt if servicegen has any option for doing it
automatically.
You should manually edit web-services.xml and import thexsd.
/k
"Anamitra" <[email protected]> wrote in message
news:[email protected]...
Hi Karthik/Bruce
Can you pls explain to me how using weblogic tools
[servicegen]
one
can
include
the xsd pointers in the WSDL file.
We have a similar kind of requirement where we have
webservices
which
take
in
string [XML data] as a parameter and the WSDL only shows
method
parameter
types
as xsd:string - but we want to show something like a schema
definition.
So
if
there is anyway to put the schema definition in the WSDL
- pls
let
me know
that
would be very very helpful.
thanks
Anamitra
"Karthik V" <[email protected]> wrote:
Bruce,
Thanks for your response. That helped.
I have another question for you.
I know this would sound strange.
But my requirement is to expose a session bean method
that
could
take
different xml inputs.
For example:
TestBean exposes testMethod(String xmlstr)
xmlstr could be of schema xmlSchema1.xsd
or xmlstr could be of schema xmlSchema2.xsd
In future it could also represent xmlSchema3.xsd... and
so
on.
What is the right approach in this scenario?
I was thinking to create a different web service fordifferent
xsd.
Say, webservice1 imports xmlSchema1.xsd, webservice2
imports
xmlSchema2.xsd...
Un fortunately due to some design restrictions, I cannotcreate
different
methods in my session bean like testMethod1,
testMethod2....
Is there any other better way to do this in one webservice?
>>>>>>>>>>>
Thanks in advance for any suggestions. And excuse myunusual
requirement.
/k
"Bruce Stephens" <[email protected]> wrote in message
news:[email protected]...
Hello,
Personally I like to see everything in one place, i.e.
in
the
WSDL,
however everyone else :-) uses the import. The
SOAPBuilders
round
3
have several tests showing imports. Also WSI Basic
profile
has
some
helpful guidelines on using import:
http://www.ws-i.org/Profiles/Basic/2003-03/BasicProfile-1.0-BdAD.html
>>>>>>>>>>>>
HTHs,
Bruce
Karthik V wrote:
Hi,
I have created few doc style web services, with a
very
complex
xml
input
and
output. (1200 lines of xsd)
Input and out put are xml as java.lang.String.
What would be the best practice to represent this
in the
WSDL?
Just
a
reference to the xsd file is good, or should it be
completely
presented
within the WSDL? I'm not sure how my wsdl should look
like...
I will be using the same schema (xsd) in other web
services
too
to
perform
different functions.
Any suggestions would be greatly appreciated.
Thanks
/k
[testWSDL.wsdl]
[PO.xsd]Hello Karthik/Anamitra,
i have the same requirements in my webservices:
1) Expose the Handler method receiving String
public String runRequest(String poXML)
2) On the other hand - the message (the poXML string) should be in XML format according to some XSD file.
Have you got this working already?
If so, please explain what the WSDL looks like.
Thanks in advance,
Orly -
Hi,
I have created few doc style web services, with a very complex xml input and
output. (1200 lines of xsd)
Input and out put are xml as java.lang.String.
What would be the best practice to represent this in the WSDL? Just a
reference to the xsd file is good, or should it be completely presented
within the WSDL? I'm not sure how my wsdl should look like...
I will be using the same schema (xsd) in other web services too to perform
different functions.
Any suggestions would be greatly appreciated.
Thanks
/kHi karthik
I still dont get how the poXML can be represented by a schema in a WSDL. Can you
give me a sample wsdl for that?
Thanks
Anamitra
"Karthik V" <[email protected]> wrote:
Manoj:
Sorry, I got confused when you said, "the runtime will strip the xml
tags".
After your explanation, I understand that the runtime is actually going
to
perform some conversion without any loss of data.
To conclude, logically,
public void test(String poXML) is valid, and poXML can be represented
by
a schema definition.
When I get a chance, I'm going to create a quick example of this use
case
and post it.
Thanks,
/k
"manoj cheenath" <[email protected]> wrote in message
news:[email protected]...
java.lang.String is mapped to xsd:string which means the xml
should look like:
<foo xsi:type=xsd:string >sometext without any xml tags</foo>
So if there are xml tags inside the string you passed
in, runtime need to replace the tags with > and
<.
On the other end the runtime will again replace
etc back to < or >. So you will get back theright XML. But on the wire it will be plain text
not XML.
So, if you dont want to convert to string, then you should use
javax.xml.soap.SOAPElement or org.w3c.Element as
your parameter type instead of java.lang.String.
http://manojc.com
"Karthik V" <[email protected]> wrote in message
news:[email protected]...
Manoj:
I do not understand how the runtime will strip the xml.
I think Anamitra's requirement of:
public void test(String poXML)
is very valid and a simple requirement.
Infact, my requirement too is similar..
1. Expose a method which takes in a String object.
2. Define how the String is going to look like (using xsd).
3. Instead of defining the schema in WSDL, we would like to import
the
schema and use it.
4. Later use the schema to validate the incoming request.
In real time most of us would like to work with String because ofits
simplicity.
Is there any reason why the implementation for such a simple usecase is
so
confusing?
/k
"manoj cheenath" <[email protected]> wrote in message
news:[email protected]...
public void test( String poXML )
is not the best solution for you, i think, because
in this case the runtime will strip the xml tags
inside poXML. so the envelope will look like:
<m:my-method>
<poXML>sdfjds >some thing < something else...</poXML>
</m:my-method>
instead of:
<m:my-method>
<poXML>some thing <foo> something else</foo></poXML>
</m:my-method>
Will that be ok for you? Else, you can use DOM or
javax.xml.soap.SOAPElement:
public void test( org.w3c.Dom poXML );
It looks like there is bug in WLS 7.0.2. The CR for this
is CR104719. Please contact support if you need a patch.
If you do clientgen on the WSDL, it is going to generate
the classes (value types) for you. It looks like you do not
want to do data binding. Take a look at DII client with generic
type-mapping. Will this help you?
package examples.jaxrpc.call5;
import java.net.URL;
import javax.xml.soap.SOAPConstants;
import javax.xml.rpc.ServiceFactory;
import javax.xml.rpc.Service;
import javax.xml.rpc.Call;
import javax.xml.rpc.ParameterMode;
import javax.xml.namespace.QName;
import javax.xml.rpc.encoding.TypeMapping;
import javax.xml.rpc.encoding.TypeMappingRegistry;
import javax.xml.soap.SOAPElement;
import weblogic.webservice.encoding.GenericTypeMapping;
import weblogic.webservice.core.soap.SOAPElementImpl;
public class MSInterop{
public static void main( String[] args ) throws Exception{
//dont parse wsdl till we set the typemapping
System.setProperty( "weblogic.webservice.servicenamechecking",
"false" );
//create service factory
ServiceFactory factory = ServiceFactory.newInstance();
//define qnames
String targetNamespace = "http://soapinterop.org/";
QName serviceName = new QName( targetNamespace, "SimpleTest"
QName portName = new QName( targetNamespace, "SimpleTestSoap");
QName operationName = new QName( "http://soapinterop.org/",
"echoStruct" );
URL wsdlLocation = new URL(
"http://www.mssoapinterop.org/asmx/simple.asmx?WSDL" );
//create service
Service service = factory.createService( wsdlLocation,serviceName );
TypeMappingRegistry registry = service.getTypeMappingRegistry();
registry.register( SOAPConstants.URI_NS_SOAP_ENCODING,
new GenericTypeMapping() );
//create call
Call call = service.createCall( portName, operationName );
//construct struct
SOAPElement elem = new SOAPElementImpl( "inputStruct", null,
null );
elem.addChildElement( "varInt" ).addTextNode( "1" );
elem.addChildElement( "varString" ).addTextNode( "samplestring" );
elem.addChildElement( "varFloat" ).addTextNode( "2.2" );
System.out.println( elem );
try{
SOAPElement res = (SOAPElement)call.invoke(new Object[]{elem } );
System.out.println( res );
}catch( javax.xml.rpc.JAXRPCException e ){
e.printStackTrace();
e.getLinkedCause().printStackTrace();
Call echoFloat = service.createCall( portName,
new QName( "http://soapinterop.org/", "echoFloat" ) );
System.out.println( echoFloat.invoke( new Object[]{new
Float(100.0)} ) );
http://manojc.com
"Anamitra" <[email protected]> wrote in message
news:[email protected]...
Hi Bruce
I think the wsdl that you sent was very near to what I was looking
for.
But I
would try to make the requirement more clear: The points below
are
listed
in order
of priority:
1>First and foremost I am looking to create a Webservice such
that
it
exposes
a method which takes in a java.lang.String
public void test(String poXML)
But in the WSDL I want to show the user the schema definition
for
the
po
XML.
And would desire that the Webservices framework do the schema
validation
of the
incoming xml. But I dont thing this works as the wsdl generated
always
says the
type is "xsd:string". So I started looking into the 2nd option:
2>Create a doc/literal type service and expose that method as:
public void test(POXMLBean poXML)
This generated the reqd schema in the wsdl level but the client
is
being
forced
to use the POXMLBean to invoke the method. I would ideally want
the
client
to
just deal with the XML of the pobean as described in the generated
schema
definition.
For example the client using JAXRPC should be say doing the code
like
this:
String poXML = "<po> <order>000</order> </po>"
call.invoke(poXML").
Is this possible? I am not able to do this. My primary important
thing
is
that
the client has to deal with XML and not with anything else. The
client
shouldnot
have to deal with POXMLBean. This is what I am trying to acheive
and
not
able
to.
3> So that leaves me to the last option which is not that good:
ie I keep my original approach:
public void test(String poXML)
and somehow via wsdl:documentation say that the schema for this
poXML
is
this...
But I cannot change the type in the parameter poXML from xs:string
right?
Bottom line is there any way for the client to pass string/byte[]
xml
data
to
the webservice - but still be able to look into the WSDL and
see
what
the
reqd
XML structure should be? I thought doc/literal should do it -
but
using
weblogic
I am not able to do it. Can u help me with this pls.
thanks
Anamitra
Bruce Stephens <[email protected]> wrote:
Hello,
See what you think of this example of using import. It seems
to
describe your exact use case:
http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/Retail
er.wsdl
(Disclaimer, anyone could have found this via public UDDI.)
The issue I believe that Anamitra sees is the gap between the
runtime
and the toolset.
Bruce
Anamitra wrote:
Hi Karthik
I am a bit confused as to what you mean when u say "import".
The
generated
webservices.xml
contains a <types> and a <type-mapping> element. I suppose
u r
asking
me to put
the xsd definition in the <types> section - right?
If the method is like this:
public String doit(String msg)
How do I attach the <xs:string> type "msg" to the actual
XML
schema
that I just
imported?
I dont know whether I am asking stupid questions or not -
but I
would
have ideall
liked to see my "msg" of type say "PurchaseOrder" which is
the
schema
that I imported.
And the external client should just be able to give the
"PurchaseOrder"
xml to
the Webservice and invoke the "doit" method.
Am I making any sense?
thanks
Anamitra
"Karthik V" <[email protected]> wrote:
I doubt if servicegen has any option for doing it automatically.
You should manually edit web-services.xml and import the
xsd.
/k
"Anamitra" <[email protected]> wrote in message
news:[email protected]...
Hi Karthik/Bruce
Can you pls explain to me how using weblogic tools
[servicegen]
one
can
include
the xsd pointers in the WSDL file.
We have a similar kind of requirement where we have
webservices
which
take
in
string [XML data] as a parameter and the WSDL only shows
method
parameter
types
as xsd:string - but we want to show something like a schema
definition.
So
if
there is anyway to put the schema definition in the WSDL
- pls
let
me know
that
would be very very helpful.
thanks
Anamitra
"Karthik V" <[email protected]> wrote:
Bruce,
Thanks for your response. That helped.
I have another question for you.
I know this would sound strange.
But my requirement is to expose a session bean method
that
could
take
different xml inputs.
For example:
TestBean exposes testMethod(String xmlstr)
xmlstr could be of schema xmlSchema1.xsd
or xmlstr could be of schema xmlSchema2.xsd
In future it could also represent xmlSchema3.xsd... and
so
on.
What is the right approach in this scenario?
I was thinking to create a different web service fordifferent
xsd.
Say, webservice1 imports xmlSchema1.xsd, webservice2 imports
xmlSchema2.xsd...
Un fortunately due to some design restrictions, I cannot
create
different
methods in my session bean like testMethod1, testMethod2....
Is there any other better way to do this in one web service?
Thanks in advance for any suggestions. And excuse my unusual
requirement.
/k
"Bruce Stephens" <[email protected]> wrote in message
news:[email protected]...
Hello,
Personally I like to see everything in one place, i.e.
in
the
WSDL,
however everyone else :-) uses the import. The
SOAPBuilders
round
3
have several tests showing imports. Also WSI Basic
profile
has
some
helpful guidelines on using import:
http://www.ws-i.org/Profiles/Basic/2003-03/BasicProfile-1.0-BdAD.html
HTHs,
Bruce
Karthik V wrote:
Hi,
I have created few doc style web services, with a
very
complex
xml
input
and
output. (1200 lines of xsd)
Input and out put are xml as java.lang.String.
What would be the best practice to represent this
in the
WSDL?
Just
a
reference to the xsd file is good, or should it be
completely
presented
within the WSDL? I'm not sure how my wsdl should look
like...
I will be using the same schema (xsd) in other web
services
too
to
perform
different functions.
Any suggestions would be greatly appreciated.
Thanks
/k -
How to describe algorithms in business with UML
Hi,
I need to describe business requirement of a small billing system with UML, however, there is a lot of algorithms in the business requirement, I don't know I should use which diagrams to describe these algorithm. Is there anyone can help me?
Thanks
chengbalgorithms are most of the time modeled best in
activity diagrams (very similiar to flowchart)
state diagrams can be helpfull as well.
regards
Spieler -
What is the simplest way to get a xml-file from 10g R2 -database ?
Hi,
I'm new in xml, there are so many tools to work with xml:
what is the simplest way to get a xml-file from 10g R2 -database ?
I have : 10g R2 and a xsd.file to describe the xml-structure
thank you
NorbertThere is no automatic way to generate XML documents from an arbitary set of relational tables using the information contained in an XML Schema. Typically the easiest way to generate XML from relational data is to use the SQL/XML operators (XMLElement, XMLAGG, XMLAttribtues, XMLForest). There are many examples of using these operators in the forums You can validate the generated XML against the XML Schema by registering the XML Schema with XML DB and then using the XMLType.SchemaValidate() method
-
How to generate an XML file from SSIS (based on an XSD)?
I have an XSD that describes an XML format. I also have a sample XML file as well from the XSD. I am trying to understand SSIS's capability to generate the XML file in an ETL process. I would need to create the XML file based on the XSD that
I have. It is safe to assume that all the data elements are in the DB that I am incorporating in the ETL and it is also safe to assume that the data in the XML may be from multiple different tables (so massaging is probably necessary).
Would this be a job for C#/VB or can I do this through an SSIS process/task? Please help me understand my options. Thanks.Dear All,
Indeed the post by RamJaddu did not answer the question. I am having the same issue: I have been provided an .xsd file which contains a data schema, and I have all of the necessary
data in a .mdf file in order to create the required .xml file. Having queried SQL Server and received my data in "myDataSet" I can use C# to create the .xml ignoring the schema using
string strSchemaFile = @"F:\Documents\UserCost\VictorianDataCollection\VCDCSchema_v2.xsd";
string strXmlFile = "testXmlExport.xml";
myDataSet.WriteXmlSchema(strSchemaFile);
myDataSet.WriteXml(strXmlFile, XmlWriteMode.IgnoreSchema);
but how do I export the .xml file so that is conforms with the .xsd format?
If any of you have worked this out the answer would be most appreciated.
All the best,
Nick
"Everything should be made as simple as possible, but not simpler" - Einstein -
Logon failed when connecting to XML data source over HTTP
I am trying to create a report using the standard report creation wizard:
1) new, standard report
2) create new connection
3) xml and web services
4) xml data source
When using the sample from the SAP site, it works fine:
http://resources.businessobjects.com/support/downloads/samples/cr/customer_db/customer.xml
I have an HTTP source that generates XML. I have a schema that describes this XML. If I save the XML to a local file it works fine as a data source with the schema. However, when I try to access the same data via HTTP, I get the following error:
Logon failed.
Details: Cannot open file
Server returned HTTP response code: 401 for URL: http://localhost:8004/report.xqy?Validate%20XML=0&Use%20WS-Security%20Config%20File=&WS-Security%20File%20Location
However, if I enter that URL in a browser it works fine. And even if I disable security on the HTTP source, it produces the same error.
Does the URL for the HTTP data source have to conform to some specific pattern? For example, must the URL end in .xml?
KellySorry Brian,
This is a public forum, if no one can help you do have the option to purchase a support case:
http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300?resid=-Z5tUwoHAiwAAA8@NLgAAAAS&rests=1254701640551
Thank you
Don -
How to extract the nodes of any given XML document ???
Hello,
Greetings! It is an interesting forum.
A Snippet of XML Schema PurchaseOrder.xsd as given in user guide is as follows
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xdb="http://xmlns.oracle.com/xdb"
version="1.0" xdb:storeVarrayAsTable="true">
<xs:element name="PurchaseOrder" type="PurchaseOrderType"
xdb:defaultTable="PURCHASEORDER"/>
<xs:complexType name="PurchaseOrderType" xdb:SQLType="PURCHASEORDER_T">
<xs:sequence>
<xs:element name="Reference" type="ReferenceType" minOccurs="1"
xdb:SQLName="REFERENCE"/>
<xs:element name="Actions" type="ActionsType" xdb:SQLName="ACTIONS"/>
<xs:element name="Reject" type="RejectionType" minOccurs="0"
xdb:SQLName="REJECTION"/>
<xs:element name="Requestor" type="RequestorType"
xdb:SQLName="REQUESTOR"/>
<xs:element name="User" type="UserType" minOccurs="1"
xdb:SQLName="USERID"/>
<xs:element name="CostCenter" type="CostCenterType"
xdb:SQLName="COST_CENTER"/>
<xs:element name="ShippingInstructions" type="ShippingInstructionsType"
xdb:SQLName="SHIPPING_INSTRUCTIONS"/>
<xs:element name="SpecialInstructions" type="SpecialInstructionsType"
xdb:SQLName="SPECIAL_INSTRUCTIONS"/>
<xs:element name="LineItems" type="LineItemsType"
xdb:SQLName="LINEITEMS"/>
</xs:sequence>
</xs:complexType>
full schema is available in url
http://download-west.oracle.com/docs/cd/B12037_01/appdev.101/b10790/xdb03usg.htm#BABBGIED
The views use XPath expressions and functions such as extractValue() to define the mapping between columns in the view and nodes in the XML document. The following view is created on purchase order schema.
Creating Relational Views On XML Content
CREATE OR REPLACE view PURCHASEORDER_MASTER_VIEW
(REFERENCE, REQUESTOR, USERID, COSTCENTER,
SHIP_TO_NAME,SHIP_TO_ADDRESS, SHIP_TO_PHONE,
INSTRUCTIONS)
AS
SELECT extractValue(value(p),'/PurchaseOrder/Reference'),
extractValue(value(p),'/PurchaseOrder/Requestor'),
extractValue(value(p),'/PurchaseOrder/User'),
extractValue(value(p),'/PurchaseOrder/CostCenter'),
extractValue(value(p),'/PurchaseOrder/ShippingInstructions/name'),
extractValue(value(p),'/PurchaseOrder/ShippingInstructions/address'),
extractValue(value(p),'/PurchaseOrder/ShippingInstructions/telephone'),
extractValue(value(p),'/PurchaseOrder/SpecialInstructions')
FROM PURCHASEORDER p;
When we register XML Schema in Oracle 9i, the schema elements of XML documents are stored as XMLType, that is, stored using object-relational storage techniques.
For a small schema, we could build the above view manually, but for large/nested schema, if we have query to build XML documents node list, it will help us to build Relational Views on XML Content.
How do we extract the nodes of any given XML document through O-R structures or XML DB using XML DB functions?
Any alternate thoughts are welcome.
I appreciate your help.
Regards
RamRam
Once again, I do not think that you can solve the problem you are trying to solve. Fundamentally you need to determine for a given element of a given complex type what are it's child elements. For each of those elements you then need to find out whether or not it in turn has child elements...
Then you have to think about elements defined as ref rather than type, elements that are substituteable, and the rest of possibilities that can be described with XML Schema.
If you can solve that problem you're a better man than I as the saying goes. Anyone rather than give you a fish, I'll show you how to at least put a worm on the hook..
The following query gets the names of the elements inside a each of the global complex types
Good luck, if you come up with a query to do this I'd love to see it...
SQL> column COMPLEX_TYPE format A32
SQL> column ELEMENT format A32
SQL> --
SQL> select extractvalue
2 (
3 value(ct),
4 '/xs:complexType/@name',
5 'xmlns:xs="http://www.w3.org/2001/XMLSchema"'
6 ) COMPLEX_TYPE,
7 extractvalue
8 (
9 value(et),
10 '/xs:element/@name',
11 'xmlns:xs="http://www.w3.org/2001/XMLSchema"'
12 ) ELEMENT
13 from resource_view,
14 table
15 (
16 xmlsequence
17 (
18 extract
19 (
20 res,
21 '/r:Resource/r:Contents/xs:schema/xs:complexType',
22 'xmlns:r="http://xmlns.oracle.com/xdb/XDBResource.xsd"
23 xmlns:xs="http://www.w3.org/2001/XMLSchema"')
24 )
25 ) ct,
26 table
27 (
28 xmlsequence
29 (
30 extract
31 (
32 value(ct),
33 '/xs:complexType/*/xs:element',
34 'xmlns:xs="http://www.w3.org/2001/XMLSchema"'
35 )
36 )
37 ) et
38 where equals_path(res,'/home/SCOTT/poSource/xsd/purchaseOrder.xsd') = 1
39 /
COMPLEX_TYPE ELEMENT
-------------------------------- ------------------------PurchaseOrderType Reference
PurchaseOrderType Actions
PurchaseOrderType Reject
PurchaseOrderType Requestor
PurchaseOrderType User
PurchaseOrderType CostCenter
PurchaseOrderType ShippingInstructions
PurchaseOrderType SpecialInstructions
PurchaseOrderType LineItems
LineItemsType LineItem
LineItemType Description
LineItemType Part
ActionsType Action
RejectionType User
RejectionType Date
RejectionType Comments
ShippingInstructionsType name
ShippingInstructionsType address
ShippingInstructionsType telephone
19 rows selected. -
XML PARASE and insert /update in corresponding tables
Hi,
I have a XML in which master details tables 3 tables.I want to separate element and insert/update in corresponding tables dynamically.
Table invlovled in A,B,C
Thanks
ReenaReena
The easiest way to do this is along the following lines..
(1) register an XML Schema that describes the XML you wish to process with theh database.
(2). create a relational view for the top level elements and for each repeating element (element where maxOccurs > 1 in the XML Schema)
(3) Use 'insert as select' or other SQL type processing to update your relational tables from the contents of the view
It is normally recommended that you add the following annotations to the XML Schema before registering it with the database
(1) At the schema level set xdb:storeVarrayAsTable="true".
(2) At the complexType level set xdb:maintainDOM="fasle".
If you search the forum you will find a lot of examples of creating relational views of XML content stored in the XML database. Typically these examples will include key words like 'create or replace view' and 'table(xmlsequence(extract' or 'xmltable'.
Hope this helps...
-Mark -
"logon failed" error when connecting to XML data source
I have an HTTP source that generates XML. I have a schema that describes this XML. If I save the XML to a local file it works fine as a data source with the schema. However, when I try to access the same data via HTTP, I get the following error:
Logon failed.
Details: Cannot open file
Server returned HTTP response code: 401 for URL: http://localhost:8004/report.xqy?Validate%20XML=0&Use%20WS-Security%20Config%20File=&WS-Security%20File%20Location
However, if I enter that URL in a browser it works fine. And even if I disable security on the HTTP source, it produces the same error.
I have tried a local HTTP source as well as the same source running on Amazon EC2.
Any ideas?Thanks for the help.
I am new to crystal reports, so I do not understand your suggestion. Both of those points look like they are related to Adobe Flash.
I am trying to create a report using the standard report creation wizard:
1) new, standard report
2) create new connection
3) xml and web services
4) xml data source
When using the sample from the SAP site, it works fine:
http://resources.businessobjects.com/support/downloads/samples/cr/customer_db/customer.xml
When connecting to my source from a browser, it works fine. When using my source as a local document instead of over http it works fine. It is only when connecting to my source over http that I get the failed logon error.
Kelly -
Hi,
is there an easy way to create a xml string based on a ddic structure?
Its a nested structure and I want to avoid to create all elements manually.
Perfect way would be that i could fill the structure with data and then transform this into a xml string.
for instance:
ls_test-header-name = 'tester'
ls_test-header-county = 'germany'
ls_test-item-material = '4711'
ls_test-item-pos = '1'
should be transformed to:
<?xml version="1.0"?>
<ls_test>
<header>
<name>tester</name>
<country>germany</country>
</header>
<item>
<material>4711</material>
<pos>1</pos>
</item>
</ls_test>
Thanks,
ChristophHi Christoph,
following link describes the xml transformation suggested above:
http://help.sap.com/saphelp_erp2005vp/helpdata/en/e3/7d4719ca581441b6841f1054ff1326/frameset.htm
and here is a small example
http://help.sap.com/saphelp_erp2005vp/helpdata/en/ae/101640a991c742e10000000a1550b0/frameset.htm
Hope this is helpful.
Regards
Bernd -
Form XML Schema/Documentation
Does anyone know where i might find documentation that describes the XML for a form that is used via LoadBatchActions? I am doing some things that the Screen Painter doesn't support, and wanted to have a reference handy.
THanks.Hello everybody!!!!!!!
i have tried a lot to sort out the problem,but i dont think so that it would be sortout by myself...
so please give me suggestion that how to fix the Error.. please
thanx
Try
Dim m_xmld As XmlDocument
'Dim m_nodelist As XmlNodeList
Dim m_node As XmlNode
m_xmld = New XmlDocument()
'Load the Xml file
m_xmld.Load("D:\Drafts.xml")
For Each m_node In m_xmld
Select Case (m_xmld.NodeType)
Case XmlNodeType.Text
Console.WriteLine(m_xmld.InnerText)
Console.WriteLine("<" + m_xmld.InnerText)
Console.WriteLine(">")
Case XmlNodeType.Text
Console.WriteLine(m_xmld.InnerText)
Case XmlNodeType.EndElement
Console.Write("")
Exit Select
End Select
Next
Catch errorVariable As Exception
'Error trapping
Console.Write(errorVariable.ToString())
End Try
Edited by: Rizzikhan on Mar 29, 2010 9:51 AM -
Create jms queue xml data server
Hi,
What's the difference between jms queue and jms queue xml data servers and how to create jms queue xml data server.
Thanks.Hello,
JMS messages can principally be processed by Oracle Data Integrator in two formats:
- JMS Messages: containers for rows of data, handled through JMS Queue/JMS Topic Technologies. With JMS Queue/JMS Topic technologies, each JMS destination is defined similarly to a flat file datastore. Each message in the destination is a record in the datastore.
- XML Messages: containers for XML files, handled through JMS XML Queue/JMS XML Topic Technologies. With JMS XML Queue/JMS XML Topic technologies, each messages payload contains a complete XML data structure. This structure is mapped into a relational schema (XML Schema) which appears as a model. This use the Oracle DI Driver for XML (see the driver documentation in Oracle DI documentation).
Find below a step by step creation process for such a destination:
1. Data Server
To create a JMS XML Queue data server, you declare a simple JNDI connection. The only JMS XML specific information is added to the URL. This information defines the XML file format.
The JNDI URL should be : <JMS_RESOURCE>?d=<DTD_FILE>&f=<XML_FILE>&s=<SCHEMA>&JMS_DESTINATION=<JMS_DESTINATION_NAME>
- JMS_RESOURCE: JNDI resource corresponding to your JMS queue that will contain the XML payload. You would specify this URL if you were managing normal JMS messages.
- DTD_FILE: path to a DTD file that describes the XML structure. Mandatory if the parameter XML_FILE is omitted.
- XML_FILE: path to the XML file with a structure similar to the expected XML messages. Mandatory if the DTD_FILE parameter is omitted.
- SCHEMA: schema name that will contain the XML structure. This value must match the one set for the physical schema attached to this data server. This parameter is mandatory.
- JMS_DESTINATION_NAME: name of the JMS queue or topic. This parameter is mandatory.
2. Schema
Creation is straightforward: In the Schema (Schema) and Schema (Work Schema), enter the name of the <SCHEMA> defined in the data server JNDI URL.
3. Model
Use standard reverse-engineering. As the Oracle DI Driver for XML is used the XML structure will be reversed as a relational structure.
Regards,
- FX -
Hi,
I've a xml file with our dtd files. Can with this create a wsdl ??? or create a web services on sap developer studio?
thanks in advance,
davidHi David,
first of all, you need a WSDL, as a logical description of the WS you would like to implement a SOAP WS.
The simplest WS of some use would consists of one method (the method) with one parameter (the request) and a result value (the result).
What you have at the moment is: the xml of the request and the response, I hope.
So, how do you get from your request/response XMLs to a WSDL?:
1. Convert your request/response XMLs to a describing DTD/XML Schema. There are tools on the internet, which can do that.
2. Familiarize yourself with the WS echo example from the Axis distribution: Look at the WSDL and try to augment the echo method with your request/response schema types from step 1
This, somehow lengthy procedure should teach you a lot about SOAP Web Services.
N.B. A short cut would be to model your Web Service after the primordial echo WS method, accepting and producing just strings with your XML request/response documents as payload and delegate the XML to java deserialization of the request/response to the WS implementation rasp. the WS client.
Regards
Gregor
Maybe you are looking for
-
TextEdit Save Error Message "you don't have permission..."
TextEdit, in both Mountain Lion and now Mavericks,displays what appears to be a fake "Save "error: "You don't have permission to write to the folder that the file "XXXXX.txt" is in. Your changes will not be saved until the problem is resolved." I hav
-
Hi Gurus, I m working on SRM 7.0, Ehp6, I want to configure MM-SUS scenario. I have activated the Business function LOG_MM_P2PSE_1 and also activated the start event CL_SE_PUR_PO_WF_OUT(Create and Change) for the Workflow WS53800008 in the MM system.
-
Hi There, after knock my powerbook g4 has stopped recognising the battery, why might this be and what might I do?
-
I have a new 30 gig Video iPod 1 week old, and it was working fine. I plugged it in to download some music and the compter did not see it and the screen on the iPod went dark and started to make clicking sounds, like it is spinning up. It will not re
-
Several weeks ago when asked to upgrade I declined because Norton was not compatible. Updated on 19th everything has been working fine, today theme is gone and toolbar is now not compatible. How do I fix this?