ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Interchange Server + Adapters » XML Data Handler /w schemas

Post new topic  Reply to topic
 XML Data Handler /w schemas « View previous topic :: View next topic » 
Author Message
jonkvi
PostPosted: Thu Sep 29, 2005 1:36 am    Post subject: XML Data Handler /w schemas Reply with quote

Newbie

Joined: 28 Sep 2005
Posts: 4
Location: Stockholm

Greetings!
I've found a lot of good questions and even better answers around here, so I hope that there is hope for a ICS newbie such as myself.

Short Q: I'm trying to fetch an XML doc from a WMQ queue, but get a MalformedDataException:Error from the WebSphereMQ Connector. It can't determine the BusinessObject Name from the DOCTYPE in the data stream. However, it's all based on schemas, so DOCTYPEs and DTDs are pretty meningless. What might be wrong?

Longer gabbling: I believe that my ICS (4.3 on Win2000Pro) is a fairly decent and clean install. I've created the BO's from the XSD and added MO_DataHandler_Default and MO_DataHandler_DefaultXMLConfig (added a dummy key attr in the DefaulXMLConfig MO). The MQ connector is set up as default, configured to run on the specific machine with existing MQ q:s, and seems to start up properly.
My guess is that I need to specify somewhere that the incoming ASBO should be determined by a xsd namespace rather than a DTD. But where and how?

Many hopeful thanks /contact admin
Back to top
View user's profile Send private message
Ratan
PostPosted: Thu Sep 29, 2005 12:45 pm    Post subject: Reply with quote

Grand Master

Joined: 18 Jul 2002
Posts: 1245

post the definition of MO_DataHandler_DefaultXMLConfig and MO_DataHandler_Default.
_________________
-Ratan
Back to top
View user's profile Send private message Send e-mail
adriandragos
PostPosted: Thu Sep 29, 2005 2:20 pm    Post subject: Reply with quote

Newbie

Joined: 08 Aug 2005
Posts: 7
Location: Bucharest

Hello,

To determine the name of the Business Object to generate, the data handler uses a name handler specified in the NameHandlerClass attribute of the MO_DataHandler_DefaultXMLConfig Metadata Object.

If your ASBO names are in form <BOPrefix>_<ROOTElementName> you can set the default value of NameHandlerClass attribute to com.crossworlds.DataHandlers.xml.TopElementNameHandler . This name handler is included in XML DataHandler product jar file.

Another choice is to develop your own name handler following the example in the documentation (http://publib.boulder.ibm.com/infocenter/wbihelp/topic/com.ibm.wbia_developer.doc/doc/data_handler/datahand38.htm).
Back to top
View user's profile Send private message
jonkvi
PostPosted: Sun Oct 02, 2005 10:07 pm    Post subject: Reply with quote

Newbie

Joined: 28 Sep 2005
Posts: 4
Location: Stockholm

Thanks Adrian, that solved the problem.
I thought that the TopElementNameHandler was the default, and should be inherited in the settings. At least that is what my documentation says.. How do you find these things out?
_________________
---
contact admin
I don't do Copy'n Paste. My errors are all mine and mine only.
Back to top
View user's profile Send private message
Thripura Sundari
PostPosted: Tue Oct 25, 2005 10:42 pm    Post subject: Reply with quote

Acolyte

Joined: 13 Jun 2005
Posts: 57
Location: Bangalore, India

Hi all,
I need some help regarding structure of string to convert to BO
I have two BOs with the structure as.
1)BO_CruiseSearchRequest.xsd
Code:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<xsd:schema elementFormDefault="qualified" targetNamespace="http://www.ibm.com/websphere/crossworlds/2002/BOSchema/BO_CruiseSearchRequest" xmlns:BO_CruiseSearchRequest_CruiseSearchRequest="http://www.ibm.com/websphere/crossworlds/2002/BOSchema/BO_CruiseSearchRequest_CruiseSearchRequest" xmlns:bx="http://www.ibm.com/websphere/crossworlds/2002/BOSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><xsd:annotation><xsd:documentation>Tue Oct 25 12:34:26 IST 2005</xsd:documentation></xsd:annotation><xsd:import namespace="http://www.ibm.com/websphere/crossworlds/2002/BOSchema/BO_CruiseSearchRequest_CruiseSearchRequest" schemaLocation="BO_CruiseSearchRequest_CruiseSearchRequest.xsd" /><xsd:element name="BO_CruiseSearchRequest"><xsd:annotation><xsd:appinfo><bx:boDefinition version="3.0.0"><bx:appSpecificInfo>elem_fd=qualified;attr_fd=unqualified</bx:appSpecificInfo></bx:boDefinition></xsd:appinfo></xsd:annotation><xsd:complexType><xsd:sequence><xsd:element name="XMLDeclaration" minOccurs="0"><xsd:annotation><xsd:appinfo><bx:boAttribute><bx:appSpecificInfo>type=pi</bx:appSpecificInfo><bx:attributeInfo isForeignKey="false" isKey="true" /></bx:boAttribute></xsd:appinfo></xsd:annotation><xsd:simpleType><xsd:restriction base="xsd:string"><xsd:maxLength value="255" /></xsd:restriction></xsd:simpleType></xsd:element><xsd:element name="ROOT" minOccurs="0"><xsd:annotation><xsd:appinfo><bx:boAttribute><bx:appSpecificInfo>elem_name=CruiseSearchRequest</bx:appSpecificInfo><bx:attributeInfo isForeignKey="false" isKey="false" /><bx:childObjectInfo relationship="Containment" version="3.0.0" /></bx:boAttribute></xsd:appinfo></xsd:annotation><xsd:complexType><xsd:sequence><xsd:element ref="BO_CruiseSearchRequest_CruiseSearchRequest:BO_CruiseSearchRequest_CruiseSearchRequest" /></xsd:sequence></xsd:complexType></xsd:element><xsd:element name="ObjectEventId" type="xsd:string" minOccurs="0" /></xsd:sequence><xsd:attribute name="version" type="xsd:token" default="0.0.0" /><xsd:attribute name="delta" type="xsd:boolean" default="false" /><xsd:attribute name="locale" type="xsd:string" default="" /><xsd:attribute name="verb" use="required"><xsd:simpleType><xsd:restriction base="xsd:NMTOKEN"><xsd:enumeration value="Create" /><xsd:enumeration value="Delete" /><xsd:enumeration value="Retrieve" /><xsd:enumeration value="Update" /></xsd:restriction></xsd:simpleType></xsd:attribute></xsd:complexType></xsd:element></xsd:schema>


and the second one:
BO_CruiseSearchRequest_CruiseSearchRequest.xsd
Code:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<xsd:schema elementFormDefault="qualified" targetNamespace="http://www.ibm.com/websphere/crossworlds/2002/BOSchema/BO_CruiseSearchRequest_CruiseSearchRequest" xmlns:bx="http://www.ibm.com/websphere/crossworlds/2002/BOSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><xsd:annotation><xsd:documentation>Tue Oct 25 12:34:26 IST 2005</xsd:documentation></xsd:annotation><xsd:element name="BO_CruiseSearchRequest_CruiseSearchRequest"><xsd:annotation><xsd:appinfo><bx:boDefinition version="3.0.0"><bx:appSpecificInfo>elem_fd=qualified;attr_fd=unqualified</bx:appSpecificInfo></bx:boDefinition></xsd:appinfo></xsd:annotation><xsd:complexType><xsd:sequence><xsd:element name="verb" minOccurs="1"><xsd:annotation><xsd:appinfo><bx:boAttribute><bx:appSpecificInfo>attr_name=verb;type=attribute</bx:appSpecificInfo><bx:attributeInfo isForeignKey="false" isKey="true" /></bx:boAttribute></xsd:appinfo></xsd:annotation><xsd:simpleType><xsd:restriction base="xsd:string"><xsd:maxLength value="255" /></xsd:restriction></xsd:simpleType></xsd:element><xsd:element name="noNamespaceSchemaLocation" minOccurs="0"><xsd:annotation><xsd:appinfo><bx:boAttribute><bx:appSpecificInfo>attr_name=noNamespaceSchemaLocation;type=xsinoNSlocation</bx:appSpecificInfo><bx:attributeInfo isForeignKey="false" isKey="false" /></bx:boAttribute></xsd:appinfo></xsd:annotation><xsd:simpleType><xsd:restriction base="xsd:string"><xsd:maxLength value="255" /></xsd:restriction></xsd:simpleType></xsd:element><xsd:element name="Header" minOccurs="1"><xsd:annotation><xsd:appinfo><bx:boAttribute><bx:appSpecificInfo>elem_name=Header;type=pcdata</bx:appSpecificInfo><bx:attributeInfo isForeignKey="false" isKey="false" /></bx:boAttribute></xsd:appinfo></xsd:annotation><xsd:simpleType><xsd:restriction base="xsd:string"><xsd:maxLength value="255" /></xsd:restriction></xsd:simpleType></xsd:element><xsd:element name="Departure_Date" minOccurs="1"><xsd:annotation><xsd:appinfo><bx:boAttribute><bx:appSpecificInfo>elem_name=Departure_Date;type=pcdata</bx:appSpecificInfo><bx:attributeInfo isForeignKey="false" isKey="false" /></bx:boAttribute></xsd:appinfo></xsd:annotation><xsd:simpleType><xsd:restriction base="xsd:string"><xsd:maxLength value="255" /></xsd:restriction></xsd:simpleType></xsd:element><xsd:element name="Cruise_Length" minOccurs="1"><xsd:annotation><xsd:appinfo><bx:boAttribute><bx:appSpecificInfo>elem_name=Cruise_Length;type=pcdata</bx:appSpecificInfo><bx:attributeInfo isForeignKey="false" isKey="false" /></bx:boAttribute></xsd:appinfo></xsd:annotation><xsd:simpleType><xsd:restriction base="xsd:string"><xsd:maxLength value="255" /></xsd:restriction></xsd:simpleType></xsd:element><xsd:element name="Geographic_Area_Code" minOccurs="0"><xsd:annotation><xsd:appinfo><bx:boAttribute><bx:appSpecificInfo>elem_name=Geographic_Area_Code;type=pcdata</bx:appSpecificInfo><bx:attributeInfo isForeignKey="false" isKey="false" /></bx:boAttribute></xsd:appinfo></xsd:annotation><xsd:simpleType><xsd:restriction base="xsd:string"><xsd:maxLength value="255" /></xsd:restriction></xsd:simpleType></xsd:element><xsd:element name="ObjectEventId" type="xsd:string" minOccurs="0" /></xsd:sequence><xsd:attribute name="version" type="xsd:token" default="0.0.0" /><xsd:attribute name="delta" type="xsd:boolean" default="false" /><xsd:attribute name="locale" type="xsd:string" default="" /><xsd:attribute name="verb" use="required"><xsd:simpleType><xsd:restriction base="xsd:NMTOKEN"><xsd:enumeration value="Create" /><xsd:enumeration value="Delete" /><xsd:enumeration value="Retrieve" /><xsd:enumeration value="Update" /></xsd:restriction></xsd:simpleType></xsd:attribute></xsd:complexType></xsd:element></xsd:schema>


I tried giving the following as the string to be converted into BO
Code:
String sRequest="<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+
"<!DOCTYPE ns1:BO_CruiseSearchRequest_CruiseSearchRequest SYSTEM \"C:/Documents and Settings/111872/Desktop/BO_CruiseSearchRequest_CruiseSearchRequestDTD.dtd\">"+
"<ns1:BO_CruiseSearchRequest_CruiseSearchRequest version=\"0.0.0\" delta=\"false\" locale=\"String\" verb=\"Create\" xmlns:bx=\"http://www.ibm.com/websphere/crossworlds/2002/BOSchema\" xmlns:ns1=\"http://www.ibm.com/websphere/crossworlds/2002/BOSchema/BO_CruiseSearchRequest_CruiseSearchRequest\">"+
"   <ns1:verb>Create</ns1:verb>"+
"   <ns1:noNamespaceSchemaLocation>Text</ns1:noNamespaceSchemaLocation>"+
"   <ns1:Header>Text</ns1:Header>"+
"   <ns1:Departure_Date>12072006</ns1:Departure_Date>"+
"   <ns1:Cruise_Length>010</ns1:Cruise_Length>"+
"   <ns1:Geographic_Area_Code>CAS</ns1:Geographic_Area_Code>"+
"   <ns1:ObjectEventId></ns1:ObjectEventId>"+
"</ns1:BO_CruiseSearchRequest_CruiseSearchRequest>";


I am getting the MalformedDataException saying cannot determine BO Name from DOCTYPE of the Input DataStream.
I have provided the
Quote:
com.crossworlds.DataHandlers.xml.TopElementNameHandler
class to NameHandlerClass class, in the MO_DataHandler_DefaultXMLConfig object. I am using Server Access Interfaces, and the exception comes when I give Datahandlerobj.getBOName(String sRequest).
Request your guidance.
Regards,
Thripura Sundari.
Back to top
View user's profile Send private message
jonkvi
PostPosted: Tue Oct 25, 2005 11:10 pm    Post subject: Reply with quote

Newbie

Joined: 28 Sep 2005
Posts: 4
Location: Stockholm

Thripura Sundari,
I had similar problems trying to get our solution to work. It seems like you have to enforce some brute change in the connector and redeploy it to the server for the change to pick up. Open the connector, unclick and reclick any chechbox to make a change, save and redeploy. Restart the adapter. Try again.
Regards,
contact admin
_________________
---
contact admin
I don't do Copy'n Paste. My errors are all mine and mine only.
Back to top
View user's profile Send private message
Thripura Sundari
PostPosted: Wed Oct 26, 2005 3:10 am    Post subject: Reply with quote

Acolyte

Joined: 13 Jun 2005
Posts: 57
Location: Bangalore, India

Hi contact admin,
Thanks for the response.
But I am using Server Access Interfaces and not Connector. I even tried redeploying and restarting the server, but it didnt work
Regards
Thripura Sundari.
Back to top
View user's profile Send private message
adriandragos
PostPosted: Wed Oct 26, 2005 9:55 am    Post subject: Reply with quote

Newbie

Joined: 08 Aug 2005
Posts: 7
Location: Bucharest

hello,

If you use Server Access Interface, the top-level data-handler meta-object is MO_Server_DataHandler and this object must contain an attribute named text.xml of type MO_DataHandler_DefaultXMLConfig.

The attribute name must be the same with the mime type used when making the call for IcreateBusinessObjectFrom() or IexecuteCollaborationExtFmt() and his type can be any BO definition that respects the requirements for the XML data handler. In this case, the name of the MO used for configuring the data handler is determined by mime type.

If this does not solve your problem, can you post the relevant fragment from the trace file or give more details about the calls you make?

Regards,
Adrian
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Interchange Server + Adapters » XML Data Handler /w schemas
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.