Caused by: Unmarshalling Error: unexpected element

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Caused by: Unmarshalling Error: unexpected element

susheel.chaudhary@gmail.com
This post has NOT been accepted by the mailing list yet.
Hi,
               I am getting error

 Caused by: Unmarshalling Error: unexpected element (uri:&quot;http://v3.hotel.wsapi.ean.com/&quot;, local:&quot;HotelListRequest&quot;). Expected elements are &lt;{}HotelListRequest&gt; </detailText> 


while trying to invoke an external web service from casa. I did some search and found that it may be due to wrong namespace. I tried many options but unable to figure out the exact issue. Please help.


BPEL code:

<?xml version="1.0" encoding="UTF-8" ?>
<process
    name="expediaBPEL"
    targetNamespace="http://enterprise.netbeans.org/bpel/ExpediaBPEL/expediaBPEL"
    xmlns:tns="http://enterprise.netbeans.org/bpel/ExpediaBPEL/expediaBPEL"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
    xmlns:sxt="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Trace" 
    xmlns:sxed="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Editor2"
    xmlns:sxat="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Attachment"
    xmlns:sxeh="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/ErrorHandling" xmlns:ns0="http://v3.hotel.wsapi.ean.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <import namespace="http://j2ee.netbeans.org/wsdl/ExpediaBPEL/src/EXWSDL" location="EXWSDL.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
    <import namespace="http://enterprise.netbeans.org/bpel/listWrapper" location="listWrapper.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
    <import namespace="http://v3.hotel.wsapi.ean.com/" location="https://book.api.ean.com/ean-services/ws/hotel/v3/list?wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
    <partnerLinks>
        <partnerLink name="Expedia" xmlns:tns="http://enterprise.netbeans.org/bpel/listWrapper" partnerLinkType="tns:HotelServicesLinkType" partnerRole="HotelServicesRole"/>
        <partnerLink name="PartnerLink1" xmlns:tns="http://j2ee.netbeans.org/wsdl/ExpediaBPEL/src/EXWSDL" partnerLinkType="tns:EXWSDL" myRole="EXWSDLPortTypeRole"/>
    </partnerLinks>
    <variables>
        <variable name="GetListOut" xmlns:tns="http://v3.hotel.wsapi.ean.com/" messageType="tns:getListResponse"/>
        <variable name="GetListIn" xmlns:tns="http://v3.hotel.wsapi.ean.com/" messageType="tns:getList"/>
        <variable name="EXWSDLOperationOut" xmlns:tns="http://j2ee.netbeans.org/wsdl/ExpediaBPEL/src/EXWSDL" messageType="tns:EXWSDLOperationResponse">
            <sxed:editor>
                <sxed:cast path="$EXWSDLOperationOut.part1" type="ns0:HotelListRequest" source="to"/>
            </sxed:editor>
        </variable>
        <variable name="EXWSDLOperationIn" xmlns:tns="http://j2ee.netbeans.org/wsdl/ExpediaBPEL/src/EXWSDL" messageType="tns:EXWSDLOperationRequest"/>
    </variables>
    <sequence>
        <receive name="Receive1" createInstance="yes" partnerLink="PartnerLink1" operation="EXWSDLOperation" xmlns:tns="http://j2ee.netbeans.org/wsdl/ExpediaBPEL/src/EXWSDL" portType="tns:EXWSDLPortType" variable="EXWSDLOperationIn"/>
        <assign name="Assign1">
            <copy>
                <from variable="EXWSDLOperationIn" part="part1"/>
                <to>$GetListIn.parameters/ns0:HotelListRequest/minorRev</to>
            </copy>
            <copy>
                <from variable="EXWSDLOperationIn" part="part2"/>
                <to>$GetListIn.parameters/ns0:HotelListRequest/locale</to>
            </copy>
            <copy>
                <from variable="EXWSDLOperationIn" part="part4"/>
                <to>$GetListIn.parameters/ns0:HotelListRequest/cid</to>
            </copy>
            <copy>
                <from variable="EXWSDLOperationIn" part="part5"/>
                <to>$GetListIn.parameters/ns0:HotelListRequest/apiKey</to>
            </copy>
            <copy>
                <from variable="EXWSDLOperationIn" part="part6"/>
                <to>$GetListIn.parameters/ns0:HotelListRequest/city</to>
            </copy>
            <copy>
                <from variable="EXWSDLOperationIn" part="part7"/>
                <to>$GetListIn.parameters/ns0:HotelListRequest/countryCode</to>
            </copy>
            <copy>
                <from variable="EXWSDLOperationIn" part="part8"/>
                <to>$GetListIn.parameters/ns0:HotelListRequest/arrivalDate</to>
            </copy>
            <copy>
                <from variable="EXWSDLOperationIn" part="part9"/>
                <to>$GetListIn.parameters/ns0:HotelListRequest/departureDate</to>
            </copy>
            <copy>
                <from variable="EXWSDLOperationIn" part="part10"/>
                <to>$GetListIn.parameters/ns0:HotelListRequest/RoomGroup/Room/numberOfAdults</to>
            </copy>
            <copy>
                <from variable="EXWSDLOperationIn" part="part11"/>
                <to>$GetListIn.parameters/ns0:HotelListRequest/includeSurrounding</to>
            </copy>
            <copy>
                <from variable="EXWSDLOperationIn" part="part12"/>
                <to>$GetListIn.parameters/ns0:HotelListRequest/numberOfResults</to>
            </copy>
            <copy>
                <from variable="EXWSDLOperationIn" part="part3"/>
                <to>$GetListIn.parameters/ns0:HotelListRequest/currencyCode</to>
            </copy>
        </assign>
        <invoke name="Invoke1" partnerLink="Expedia" operation="getList" xmlns:tns="http://v3.hotel.wsapi.ean.com/" portType="tns:HotelServices" inputVariable="GetListIn" outputVariable="GetListOut"/>
        <assign name="Assign2">
            <copy>
                <from>$GetListOut.parameters/ns0:HotelListResponse</from>
                <to variable="EXWSDLOperationOut" part="part1">
                    <sxed:editor>
                        <sxed:cast path="$EXWSDLOperationOut.part1" type="ns0:HotelListRequest" source="to"/>
                    </sxed:editor>
                </to>
            </copy>
            <copy>
                <from>
                    <literal>ns0:HotelListRequest</literal>
                </from>
                <to>$EXWSDLOperationOut.part1/@xsi:type
                    <sxed:editor>
                        <sxed:cast path="$EXWSDLOperationOut.part1" type="ns0:HotelListRequest" source="to"/>
                    </sxed:editor>
                </to>
            </copy>
        </assign>
        <reply name="Reply1" partnerLink="PartnerLink1" operation="EXWSDLOperation" xmlns:tns="http://j2ee.netbeans.org/wsdl/ExpediaBPEL/src/EXWSDL" portType="tns:EXWSDLPortType" variable="EXWSDLOperationOut"/>
    </sequence>
</process>


CASA:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<casa xmlns="http://java.sun.com/xml/ns/casa" xmlns:ns1="http://v3.hotel.wsapi.ean.com/" xmlns:ns2="ExpediaCA" xmlns:ns3="http://j2ee.netbeans.org/wsdl/ExpediaBPEL/src/EXWSDL" xmlns:ns4="http://enterprise.netbeans.org/bpel/ExpediaBPEL/expediaBPEL" xmlns:xlink="http://www.w3.org/2000/xlink">
    <endpoints>
        <endpoint endpoint-name="HotelServicesImplPort" interface-name="ns1:HotelServices" name="endpoint1" service-name="ns1:HotelServicesImplService"/>
        <endpoint endpoint-name="casaPort1" interface-name="ns3:EXWSDLPortType" name="endpoint2" service-name="ns2:ExpediaCAService1"/>
        <endpoint display-name="PartnerLink1" endpoint-name="EXWSDLPortTypeRole_myRole" file-path="expediaBPEL.bpel" interface-name="ns3:EXWSDLPortType" name="endpoint3" process-name="expediaBPEL" service-name="ns4:PartnerLink1"/>
        <endpoint display-name="Expedia" endpoint-name="HotelServicesRole_partnerRole" file-path="expediaBPEL.bpel" interface-name="ns1:HotelServices" name="endpoint4" process-name="expediaBPEL" service-name="ns4:Expedia"/>
    </endpoints>
    <service-units>
        <service-engine-service-unit artifacts-zip="ExpediaBPEL.jar" component-name="sun-bpel-engine" defined="true" description="Represents this Service Unit" internal="true" name="ExpediaCA-ExpediaBPEL" unit-name="ExpediaBPEL" unknown="false" x="154" y="99">
            <provides endpoint="endpoint3"/>
            <consumes endpoint="endpoint4"/>
        </service-engine-service-unit>
        <binding-component-service-unit artifacts-zip="sun-http-binding.jar" component-name="sun-http-binding" description="Represents this Service Unit" name="ExpediaCA-sun-http-binding" unit-name="sun-http-binding">
            <ports>
                <port bindingType="soap" x="67" y="244">
                    <link xlink:href="../jbiasa/ExpediaCA.wsdl#xpointer(/definitions/service[@name='ExpediaCAService1']/port[@name='casaPort1'])" xlink:type="simple"/>
                    <consumes endpoint="endpoint2"/>
                    <provides endpoint="endpoint2"/>
                </port>
                <port x="67" y="39">
                    <link xlink:href="../jbiServiceUnits/ExpediaBPEL/book.api.ean.com/ean-services/ws/hotel/v3/list.wsdl#xpointer(/definitions/service[@name='HotelServicesImplService']/port[@name='HotelServicesImplPort'])" xlink:type="simple"/>
                    <consumes endpoint="endpoint1"/>
                    <provides endpoint="endpoint1"/>
                </port>
            </ports>
        </binding-component-service-unit>
    </service-units>
    <connections>
        <connection consumer="endpoint4" provider="endpoint1" state="unchanged"/>
        <connection consumer="endpoint2" provider="endpoint3" state="new"/>
    </connections>
    <porttypes>
        <link xlink:href="../jbiasa/ExpediaCA.wsdl#xpointer(/definitions/portType[@name='dummyCasaPortType'])" xlink:type="simple"/>
        <link xlink:href="../jbiServiceUnits/ExpediaBPEL/book.api.ean.com/ean-services/ws/hotel/v3/list.wsdl#xpointer(/definitions/portType[@name='HotelServices'])" xlink:type="simple"/>
        <link xlink:href="../jbiServiceUnits/ExpediaBPEL/EXWSDL.wsdl#xpointer(/definitions/portType[@name='EXWSDLPortType'])" xlink:type="simple"/>
        <link xlink:href="../jbiServiceUnits/ExpediaCA.wsdl#xpointer(/definitions/portType[@name='dummyCasaPortType'])" xlink:type="simple"/>
    </porttypes>
    <bindings>
        <link xlink:href="../jbiasa/ExpediaCA.wsdl#xpointer(/definitions/binding[@name='casaBinding1'])" xlink:type="simple"/>
        <link xlink:href="../jbiServiceUnits/ExpediaBPEL/book.api.ean.com/ean-services/ws/hotel/v3/list.wsdl#xpointer(/definitions/binding[@name='HotelServicesImplServiceSoapBinding'])" xlink:type="simple"/>
        <link xlink:href="../jbiServiceUnits/ExpediaCA.wsdl#xpointer(/definitions/binding[@name='casaBinding1'])" xlink:type="simple"/>
    </bindings>
    <services>
        <link xlink:href="../jbiasa/ExpediaCA.wsdl#xpointer(/definitions/service[@name='ExpediaCAService1'])" xlink:type="simple"/>
        <link xlink:href="../jbiServiceUnits/ExpediaBPEL/book.api.ean.com/ean-services/ws/hotel/v3/list.wsdl#xpointer(/definitions/service[@name='HotelServicesImplService'])" xlink:type="simple"/>
        <link xlink:href="../jbiServiceUnits/ExpediaCA.wsdl#xpointer(/definitions/service[@name='ExpediaCAService1'])" xlink:type="simple"/>
    </services>
    <regions>
        <region name="WSDL Endpoints" width="150"/>
        <region name="JBI Modules" width="500"/>
        <region name="External Modules" width="200"/>
    </regions>
</casa>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Caused by: Unmarshalling Error: unexpected element

smoczyna
This post has NOT been accepted by the mailing list yet.
Your problem is quite clear, XML parser expects to find this element: HotelListRequest
but it found something else so it throws unexpected element error. Your client files are probably out of date, try to refresh/replace your service definition.
Loading...