You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Thomas Leonard <ta...@it-innovation.soton.ac.uk> on 2007/09/14 16:19:46 UTC

Axis 2: How to pass WS-Addressing EPRs

Hi,

I'm trying to upgrade our services to use Axis 2 (we're currently using
Axis 1.4).

However, I'm having some trouble with methods which take or return
WS-Addressing EPRs. e.g. on a factory service we have:

	public EndpointReference createResource(String label);

The generated WSDL looks like this:

  <xs:schema xmlns:ax268="http://addressing.axis2.apache.org/xsd" xmlns:ax269="http://util.java/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://addressing.axis2.apache.org/xsd">
   <xs:import namespace="http://util.java/xsd"/>
   <xs:complexType name="EndpointReference">
    <xs:sequence>
     <xs:element minOccurs="0" name="address" nillable="true" type="xs:string"/>

     <xs:element minOccurs="0" name="addressAttributes" nillable="true" type="xs:anyType"/>
     <xs:element minOccurs="0" name="allReferenceParameters" nillable="true" type="ns14:Map"/>
     <xs:element minOccurs="0" name="attributes" nillable="true" type="xs:anyType"/>
     <xs:element minOccurs="0" name="extensibleElements" nillable="true" type="xs:anyType"/>
     <xs:element minOccurs="0" name="logCorrelationIDString" nillable="true" type="xs:string"/>
     <xs:element minOccurs="0" name="metaData" nillable="true" type="xs:anyType"/>
     <xs:element minOccurs="0" name="metadataAttributes" nillable="true" type="xs:anyType"/>
     <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
     <xs:element minOccurs="0" name="referenceParameters" nillable="true" type="ns14:Map"/>

    </xs:sequence>
   </xs:complexType>
  </xs:schema>

This doesn't match the schema given in the WS-Addressing spec, which is:

 <xs:complexType name="EndpointReferenceType" mixed="false">
  <xs:sequence>
   <xs:element name="Address" type="tns:AttributedURIType"/>
   <xs:element ref="tns:ReferenceParameters" minOccurs="0"/>

   <xs:element ref="tns:Metadata" minOccurs="0"/>
   <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
  </xs:sequence>
  <xs:anyAttribute namespace="##other" processContents="lax"/>
 </xs:complexType>

The problem is worse if I use the Axis 1 type EndpointReferenceType; e.g.

   <xs:complexType name="EndpointReferenceType">
    <xs:sequence>
     <xs:element minOccurs="0" name="address" nillable="true" type="ns18:AttributedURI"/>
     <xs:element minOccurs="0" name="metadata" nillable="true" type="ns18:MetadataType"/>
     <xs:element minOccurs="0" name="parameters" nillable="true" type="ns18:ReferenceParametersType"/>
     <xs:element minOccurs="0" name="portType" nillable="true" type="ns18:AttributedQName"/>
     <xs:element minOccurs="0" name="serviceName" nillable="true" type="ns18:ServiceNameType"/>

     <xs:element minOccurs="0" name="typeDesc" nillable="true" type="ns5:TypeDesc"/>
     <xs:element maxOccurs="unbounded" minOccurs="0" name="_any" nillable="true" type="ns10:MessageElement"/>
    </xs:sequence>
   </xs:complexType>

(note the "typeDesc" and "MessageElement" parts!)


What's the correct way to handle EndpointReferences in Axis 2?

Thanks,


-- 
Dr Thomas Leonard
IT Innovation Centre
2 Venture Road
Southampton
Hampshire SO16 7NP

Tel: +44 0 23 8076 0834
Fax: +44 0 23 8076 0833
mailto:tal@it-innovation.soton.ac.uk
http://www.it-innovation.soton.ac.uk


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis 2: How to pass WS-Addressing EPRs

Posted by Deepal jayasinghe <de...@gmail.com>.

Thomas Leonard wrote:
> Hi Deepal,
>
> Thanks for the answer. The trouble is, we have a number of other special
> types (e.g. X509Certificate, Document) which will also require special
> treatment.
>
> Perhaps I can patch Axis to allow custom type mappings to be specified as
> in Axis 1. Where would I do that - in the Axis kernel itself or with a
> module?
>   
Well you can write a your own message receiver for your service to do
the custom type mapping and you can then provide a patch for that.
> Alternatively, if I generate the WSDL ahead of time and store it in the
> .aar, will it still get WS-Policy annotations added to it? These are
> dynamic, and change as the service is reconfigured.
>   
yes.

Thanks
Deepal
> Thanks,
>
>
> On Mon, 17 Sep 2007 16:33:10 +0530, Deepal jayasinghe wrote:
>
>   
>> Hi Thomas ,
>> cant you do this with just string or please write your own bean to
>> represent  EPR related data. If you use Axis2 EndpointReference when
>> generating wsdl (as you have specified) it will show all the fields in
>> the EndpointReference  class using java reflection and there is no way
>> to avoid that. Therefore writing ur own EPR class will help in the case.
>>
>> Thanks
>> Deepal.
>>     
>>> Hi,
>>>
>>> I'm trying to upgrade our services to use Axis 2 (we're currently using
>>> Axis 1.4).
>>>
>>> However, I'm having some trouble with methods which take or return
>>> WS-Addressing EPRs. e.g. on a factory service we have:
>>>
>>> 	public EndpointReference createResource(String label);
>>>
>>> The generated WSDL looks like this:
>>>
>>>   <xs:schema xmlns:ax268="http://addressing.axis2.apache.org/xsd" xmlns:ax269="http://util.java/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://addressing.axis2.apache.org/xsd">
>>>    <xs:import namespace="http://util.java/xsd"/>
>>>    <xs:complexType name="EndpointReference">
>>>     <xs:sequence>
>>>      <xs:element minOccurs="0" name="address" nillable="true" type="xs:string"/>
>>>
>>>      <xs:element minOccurs="0" name="addressAttributes" nillable="true" type="xs:anyType"/>
>>>      <xs:element minOccurs="0" name="allReferenceParameters" nillable="true" type="ns14:Map"/>
>>>      <xs:element minOccurs="0" name="attributes" nillable="true" type="xs:anyType"/>
>>>      <xs:element minOccurs="0" name="extensibleElements" nillable="true" type="xs:anyType"/>
>>>      <xs:element minOccurs="0" name="logCorrelationIDString" nillable="true" type="xs:string"/>
>>>      <xs:element minOccurs="0" name="metaData" nillable="true" type="xs:anyType"/>
>>>      <xs:element minOccurs="0" name="metadataAttributes" nillable="true" type="xs:anyType"/>
>>>      <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
>>>      <xs:element minOccurs="0" name="referenceParameters" nillable="true" type="ns14:Map"/>
>>>
>>>     </xs:sequence>
>>>    </xs:complexType>
>>>   </xs:schema>
>>>       
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis 2: How to pass WS-Addressing EPRs

Posted by Thomas Leonard <ta...@it-innovation.soton.ac.uk>.
Hi Deepal,

Thanks for the answer. The trouble is, we have a number of other special
types (e.g. X509Certificate, Document) which will also require special
treatment.

Perhaps I can patch Axis to allow custom type mappings to be specified as
in Axis 1. Where would I do that - in the Axis kernel itself or with a
module?

Alternatively, if I generate the WSDL ahead of time and store it in the
.aar, will it still get WS-Policy annotations added to it? These are
dynamic, and change as the service is reconfigured.

Thanks,


On Mon, 17 Sep 2007 16:33:10 +0530, Deepal jayasinghe wrote:

> Hi Thomas ,
> cant you do this with just string or please write your own bean to
> represent  EPR related data. If you use Axis2 EndpointReference when
> generating wsdl (as you have specified) it will show all the fields in
> the EndpointReference  class using java reflection and there is no way
> to avoid that. Therefore writing ur own EPR class will help in the case.
> 
> Thanks
> Deepal.
>> Hi,
>>
>> I'm trying to upgrade our services to use Axis 2 (we're currently using
>> Axis 1.4).
>>
>> However, I'm having some trouble with methods which take or return
>> WS-Addressing EPRs. e.g. on a factory service we have:
>>
>> 	public EndpointReference createResource(String label);
>>
>> The generated WSDL looks like this:
>>
>>   <xs:schema xmlns:ax268="http://addressing.axis2.apache.org/xsd" xmlns:ax269="http://util.java/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://addressing.axis2.apache.org/xsd">
>>    <xs:import namespace="http://util.java/xsd"/>
>>    <xs:complexType name="EndpointReference">
>>     <xs:sequence>
>>      <xs:element minOccurs="0" name="address" nillable="true" type="xs:string"/>
>>
>>      <xs:element minOccurs="0" name="addressAttributes" nillable="true" type="xs:anyType"/>
>>      <xs:element minOccurs="0" name="allReferenceParameters" nillable="true" type="ns14:Map"/>
>>      <xs:element minOccurs="0" name="attributes" nillable="true" type="xs:anyType"/>
>>      <xs:element minOccurs="0" name="extensibleElements" nillable="true" type="xs:anyType"/>
>>      <xs:element minOccurs="0" name="logCorrelationIDString" nillable="true" type="xs:string"/>
>>      <xs:element minOccurs="0" name="metaData" nillable="true" type="xs:anyType"/>
>>      <xs:element minOccurs="0" name="metadataAttributes" nillable="true" type="xs:anyType"/>
>>      <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
>>      <xs:element minOccurs="0" name="referenceParameters" nillable="true" type="ns14:Map"/>
>>
>>     </xs:sequence>
>>    </xs:complexType>
>>   </xs:schema>


-- 
Dr Thomas Leonard
IT Innovation Centre
2 Venture Road
Southampton
Hampshire SO16 7NP

Tel: +44 0 23 8076 0834
Fax: +44 0 23 8076 0833
mailto:tal@it-innovation.soton.ac.uk
http://www.it-innovation.soton.ac.uk


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis 2: How to pass WS-Addressing EPRs

Posted by Deepal jayasinghe <de...@gmail.com>.
Hi Thomas ,
cant you do this with just string or please write your own bean to
represent  EPR related data. If you use Axis2 EndpointReference when
generating wsdl (as you have specified) it will show all the fields in
the EndpointReference  class using java reflection and there is no way
to avoid that. Therefore writing ur own EPR class will help in the case.

Thanks
Deepal.
> Hi,
>
> I'm trying to upgrade our services to use Axis 2 (we're currently using
> Axis 1.4).
>
> However, I'm having some trouble with methods which take or return
> WS-Addressing EPRs. e.g. on a factory service we have:
>
> 	public EndpointReference createResource(String label);
>
> The generated WSDL looks like this:
>
>   <xs:schema xmlns:ax268="http://addressing.axis2.apache.org/xsd" xmlns:ax269="http://util.java/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://addressing.axis2.apache.org/xsd">
>    <xs:import namespace="http://util.java/xsd"/>
>    <xs:complexType name="EndpointReference">
>     <xs:sequence>
>      <xs:element minOccurs="0" name="address" nillable="true" type="xs:string"/>
>
>      <xs:element minOccurs="0" name="addressAttributes" nillable="true" type="xs:anyType"/>
>      <xs:element minOccurs="0" name="allReferenceParameters" nillable="true" type="ns14:Map"/>
>      <xs:element minOccurs="0" name="attributes" nillable="true" type="xs:anyType"/>
>      <xs:element minOccurs="0" name="extensibleElements" nillable="true" type="xs:anyType"/>
>      <xs:element minOccurs="0" name="logCorrelationIDString" nillable="true" type="xs:string"/>
>      <xs:element minOccurs="0" name="metaData" nillable="true" type="xs:anyType"/>
>      <xs:element minOccurs="0" name="metadataAttributes" nillable="true" type="xs:anyType"/>
>      <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
>      <xs:element minOccurs="0" name="referenceParameters" nillable="true" type="ns14:Map"/>
>
>     </xs:sequence>
>    </xs:complexType>
>   </xs:schema>
>
> This doesn't match the schema given in the WS-Addressing spec, which is:
>
>  <xs:complexType name="EndpointReferenceType" mixed="false">
>   <xs:sequence>
>    <xs:element name="Address" type="tns:AttributedURIType"/>
>    <xs:element ref="tns:ReferenceParameters" minOccurs="0"/>
>
>    <xs:element ref="tns:Metadata" minOccurs="0"/>
>    <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
>   </xs:sequence>
>   <xs:anyAttribute namespace="##other" processContents="lax"/>
>  </xs:complexType>
>
> The problem is worse if I use the Axis 1 type EndpointReferenceType; e.g.
>
>    <xs:complexType name="EndpointReferenceType">
>     <xs:sequence>
>      <xs:element minOccurs="0" name="address" nillable="true" type="ns18:AttributedURI"/>
>      <xs:element minOccurs="0" name="metadata" nillable="true" type="ns18:MetadataType"/>
>      <xs:element minOccurs="0" name="parameters" nillable="true" type="ns18:ReferenceParametersType"/>
>      <xs:element minOccurs="0" name="portType" nillable="true" type="ns18:AttributedQName"/>
>      <xs:element minOccurs="0" name="serviceName" nillable="true" type="ns18:ServiceNameType"/>
>
>      <xs:element minOccurs="0" name="typeDesc" nillable="true" type="ns5:TypeDesc"/>
>      <xs:element maxOccurs="unbounded" minOccurs="0" name="_any" nillable="true" type="ns10:MessageElement"/>
>     </xs:sequence>
>    </xs:complexType>
>
> (note the "typeDesc" and "MessageElement" parts!)
>
>
> What's the correct way to handle EndpointReferences in Axis 2?
>
> Thanks,
>
>
>   


-- 
Thanks,
Deepal
................................................................
"The highest tower is built one brick at a time"


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org