Freeman, thanks for the help , I understand ur point now,
but here i want to pass/forward the same incoming xml message(after substituting xml element) to another servicemix bean configured in an servicemix-eip, not the return message?? worndering how to do this, But using below code , i can convert incoming xml message as string, .................. InOut inOut = (InOut)exchange; NormalizedMessage normalizedMessage = inOut.getInMessage(); SourceTransformer sourceTransformer = new SourceTransformer(); String inMessage = sourceTransformer.contentToString(normalizedMessage); But it's surprised to see that i can't convert same xml message back to the format required by NMR(jbi format) and pass to next bean for further processing, is there any utility class which convert to format required by NMR, regards, Brijesh N K Freeman Fang wrote: > > Well, according to the schema, the outgoing jbi messasge should like > > <?xml version="1.0" encoding="UTF-8"?><jbi:message > xmlns:jbi="http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper" > xmlns:msg="http://ekaplus.com/contract" xmlns:xsd > ="http://www.w3.org/2001/XMLSchema" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > name="createContractResponse" type="msg:createContractResponse" > version="1.0" > > > <jbi:part> > <com:ReturnDocument > xmlns:com="http://www.ekaplus.com/integration/common/document/return"> > <com:ResultType> > yourResultType > </com:ResultType> > <com:Messages> > <com:Description>your description</com:Description> > </com:Messages> > > </com:ReturnDocument> > </jbi:part> > </jbi:message> > > It's just jbi message wrapper and jbi part besides your schema definition. > Freeman > brijesh wrote: >> contract xsd as follows >> >> <?xml version="1.0" encoding="utf-8" ?> >> >> <xs:schema xmlns:dtype="com.ekaplus.v7.cotton.common.datatype" >> xmlns:accr="com.ekaplus.v7.cotton.common.document.accrual" >> xmlns="com.ekaplus.v7.cotton.physical.contract" >> attributeFormDefault="qualified" elementFormDefault="qualified" >> targetNamespace="com.ekaplus.v7.cotton.physical.contract" >> xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="undefined"> >> <xs:import schemaLocation="EkaDocumentCommonV01.xsd" >> namespace="com.ekaplus.v7.cotton.common.document.accrual"/> >> <xs:import schemaLocation="EkaDatatypesV01.xsd" >> namespace="com.ekaplus.v7.cotton.common.datatype"/> >> <xs:element name="Contract"> >> <xs:complexType> >> <xs:sequence> >> <xs:element name="UserContext" type="dtype:UserContext"/> >> <xs:element name="Header" type="dtype:ContractHeader"/> >> <xs:element name="Data"> >> <xs:complexType> >> <xs:sequence> >> <xs:element name="ContractDetails"> >> <!-- Contract details --> >> <xs:complexType> >> <xs:sequence> >> <xs:element minOccurs="1" >> maxOccurs="1" name="ContractIssueDate" type="xs:string"/> >> <!-- Date --> >> <xs:element minOccurs="1" >> maxOccurs="1" name="BookId" type="xs:string"/> >> <!--Portfolio--> >> <!--need to have mapping & >> validation--> >> <xs:element minOccurs="0" >> maxOccurs="1" name="TraderId" type="xs:string"/> >> <!-- need to have mapping & >> validation--> >> <xs:element minOccurs="0" >> maxOccurs="1" name="OurPersonInChargeId" type="xs:string"/> >> <!-- need to have mapping & >> validation--> >> <xs:element minOccurs="1" >> maxOccurs="1" name="CPId" type="xs:string"/> >> <!--VendorCode --> >> <!-- need to have mapping & >> validation--> >> <xs:element minOccurs="0" >> maxOccurs="1" name="CPContractRefNo" type="xs:string"/> >> <xs:element minOccurs="0" >> maxOccurs="1" name="CPPersonInChargeId" type="xs:string"/> >> <!-- need to have mapping & >> validation--> >> <xs:element minOccurs="0" >> maxOccurs="1" name="AgentId" type="xs:string"/> >> <!-- need to have mapping & >> validation--> >> <xs:element minOccurs="0" >> maxOccurs="1" name="AgentRefNo" type="xs:string"/> >> <xs:element minOccurs="0" >> maxOccurs="1" name="AgentPersonInChargeId" type="xs:string"/> >> <!-- need to have mapping & >> validation--> >> <xs:element minOccurs="0" >> maxOccurs="1" name="AgentCommission"> >> <xs:complexType> >> <xs:attribute name="Price" >> type="xs:string"/> >> <xs:attribute >> name="PriceUnitId" type="xs:string"/> >> </xs:complexType> >> </xs:element> >> <xs:element minOccurs="1" >> maxOccurs="1" name="ContractQuantityUnitId" type="xs:string"/> >> <!-- need to have mapping & >> validation--> >> </xs:sequence> >> </xs:complexType> >> </xs:element> >> <xs:element name="ItemDetails"> >> <!-- product details --> >> <xs:complexType> >> <xs:sequence> >> <xs:element maxOccurs="unbounded" >> name="Item"> >> <xs:complexType> >> <xs:sequence> >> <xs:element >> name="ProductDetails"> >> <xs:complexType> >> <xs:sequence> >> <xs:element >> minOccurs="1" maxOccurs="1" default="Cotton" name="ProductId" >> type="xs:string"/> >> <!-- >> default >> Cotton--> >> <!-- need >> to >> have mapping & validation--> >> <xs:element >> minOccurs="1" maxOccurs="1" name="OriginId" type="xs:string"/> >> <!-- >> GrowthCode --> >> <!-- need >> to >> have mapping & validation--> >> <xs:element >> minOccurs="1" maxOccurs="1" name="CropYearId" type="xs:string"/> >> <!-- >> Season--> >> <!-- need >> to >> have mapping & validation--> >> <xs:element >> minOccurs="1" maxOccurs="1" name="QualityId" type="xs:string"/> >> <!-- >> Quality >> description --> >> <!-- need >> to >> have mapping & validation--> >> <xs:element >> minOccurs="0" maxOccurs="1" name="QualityPDScheduleId" type="xs:string"/> >> <!-- need >> to >> have mapping & validation--> >> <xs:element >> minOccurs="0" maxOccurs="1" name="WeightTermsId" type="xs:string"/> >> <!-- need >> to >> have mapping & validation--> >> <xs:element >> minOccurs="0" maxOccurs="1" name="QualityDescription" type="xs:string"/> >> <xs:element >> minOccurs="0" maxOccurs="1" default="Y" name="UseShortDescription" >> type="dtype:EkaBoolean"/> >> </xs:sequence> >> </xs:complexType> >> </xs:element> >> <xs:element >> name="QuantityDetails"> >> <xs:complexType> >> <xs:sequence> >> <xs:element >> minOccurs="0" maxOccurs="1" default="N" name="IsAreaContract" >> type="dtype:EkaBoolean"/> >> <!-- for >> equity contract this value would be yes --> >> <xs:element >> minOccurs="1" maxOccurs="1" name="PackingTypeId" type="xs:string"/> >> <!-- need >> to >> have mapping & validation--> >> <xs:element >> minOccurs="1" maxOccurs="1" name="Area"> >> >> <!--mandatory only if its area contract --> >> >> <xs:complexType> >> >> <xs:sequence> >> >> <xs:element minOccurs="1" maxOccurs="1" name="Yield"> >> >> <!--mandatory only if its area contract --> >> >> <xs:complexType> >> >> >> <xs:attribute name="Quantity" type="xs:string"/> >> >> >> <xs:attribute name="QuantityUnitId" type="xs:string"/> >> >> </xs:complexType> >> >> </xs:element> >> >> <xs:element minOccurs="1" maxOccurs="1" name="Withheld"> >> >> <xs:complexType> >> >> >> <xs:attribute name="Quantity" type="xs:string"/> >> >> >> <xs:attribute name="QuantityUnitId" type="xs:string"/> >> >> </xs:complexType> >> >> </xs:element> >> >> </xs:sequence> >> >> <xs:attribute name="Quantity" type="xs:string"/> >> >> <xs:attribute name="QuantityUnitId" type="xs:string"/> >> >> </xs:complexType> >> >> </xs:element> >> <xs:element >> minOccurs="1" maxOccurs="1" name="ItemQuantity"> >> >> <xs:complexType> >> >> <xs:attribute name="Quantity" type="xs:string"/> >> >> <!-- >> Qty --> >> >> <xs:attribute name="QuantityUnitId" type="xs:string"/> >> >> </xs:complexType> >> >> </xs:element> >> <xs:element >> minOccurs="0" maxOccurs="0" name="Tolerance"> >> >> <xs:complexType> >> >> <xs:attribute name="Lower" type="xs:string"/> >> >> <xs:attribute name="Upper" type="xs:string"/> >> >> <xs:attribute name="typeId" type="xs:string"/> >> >> </xs:complexType> >> >> </xs:element> >> </xs:sequence> >> </xs:complexType> >> </xs:element> >> <xs:element >> name="PriceDetails"> >> <xs:complexType> >> <xs:choice> >> <!-- Based >> on >> 3R EquityFlag price details will vary --> >> <xs:element >> name="Fixed"> >> <!-- >> This >> is for fixed price contract --> >> >> <xs:complexType> >> >> <xs:sequence> >> >> <!-- mandatory and set as USD --> >> >> <xs:element minOccurs="1" maxOccurs="1" name="ContractPrice"> >> >> <!-- mapped from 3R price fixation , calling program need to combine >> price >> fixation to price string --> >> >> <xs:complexType> >> >> >> <xs:attribute name="Price" type="xs:string"/> >> >> >> <xs:attribute name="PriceUnitId" type="xs:string"/> >> >> </xs:complexType> >> >> </xs:element> >> >> </xs:sequence> >> >> </xs:complexType> >> >> </xs:element> >> <xs:element >> name="Equity"> >> <!-- >> This >> element is for Equity contract , if EquityFlag in 3R is on --> >> >> <xs:complexType> >> >> <xs:sequence> >> >> <!-- USD --> >> >> <xs:element minOccurs="1" maxOccurs="1" name="EquityPremium"> >> >> <xs:complexType> >> >> >> <xs:attribute name="Price" type="xs:string"/> >> >> >> <xs:attribute name="PriceUnitId" type="xs:string"/> >> >> </xs:complexType> >> >> </xs:element> >> >> <xs:element minOccurs="1" maxOccurs="1" name="LoanPrice"> >> >> <xs:complexType> >> >> >> <xs:attribute name="Price" type="xs:string"/> >> >> >> <xs:attribute name="PriceUnitId" type="xs:string"/> >> >> </xs:complexType> >> >> </xs:element> >> >> </xs:sequence> >> >> </xs:complexType> >> >> </xs:element> >> <xs:element >> name="OnCallBasisFixed"> >> <!-- >> For >> onCallBasisFixed contract --> >> >> <xs:complexType> >> >> <xs:sequence> >> >> <!-- defaulted to USD --> >> >> <xs:element minOccurs="1" maxOccurs="1" name="FuturesExchangeContractId" >> type="xs:string"/> >> >> <!-- will have mapping & should be validated --> >> >> <xs:element minOccurs="1" maxOccurs="1" name="PriceFixById" >> type="xs:string"/> >> >> <!-- will have mapping & should be validated --> >> >> <xs:element minOccurs="1" maxOccurs="1" name="PriceFixDateRange"> >> >> <!--This field represents the date range within which price is to be >> fixed >> which is a contractual term. If 3R does not capture the same, this will >> be >> defaulted to >> >> >> Contract Issue Date (start date) and earlier of >> delivery period or first notice date of future contract (end date) --> >> >> <xs:complexType> >> >> >> <xs:attribute name="PriceFixDate" type="xs:string"/> >> >> >> <xs:attribute name="DescriptionId" type="xs:string"/> >> >> </xs:complexType> >> >> </xs:element> >> >> <xs:element minOccurs="1" maxOccurs="1" default="Average" >> name="PriceFixMethodId" type="xs:string"/> >> >> <!-- By default Average --> >> >> <xs:element minOccurs="1" maxOccurs="1" name="OnCallToEquity" >> type="dtype:EkaBoolean"/> >> >> <xs:element maxOccurs="unbounded" ref="PriceMonthDetails"/> >> >> </xs:sequence> >> >> </xs:complexType> >> >> </xs:element> >> <xs:element >> name="OnCallBasisUnFixed"> >> >> <xs:complexType> >> >> <xs:sequence> >> >> <!-- defaulted to USD --> >> >> <xs:element minOccurs="1" maxOccurs="1" name="FutureContractId" >> type="xs:string"/> >> >> <!-- will have mapping & should be validated --> >> >> <xs:element minOccurs="1" maxOccurs="1" name="PriceFixById" >> type="xs:string"/> >> >> <!-- will have mapping & should be validated --> >> >> <xs:element minOccurs="1" maxOccurs="1" name="PriceFixDateRange"> >> >> <!--This field represents the date range within which price is to be >> fixed >> which is a contractual term. If 3R does not capture the same, this will >> be >> defaulted to >> >> >> Contract Issue Date (start date) and earlier of >> delivery period or first notice date of future contract (end date), >> caller >> need to format according to eka schema--> >> >> <xs:complexType> >> >> >> <xs:attribute name="PriceFixDate" type="xs:string"/> >> >> >> <xs:attribute name="DescriptionId" type="xs:string"/> >> >> </xs:complexType> >> >> </xs:element> >> >> <xs:element minOccurs="1" maxOccurs="1" default="Average" >> name="PriceFixMethodId" type="xs:string"/> >> >> <!-- By default Average --> >> >> <xs:element minOccurs="0" maxOccurs="1" name="OnCallToEquity" >> type="dtype:EkaBoolean"/> >> >> <xs:element maxOccurs="unbounded" ref="PriceMonthDetails"/> >> >> </xs:sequence> >> >> </xs:complexType> >> >> </xs:element> >> </xs:choice> >> <xs:attribute >> name="PayInCurrencyId" type="xs:string"/> >> </xs:complexType> >> </xs:element> >> <xs:sequence> >> <xs:element >> maxOccurs="1" name="DeliveryDetails"> >> >> <xs:complexType> >> >> <xs:sequence> >> >> <xs:element minOccurs="1" maxOccurs="1" name="Origination"> >> >> <xs:complexType> >> >> <xs:attribute default="USA" name="countryId" type="xs:string"/> >> >> <xs:attribute default="" name="cityId" type="xs:string"/> >> >> </xs:complexType> >> >> </xs:element> >> >> <xs:element minOccurs="1" maxOccurs="1" name="Destination"> >> >> <xs:complexType> >> >> <xs:attribute name="CountryId" type="xs:string"/> >> >> <!-- 3R Destination Country --> >> >> <!-- will have mapping & should be validated --> >> >> <xs:attribute name="CityId" type="xs:string"/> >> >> </xs:complexType> >> >> </xs:element> >> >> <xs:element minOccurs="1" maxOccurs="1" name="WarehouseId" >> type="xs:string"/> >> <!-- >> will >> have mapping & should be validated --> >> >> <xs:element minOccurs="0" maxOccurs="1" default="N" >> name="OptionalDestinationRequired" type="dtype:EkaBoolean"/> >> >> <xs:element maxOccurs="unbounded" name="OptionalDestination"> >> >> <xs:complexType> >> >> <xs:sequence> >> >> <xs:element minOccurs="1" maxOccurs="1" name="Destination"> >> >> >> <xs:complexType> >> >> >> <xs:attribute name="CountryId" type="xs:string"/> >> >> >> <!-- will have mapping & should be validated --> >> >> >> <xs:attribute name="CityId" type="xs:string"/> >> >> >> </xs:complexType> >> >> </xs:element> >> >> <xs:element minOccurs="0" maxOccurs="1" name="WarehouseId" >> type="xs:string"/> >> >> <xs:element minOccurs="1" maxOccurs="1" name="Basis"> >> >> >> <!-- basis + on/Off fields in 3R --> >> >> >> <xs:complexType> >> >> >> <xs:attribute name="Price" type="xs:string"/> >> >> >> <!-- will be + or - based on on/off field in 3R , client need to format >> and >> send to eka --> >> >> >> <!-- will have mapping & should be validated --> >> >> >> <xs:attribute name="PriceUnitId" type="xs:string"/> >> >> >> </xs:complexType> >> >> </xs:element> >> >> </xs:sequence> >> >> </xs:complexType> >> >> </xs:element> >> >> <xs:element minOccurs="1" maxOccurs="unbounded" name="DeliveryPeriod"> >> >> <xs:complexType> >> >> <xs:sequence> >> >> <xs:element minOccurs="1" maxOccurs="1" name="DeliveryPeriodQuantity"> >> >> >> <xs:complexType> >> >> >> <xs:attribute name="Quantity" type="xs:string"/> >> >> >> <!-- Sales contract in 3R will have multiple delivery periods. For each >> contract file there will be a detail file providing details on the >> multiple >> deliveries , calling program will format and send to EKA --> >> >> >> <xs:attribute name="QuantityUnitId" type="xs:string"/> >> >> >> </xs:complexType> >> >> </xs:element> >> >> <xs:element minOccurs="1" maxOccurs="1" name="DeliveryPeriod"> >> >> >> <!-- As mentioned earlier, delivery period will be sent by 3R in detail >> file. Calling program need to modify and format according eka schema >> format >> --> >> >> >> <xs:complexType> >> >> >> <xs:attribute name="Start" type="xs:string"/> >> >> >> <xs:attribute name="End" type="xs:string"/> >> >> >> </xs:complexType> >> >> </xs:element> >> >> </xs:sequence> >> >> </xs:complexType> >> >> </xs:element> >> >> </xs:sequence> >> >> </xs:complexType> >> </xs:element> >> </xs:sequence> >> </xs:sequence> >> <xs:attribute name="ItemNo" >> type="xs:string"/> >> </xs:complexType> >> </xs:element> >> </xs:sequence> >> </xs:complexType> >> </xs:element> >> <xs:element name="TermsandConditions"> >> <xs:complexType> >> <xs:sequence> >> <xs:element minOccurs="1" >> maxOccurs="1" name="INCOTermsId" type="xs:string"/> >> <!-- TermsCode --> >> <!-- need to have mapping & >> validation--> >> <xs:element minOccurs="0" >> maxOccurs="1" name="FreightTermsId" type="xs:string"/> >> <!-- need to have mapping & >> validation--> >> <xs:element minOccurs="1" >> maxOccurs="1" name="PaymentTermsId" type="xs:string"/> >> <!--PaymentType--> >> <!-- need to have mapping & >> validation--> >> <xs:element minOccurs="1" >> maxOccurs="1" name="PaymentDueDate" type="xs:string"/> >> <!-- need to have mapping & >> validation--> >> <xs:element minOccurs="0" >> maxOccurs="1" name="PrePayment"> >> <xs:complexType> >> <xs:attribute >> name="PercentageBy" type="xs:string"/> >> <xs:attribute name="Days" >> type="xs:string"/> >> </xs:complexType> >> </xs:element> >> <xs:element minOccurs="0" >> maxOccurs="1" name="StopLoss" type="xs:string"/> >> <xs:element minOccurs="0" >> maxOccurs="1" name="BankId" type="xs:string"/> >> <!-- need to have mapping & >> validation--> >> <xs:element minOccurs="0" >> maxOccurs="1" name="CarryTerms"> >> <xs:complexType> >> <xs:attribute name="Price" >> type="xs:string"/> >> <xs:attribute >> name="PriceUnitId" type="xs:string"/> >> </xs:complexType> >> </xs:element> >> <xs:element minOccurs="1" >> maxOccurs="1" name="ProvInvPercIfUnpriced" type="xs:string"/> >> <xs:element minOccurs="0" >> maxOccurs="1" name="ProvInvPercIfUnweighted" type="xs:string"/> >> <xs:element minOccurs="0" >> maxOccurs="1" name="InternalComments" type="xs:string"/> >> <xs:element minOccurs="0" >> maxOccurs="1" name="OutputDocumentText" type="xs:string"/> >> <xs:element minOccurs="0" >> maxOccurs="1" name="AdditionalSpecialrequirements" type="xs:string"/> >> </xs:sequence> >> </xs:complexType> >> </xs:element> >> <xs:element minOccurs="0" maxOccurs="1" >> name="ModifyContract" nillable="true"> >> <xs:complexType> >> <xs:sequence> >> <xs:element minOccurs="0" >> name="ModificationDate" type="xs:string"/> >> <xs:element minOccurs="0" >> name="Description" type="xs:string"/> >> </xs:sequence> >> </xs:complexType> >> </xs:element> >> </xs:sequence> >> </xs:complexType> >> </xs:element> >> <xs:element minOccurs="0" name="Accruels" >> type="accr:Accruels"/> >> </xs:sequence> >> </xs:complexType> >> </xs:element> >> <xs:element name="PriceMonthDetails"> >> <xs:complexType> >> <xs:sequence> >> <xs:element minOccurs="1" maxOccurs="1" name="PriceMonthQtyId"> >> <xs:complexType> >> <xs:attribute name="Quantity" type="xs:string"/> >> <xs:attribute name="QuantityUnit" type="xs:string"/> >> </xs:complexType> >> </xs:element> >> <xs:element minOccurs="1" maxOccurs="1" name="PriceMonthId" >> type="xs:string"/> >> <!-- The 3R Month and 3R Year will be combined so as to map to >> the >> Price Month field in Eka --> >> <xs:element name="PriceYearId" type="xs:string"/> >> <xs:element minOccurs="0" maxOccurs="0" name="Basis"> >> <xs:complexType> >> <xs:attribute name="BasisPrice" type="xs:string"/> >> <xs:attribute name="PriceUnitId" type="xs:string"/> >> </xs:complexType> >> </xs:element> >> </xs:sequence> >> </xs:complexType> >> </xs:element> >> </xs:schema> >> >> >> return document xsd as follows >> <?xml version="1.0" encoding="utf-8" ?> >> >> <xs:schema >> xmlns="http://www.ekaplus.com/integration/common/document/return" >> elementFormDefault="qualified" >> targetNamespace="http://www.ekaplus.com/integration/common/document/return" >> xmlns:xs="http://www.w3.org/2001/XMLSchema"> >> <xs:element name="ReturnDocument"> >> <xs:complexType> >> <xs:sequence> >> <xs:element minOccurs="1" maxOccurs="1" name="ResultType" >> type="xs:string"/> >> <xs:element minOccurs="1" name="Messages"> >> <xs:complexType> >> <xs:sequence> >> <xs:element minOccurs="1" maxOccurs="unbounded" >> name="Description" type="xs:string"/> >> </xs:sequence> >> </xs:complexType> >> </xs:element> >> </xs:sequence> >> </xs:complexType> >> </xs:element> >> </xs:schema> >> >> >> >> thanks >> Brijesh N K >> >> >> >> Freeman Fang wrote: >> >>> You also need append contract.xsd and ReturnDocument.xsd. >>> Freeman >>> brijesh wrote: >>> >>>> Freeman, >>>> >>>> the following is incoming message which i am printing out for >>>> debugging >>>> >>>> ## Received exchange with status ACTIVE: InOut[ >>>> id: ID:192.168.2.86-11ea5a60951-7:0 >>>> status: Active >>>> role: provider >>>> service: {http://ekaplus.com/contract}createContractDataMapper >>>> endpoint: endpointDM >>>> in: <?xml version="1.0" encoding="UTF-8"?><jbi:message >>>> xmlns:jbi="http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper" >>>> xmlns:msg="http://ekaplus.com/contract" xmlns:xsd >>>> ="http://www.w3.org/2001/XMLSchema" >>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >>>> name="createContractRequest" type="msg:createContractRequest" >>>> version="1.0" >>>> >>>> >>>>> <jbi:part><com:Contract >>>>> >>>>> >>>> xmlns:com="com.ekaplus.v7.cotton.physical.contract"> >>>> <com:UserContext >>>> xmlns:com="com.ekaplus.v7.cotton.physical.contract"> >>>> <UserName xmlns="">?</UserName> >>>> <CoportateId xmlns="">?</CoportateId> >>>> </com:UserContext> >>>> <com:Header >>>> xmlns:com="com.ekaplus.v7.cotton.physical.contract"> >>>> <ContractNo xmlns="">?</ContractNo> >>>> <Type xmlns="">?</Type> >>>> </com:Header> >>>> <com:Data xmlns:com="com.ekaplus.v7.cotton.physical.contract"> >>>> <com:ContractDetails >>>> xmlns:com="com.ekaplus.v7.cotton.physical.contract"> >>>> <com:ContractIssueDate >>>> xmlns:com="com.ekaplus.v7.cotton.physical.contract">?</com:ContractIssueDate> >>>> <com:BookId >>>> xmlns:com="com.ekaplus.v7.cotton.physical.contract">?</com:BookId> >>>> <!--Optional:--> >>>> <com:TraderId >>>> xmlns:com="com.ekaplus.v7.cotton.physical.contract">?</com:TraderId> >>>> <!--Optional:--> >>>> <com:OurPersonInChargeId >>>> xmlns:com="com.ekaplus.v7.cotton.physical.contract">?</com:OurPersonInChargeId> >>>> <com:CPId xmlns:com="com.ekaplus.v... >>>> ] >>>> >>>> >>>> >>>> and wsdl as follows >>>> >>>> <?xml version="1.0" encoding="UTF-8"?> >>>> <wsdl:definitions xmlns:eka="http://ekaplus.com/contract" >>>> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" >>>> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" >>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema" >>>> name="contract" targetNamespace="http://ekaplus.com/contract" >>>> xmlns:xsd1="com.ekaplus.v7.cotton.physical.contract" >>>> xmlns:xsd2="http://www.ekaplus.com/integration/common/document/return"> >>>> <wsdl:types> >>>> <xsd:schema targetNamespace="http://ekaplus.com/contract"> >>>> <xsd:element name="createContract"> >>>> <xsd:complexType> >>>> <xsd:sequence> >>>> <xsd:element name="in" type="xsd:string"/> >>>> </xsd:sequence> >>>> </xsd:complexType> >>>> </xsd:element> >>>> <xsd:element name="createContractResponse"> >>>> <xsd:complexType> >>>> <xsd:sequence> >>>> <xsd:element name="out" type="xsd:string"/> >>>> </xsd:sequence> >>>> </xsd:complexType> >>>> </xsd:element> >>>> </xsd:schema> >>>> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> >>>> <xsd:import >>>> >>>> namespace="http://www.ekaplus.com/integration/common/document/return" >>>> schemaLocation="ReturnDocument.xsd"> >>>> </xsd:import> >>>> <xsd:import >>>> namespace="com.ekaplus.v7.cotton.physical.contract" >>>> schemaLocation="contract.xsd"> >>>> </xsd:import></xsd:schema></wsdl:types> >>>> <wsdl:message name="createContractRequest"> >>>> <wsdl:part element="xsd1:Contract" name="parameters"/> >>>> </wsdl:message> >>>> <wsdl:message name="createContractResponse"> >>>> <wsdl:part element="xsd2:ReturnDocument" name="parameters"/> >>>> </wsdl:message> >>>> <wsdl:portType name="contract"> >>>> <wsdl:operation name="createContract"> >>>> <wsdl:input message="eka:createContractRequest"/> >>>> <wsdl:output message="eka:createContractResponse"/> >>>> </wsdl:operation> >>>> </wsdl:portType> >>>> <wsdl:binding name="contractSOAP" type="eka:contract"> >>>> <soap:binding style="document" >>>> transport="http://schemas.xmlsoap.org/soap/http"/> >>>> <wsdl:operation name="createContract"> >>>> <soap:operation soapAction="http://ekaplus.com/contract/NewOperation"/> >>>> <wsdl:input> >>>> <soap:body use="literal"/> >>>> </wsdl:input> >>>> <wsdl:output> >>>> <soap:body use="literal"/> >>>> </wsdl:output> >>>> </wsdl:operation> >>>> </wsdl:binding> >>>> <wsdl:service name="createContractService"> >>>> <wsdl:port binding="eka:contractSOAP" name="createContractService"> >>>> <soap:address location="http://localhost:8092/ContractService"/> >>>> </wsdl:port> >>>> </wsdl:service> >>>> </wsdl:definitions> >>>> >>>> >>>> >>>> thanks , >>>> Brijesh N K >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> Freeman Fang wrote: >>>> >>>> >>>>> Hi, >>>>> >>>>> You need know what's the outgoing jbi message looks like based on your >>>>> wsdl and transform your message accordingly. >>>>> In your work flow, I believe you can see the incoming jbi message in >>>>> the log, would you please append it with your wsdl, so that I can tell >>>>> what's the outgoing message should be. >>>>> >>>>> Freeman >>>>> >>>>> >>>>> brijesh wrote: >>>>> >>>>> >>>>>> Freeman, >>>>>> >>>>>> I am getting the mapping data from a db, eg: >>>>>> I have few elements in incoming xml <product_id> prod001</product_id> >>>>>> which >>>>>> I need to replace as >>>>>> <product_id>pr001</product_id> , and this mapping is done in a >>>>>> mapping >>>>>> table. using servicemix-bean i am calling database and replacing the >>>>>> element >>>>>> data and passing it another servicemix-bean which calls an >>>>>> ejbs method. >>>>>> After replacing the xml elements I am sending the content to another >>>>>> bean >>>>>> which is configured through EIP >>>>>> static-routing-slip, >>>>>> >>>>>> code for setting content as follows >>>>>> >>>>>> InOut inOut = (InOut)exchange; >>>>>> NormalizedMessage normalizedMessage = inOut.getInMessage(); >>>>>> //String outMessage = processXml(normalizedMessage); //this method >>>>>> will >>>>>> substitute element from database. >>>>>> String outMessage ="<sample>this is sample xml</sample>"; >>>>>> normalizedMessage.setContent(new StringSource(outMessage)); >>>>>> MessageUtil.transferInToOut(inOut, inOut); >>>>>> channel.send(inOut); >>>>>> >>>>>> Wondering how to i convert it into jbi message so that i will not get >>>>>> the >>>>>> error as i mentioned before >>>>>> >>>>>> >>>>>> thanks for the help >>>>>> >>>>>> Brijesh >>>>>> >>>>>> >>>>>> >>>>>> Freeman Fang wrote: >>>>>> >>>>>> >>>>>> >>>>>>> Hi, >>>>>>> If you just want to replace some content of the incoming message and >>>>>>> return, how about you use servicemix-camel instead of the >>>>>>> servicemix-bean? >>>>>>> There shouldn't be marshalling/unmarshalling for your case IMO, just >>>>>>> replace the message. >>>>>>> You should know the format of incoming and outgoing message. >>>>>>> >>>>>>> And yes, the servicemix-cxf-se will do the marshalling/unmarshalling >>>>>>> for you based on the wsdl model, but it's always used for real >>>>>>> object >>>>>>> invocation, not suitable for your scenario. >>>>>>> >>>>>>> Freeman >>>>>>> >>>>>>> brijesh wrote: >>>>>>> >>>>>>> >>>>>>> >>>>>>>> Freeman, >>>>>>>> >>>>>>>> thanks for the response, >>>>>>>> >>>>>>>> As i mentioned previous post, I am sending back the response from >>>>>>>> my >>>>>>>> servicemix-bean class. Wondering how do I transform according to >>>>>>>> wsdl >>>>>>>> model, >>>>>>>> >>>>>>>> or should i use different jbi component instead of servicemix-bean >>>>>>>> so >>>>>>>> that >>>>>>>> , i can convert easily??? >>>>>>>> I am using bean component to replace incoming data from database. >>>>>>>> for >>>>>>>> marshalling/unmarshalling am using xmlbean . >>>>>>>> >>>>>>>> will it solves if use servicemix-cxf-se instead servicemix-bean to >>>>>>>> do >>>>>>>> the >>>>>>>> transformation according to the wsdl model?? >>>>>>>> >>>>>>>> thanks >>>>>>>> >>>>>>>> Brijesh N K >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> Freeman Fang wrote: >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>>> Hi, >>>>>>>>> There is no simple way to do it, since the soap binding message or >>>>>>>>> jbi >>>>>>>>> binding message are based on the wsdl, you need do the transform >>>>>>>>> according to the wsdl model. >>>>>>>>> Freeman >>>>>>>>> >>>>>>>>> brijesh wrote: >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>>> Hi Freeman, >>>>>>>>>> >>>>>>>>>> thanks for the response >>>>>>>>>> >>>>>>>>>> i need to send a return message as "<sample>this is sample >>>>>>>>>> xml</sample>" >>>>>>>>>> from servicemix-bean to client through servicemix-bc, >>>>>>>>>> >>>>>>>>>> following is code snippet for this >>>>>>>>>> >>>>>>>>>> ....................... >>>>>>>>>> InOut inOut = (InOut)exchange; >>>>>>>>>> NormalizedMessage normalizedMessage = >>>>>>>>>> inOut.getInMessage(); >>>>>>>>>> //String outMessage = processXml(normalizedMessage); >>>>>>>>>> >>>>>>>>>> String outMessage ="<sample>this is sample >>>>>>>>>> xml</sample>"; >>>>>>>>>> normalizedMessage.setContent(new >>>>>>>>>> StringSource(outMessage)); >>>>>>>>>> MessageUtil.transferInToOut(inOut, inOut); >>>>>>>>>> channel.send(inOut); >>>>>>>>>> >>>>>>>>>> .................. >>>>>>>>>> >>>>>>>>>> is there any utility in MessageUtil to convert this plan xml >>>>>>>>>> content >>>>>>>>>> to >>>>>>>>>> soap >>>>>>>>>> binding message or jbi binding message???? >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> regards >>>>>>>>>> >>>>>>>>>> Brijesh N K >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Freeman Fang wrote: >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>>> Hi, >>>>>>>>>>> >>>>>>>>>>> Cxf bc expect soap binding message or jbi binding message, but >>>>>>>>>>> the >>>>>>>>>>> message "<sample>this is sample xml</sample>" from your bean is >>>>>>>>>>> invalid >>>>>>>>>>> for the cxf bc. >>>>>>>>>>> >>>>>>>>>>> Freeman >>>>>>>>>>> >>>>>>>>>>> brijesh wrote: >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>>> hello, >>>>>>>>>>>> >>>>>>>>>>>> I am calling servicemix-bean through cxf-bc, but i am getting >>>>>>>>>>>> soap >>>>>>>>>>>> fault >>>>>>>>>>>> as >>>>>>>>>>>> follows >>>>>>>>>>>> >>>>>>>>>>>> <soap:Envelope >>>>>>>>>>>> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> >>>>>>>>>>>> <soap:Body> >>>>>>>>>>>> <soap:Fault> >>>>>>>>>>>> <faultcode>soap:Server</faultcode> >>>>>>>>>>>> <faultstring>Message wrapper element is '{}sample' but >>>>>>>>>>>> expected >>>>>>>>>>>> '{http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper}message'</faultstring> >>>>>>>>>>>> </soap:Fault> >>>>>>>>>>>> </soap:Body> >>>>>>>>>>>> </soap:Envelope> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> code for service-bean as follows >>>>>>>>>>>> >>>>>>>>>>>> public class ContractSchemaDataMapper implements >>>>>>>>>>>> MessageExchangeListener >>>>>>>>>>>> { >>>>>>>>>>>> >>>>>>>>>>>> @Resource >>>>>>>>>>>> private DeliveryChannel channel; >>>>>>>>>>>> private static final Log logger = >>>>>>>>>>>> LogFactory.getLog(ContractSchemaDataMapper.class); >>>>>>>>>>>> >>>>>>>>>>>> public void onMessageExchange(MessageExchange exchange) >>>>>>>>>>>> throws >>>>>>>>>>>> MessagingException { >>>>>>>>>>>> >>>>>>>>>>>> if (exchange.getStatus() == ExchangeStatus.ACTIVE) { >>>>>>>>>>>> >>>>>>>>>>>> logger.debug("## Received exchange with status >>>>>>>>>>>> ACTIVE: " >>>>>>>>>>>> + >>>>>>>>>>>> exchange); >>>>>>>>>>>> System.out.println("## Received exchange with >>>>>>>>>>>> status >>>>>>>>>>>> ACTIVE: >>>>>>>>>>>> " >>>>>>>>>>>> + >>>>>>>>>>>> exchange); >>>>>>>>>>>> InOut inOut = (InOut)exchange; >>>>>>>>>>>> NormalizedMessage normalizedMessage = >>>>>>>>>>>> inOut.getInMessage(); >>>>>>>>>>>> //String outMessage = >>>>>>>>>>>> processXml(normalizedMessage); >>>>>>>>>>>> String outMessage ="<sample>this is sample >>>>>>>>>>>> xml</sample>"; >>>>>>>>>>>> normalizedMessage.setContent(new >>>>>>>>>>>> StringSource(outMessage)); >>>>>>>>>>>> MessageUtil.transferInToOut(inOut, inOut); >>>>>>>>>>>> channel.send(inOut); >>>>>>>>>>>> } else{ >>>>>>>>>>>> logger.debug("## Received exchange but status >>>>>>>>>>>> not ACTIVE: >>>>>>>>>>>> " >>>>>>>>>>>> + >>>>>>>>>>>> exchange); >>>>>>>>>>>> } >>>>>>>>>>>> } >>>>>>>>>>>> } >>>>>>>>>>>> >>>>>>>>>>>> and the stack trace as follows >>>>>>>>>>>> >>>>>>>>>>>> INFO: Interceptor has thrown exception, unwinding now >>>>>>>>>>>> org.apache.cxf.interceptor.Fault: Message wrapper element is >>>>>>>>>>>> '{}sample' >>>>>>>>>>>> but >>>>>>>>>>>> expected >>>>>>>>>>>> '{http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper}message' >>>>>>>>>>>> at >>>>>>>>>>>> org.apache.servicemix.cxfbc.interceptors.JbiOutWsdl1Interceptor.handleMessage(JbiOutWsdl1Interceptor.java:103) >>>>>>>>>>>> at >>>>>>>>>>>> org.apache.servicemix.cxfbc.interceptors.JbiOutWsdl1Interceptor.handleMessage(JbiOutWsdl1Interceptor.java:62) >>>>>>>>>>>> at >>>>>>>>>>>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220) >>>>>>>>>>>> at >>>>>>>>>>>> org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:74) >>>>>>>>>>>> at >>>>>>>>>>>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220) >>>>>>>>>>>> at >>>>>>>>>>>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:77) >>>>>>>>>>>> at >>>>>>>>>>>> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:278) >>>>>>>>>>>> at >>>>>>>>>>>> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:252) >>>>>>>>>>>> at >>>>>>>>>>>> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70) >>>>>>>>>>>> at >>>>>>>>>>>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:757) >>>>>>>>>>>> at >>>>>>>>>>>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206) >>>>>>>>>>>> at >>>>>>>>>>>> org.mortbay.jetty.handler.HandlerList.handle(HandlerList.java:49) >>>>>>>>>>>> at >>>>>>>>>>>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) >>>>>>>>>>>> at org.mortbay.jetty.Server.handle(Server.java:324) >>>>>>>>>>>> at >>>>>>>>>>>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:502) >>>>>>>>>>>> at >>>>>>>>>>>> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:840) >>>>>>>>>>>> at >>>>>>>>>>>> org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:657) >>>>>>>>>>>> at >>>>>>>>>>>> org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) >>>>>>>>>>>> at >>>>>>>>>>>> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:377) >>>>>>>>>>>> at >>>>>>>>>>>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) >>>>>>>>>>>> at >>>>>>>>>>>> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:497) >>>>>>>>>>>> Caused by: java.lang.Exception: Message wrapper element is >>>>>>>>>>>> '{}sample' >>>>>>>>>>>> but >>>>>>>>>>>> expected >>>>>>>>>>>> '{http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper}message' >>>>>>>>>>>> ... 21 more >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> Any idea on this , >>>>>>>>>>>> >>>>>>>>>>>> regards >>>>>>>>>>>> >>>>>>>>>>>> Brijesh N K >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >> > > > -- View this message in context: http://www.nabble.com/expected-%27%7Bhttp%3A--java.sun.com-xml-ns-jbi-wsdl-11-wrapper%7Dmessage-tp21276728p21287338.html Sent from the ServiceMix - User mailing list archive at Nabble.com.
