You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Shaw, Richard A" <ri...@atkinsglobal.com> on 2007/09/19 22:17:15 UTC

Calling .net remote objects

I have a .net remote object hosted using SOAP over TCP. 

I want to dispatch a request to it using CXF using the following code -

    public static DOMSource dispatch(DOMSource request, URL wsdlLocation, 
                                        QName serviceName, QName portName)
    {
        Service service = Service.create(wsdlLocation, serviceName);

        Dispatch<DOMSource> dispDOMSrcPayload = service.createDispatch(portName, 
                DOMSource.class, Mode.PAYLOAD);
        
        DOMSource response = dispDOMSrcPayload.invoke(request);        

        return response;
    }

However the request and the response have multiple roots. I can't get the remote object to work with a single root item. An example request and response is shown below -

<i2:JourneyPlan id="ref-1" xmlns:i2="http://schemas.microsoft.com/clr/nsassem/TransportDirect.JourneyPlanning.RoadRouting.RoadInterface/td.RoadInterface">
<request href="#ref-4"/>
</i2:JourneyPlan>
<a1:GazetteerRequest id="ref-4" xmlns:a1="http://schemas.microsoft.com/clr/nsassem/TransportDirect.JourneyPlanning.CJPInterface/td.CJPInterface%2C%20Version%3D9.2.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
<search href="#ref-5"/>
<referenceTransaction>false</referenceTransaction>
<requestID id="ref-6">1</requestID>
<language id="ref-7">en-GB</language>
<sessionID href="#ref-6"/>
<userType>1</userType>
<modeFilter xsi:null="1"/>
<operatorFilter xsi:null="1"/>
<serviceFilter xsi:null="1"/>
<secondaryModeFilter xsi:null="1"/>
</a1:GazetteerRequest>
<a1:RequestPlace id="ref-5" xmlns:a1="http://schemas.microsoft.com/clr/nsassem/TransportDirect.JourneyPlanning.CJPInterface/td.CJPInterface%2C%20Version%3D9.2.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
<givenName xsi:null="1"/>
<locality xsi:null="1"/>
<type>NaPTAN</type>
<isAlternativeVia>false</isAlternativeVia>
<roadPoints xsi:null="1"/>
<stops xsi:null="1"/>
<coordinate href="#ref-8"/>
</a1:RequestPlace>
<a1:Coordinate id="ref-8" xmlns:a1="http://schemas.microsoft.com/clr/nsassem/TransportDirect.JourneyPlanning.CJPInterface/td.CJPInterface%2C%20Version%3D9.2.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
<easting>100123</easting>
<northing>200456</northing>
</a1:Coordinate>
The response including the SOAP envelope is -
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:clr="http://schemas.microsoft.com/soap/encoding/clr/1.0" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<i2:JourneyPlanResponse id="ref-1" xmlns:i2="http://schemas.microsoft.com/clr/nsassem/TransportDirect.JourneyPlanning.RoadRouting.RoadInterface/td.RoadInterface">
<return href="#ref-4"/>
</i2:JourneyPlanResponse>
<a1:GazetteerResult id="ref-4" xmlns:a1="http://schemas.microsoft.com/clr/nsassem/TransportDirect.JourneyPlanning.CJPInterface/td.CJPInterface%2C%20Version%3D9.2.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
<found href="#ref-5"/>
<messages href="#ref-6"/>
</a1:GazetteerResult>
<SOAP-ENC:Array id="ref-5" SOAP-ENC:arrayType="a1:RequestPlace[1]" xmlns:a1="http://schemas.microsoft.com/clr/nsassem/TransportDirect.JourneyPlanning.CJPInterface/td.CJPInterface%2C%20Version%3D9.2.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
<item href="#ref-7"/>
</SOAP-ENC:Array>
<SOAP-ENC:Array id="ref-6" SOAP-ENC:arrayType="a1:Message[1]" xmlns:a1="http://schemas.microsoft.com/clr/nsassem/TransportDirect.JourneyPlanning.CJPInterface/td.CJPInterface%2C%20Version%3D9.2.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
<item href="#ref-8"/>
</SOAP-ENC:Array>
<a1:RequestPlace id="ref-7" xmlns:a1="http://schemas.microsoft.com/clr/nsassem/TransportDirect.JourneyPlanning.CJPInterface/td.CJPInterface%2C%20Version%3D9.2.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
<givenName id="ref-9">ALEXANDRA ROAD</givenName>
<locality xsi:null="1"/>
<type>NaPTAN</type>
<isAlternativeVia>false</isAlternativeVia>
<roadPoints href="#ref-10"/>
<stops xsi:null="1"/>
<coordinate href="#ref-11"/>
</a1:RequestPlace>
<a1:Message id="ref-8" xmlns:a1="http://schemas.microsoft.com/clr/nsassem/TransportDirect.JourneyPlanning.CJPInterface/td.CJPInterface%2C%20Version%3D9.2.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
<code>100</code>
<description id="ref-12">OK</description>
</a1:Message>
<SOAP-ENC:Array id="ref-10" SOAP-ENC:arrayType="a1:ITN[1]" xmlns:a1="http://schemas.microsoft.com/clr/nsassem/TransportDirect.JourneyPlanning.CJPInterface/td.CJPInterface%2C%20Version%3D9.2.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
<item href="#ref-13"/>
</SOAP-ENC:Array>
<a1:Coordinate id="ref-11" xmlns:a1="http://schemas.microsoft.com/clr/nsassem/TransportDirect.JourneyPlanning.CJPInterface/td.CJPInterface%2C%20Version%3D9.2.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
<easting>521927</easting>
<northing>160610</northing>
</a1:Coordinate>
<a1:ITN id="ref-13" xmlns:a1="http://schemas.microsoft.com/clr/nsassem/TransportDirect.JourneyPlanning.CJPInterface/td.CJPInterface%2C%20Version%3D9.2.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
<TOID xsi:null="1"/>
<timeDate>0001-01-01T00:00:00.0000000+00:00</timeDate>
<node>false</node>
<internalID>3655779</internalID>
<polyline xsi:null="1"/>
<seed href="#ref-14"/>
</a1:ITN>
<a1:RoadSeed id="ref-14" xmlns:a1="http://schemas.microsoft.com/clr/nsassem/TransportDirect.JourneyPlanning.CJPInterface/td.CJPInterface%2C%20Version%3D9.2.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
<costToANode>1</costToANode>
<pointOnLink href="#ref-15"/>
</a1:RoadSeed>
<a1:Coordinate id="ref-15" xmlns:a1="http://schemas.microsoft.com/clr/nsassem/TransportDirect.JourneyPlanning.CJPInterface/td.CJPInterface%2C%20Version%3D9.2.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
<easting>521926</easting>
<northing>160611</northing>
</a1:Coordinate>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Can anybody help ? Either with changing my request and response to have a single root or changing my CXF code to handle multiple roots.

BTW - the WSDL returned from my remote object is incomplete it is missing the type definitions and I can't find any help from micosoft which tells me why. My interface does have abstract types in it, I'm thinking they might be something to do with it.

Thanks in advance.

Richard Shaw

¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤

Richard Shaw  
Technical Design Authority - Information Solutions Consultancy  
Intelligent Transport Systems 

Atkins Highways and Transportation 
Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW

Tel: +44 (0) 1372 756407 
Fax: +44 (0) 1372 740055
Mob: 07740 817586 
E-mail: richard.shaw@atkinsglobal.com

www.atkinsglobal.com/its



This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.

The ultimate parent company of the Atkins Group is WS Atkins plc.  Registered in England No. 1885586.  Registered Office Woodcote Grove, Ashley Road, Epsom, Surrey KT18 5BW.

Consider the environment. Please don't print this e-mail unless you really need to.