Hi,
I am new to jibx and I'd appreciate your help guys.
Can someone please post an example of how to map a SOAP message
to Java? (without using jibxsoap since it has not been released yet...)
to Java? (without using jibxsoap since it has not been released yet...)
I want to avoid parsing the SOAP message twice, my goal is to have jibx
do both in one parse:
1) find out which SOAP request it is (login, logout...etc) for the dispatcher.
2) only create the Java object that correspond to the message body content (i.e. if
login then LoginData.class will be initialized, if Logout then LogoutData.class
will be initialized... etc..)
do both in one parse:
1) find out which SOAP request it is (login, logout...etc) for the dispatcher.
2) only create the Java object that correspond to the message body content (i.e. if
login then LoginData.class will be initialized, if Logout then LogoutData.class
will be initialized... etc..)
It would be really useful if there are such mapping example(s) on the website.
As an example:
<SOAP-ENV:Envelope
xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'
SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>
<SOAP-ENV:Header>
<session-id>234234234</session-id>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<xyz:login xmlns="http://tempuri.org">
<xyz:email-id>[EMAIL PROTECTED]</xyz:email-id>
<xyz:password>9999</xyz:password>
</xyz:login>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<SOAP-ENV:Header>
<session-id>234234234</session-id>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<xyz:login xmlns="http://tempuri.org">
<xyz:email-id>[EMAIL PROTECTED]</xyz:email-id>
<xyz:password>9999</xyz:password>
</xyz:login>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
I have been trying:
<binding>
<namespace prefix="SOAP-ENV" uri="http://schemas.xmlsoap.org/soap/envelope/" default="none" />
<namespace prefix="xyz" uri="http://www.op.com/schema/" default="none" />
<mapping name="Envelope" class="SoapRequest">
<value name="Envelope" field="_strEnv"/>
<namespace prefix="SOAP-ENV" uri="http://schemas.xmlsoap.org/soap/envelope/" default="none" />
<namespace prefix="xyz" uri="http://www.op.com/schema/" default="none" />
<mapping name="Envelope" class="SoapRequest">
<value name="Envelope" field="_strEnv"/>
<value name="Header" field="_strHeader"/>
<structure name ="Body">
<structure name ="login">
<value name="email-id" field="_strEmail" />
<value name="password" field="_strPassword" />
</structure>
</structure>
</mapping>
<structure name ="login">
<value name="email-id" field="_strEmail" />
<value name="password" field="_strPassword" />
</structure>
</structure>
</mapping>
</binding>
But I am getting the error:
org.jibx.runtime.JiBXException: No unmarshaller for element "{http://schemas.xmlsoap.org/soap/envelope/}Envelope" (line
2, col 61)
at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(Unknown Source)
at org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(Unknown Source)
at JIBXTest.init(JIBXTest.java:23)
at JIBXTest.main(JIBXTest.java:43)
org.jibx.runtime.JiBXException: No unmarshaller for element "{http://schemas.xmlsoap.org/soap/envelope/}Envelope" (line
2, col 61)
at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(Unknown Source)
at org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(Unknown Source)
at JIBXTest.init(JIBXTest.java:23)
at JIBXTest.main(JIBXTest.java:43)
My questions are:
1) Regardless of the error I am getting, is this even doable?
2) Ideally I'd want to do the validation of the soap against the schema to be done as well in the same parse, too ambitious? (P.S. I am working on an application with 140 TPS, so every ms counts...).
Thanks in advance for your responses,
Andy
Want to be your own boss? Learn how on Yahoo! Small Business.
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users