axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon McMahon" <simon_mcma...@health.qld.gov.au>
Subject Re: [1.3] Handling arrays - interop with .NET
Date Thu, 29 Jun 2006 03:48:15 GMT
I found my problem. It was the 'setProvider()' member function. This was
originally a constructor but I needed to have it in an interface so it
ended up with this name. Just a bad choice it appears because to Axis it
looks like an accessor for a private member called 'provider' which does
not exist.
 
I renamed the member function to 'initProvider' and the phantom
parameter disappeared.
 
My .NET clients can now consume the WSDL that axis generates for my web
service.
 
Regards,
 
Simon.
 

Simon McMahon
 
Work: (07) 31311420
Mobile: (043) 2294180


>>> btyfan@gmail.com 06/29/06 11:58am >>>
Contrary to what appears to be standard practice I've abandoned the
JavaServiceClass->WSDL approach and start from hand-cut WSDL which I
validate using an Eclipse plug-in (checks against WS-I). I also check
the WSDL within XMLSpy2006. I've take this approach because I currently
have a situation whereby the WSDL generated by the Axis service causes a
NullPointerException in WSDL2Java while attempting to generate client
stubs. I'd be interested in hearing from anyone who has any 1st hand
knowledge of exactly how standard/interoperable the WSDL generated by
Axis services really are... 


On 6/29/06, Simon McMahon <simon_mcmahon@health.qld.gov.au> wrote: Hi
Anne,
 
The WSDL is just cut and paste off my Apache/Tomcat server that hosts
the WS. You can see the complete WSDL at:
https://s8online.health.qld.gov.au/axis/services/qh-providers?wsdl 
 
See Provider.java def below. This was originally generated by Axis but
I have added fields to it since then. There is no field in my definition
for the extra field tagged onto each structure. There are 3 structures
that get this extra field at the end and they are all the ones that get
returned as arrays from my services.
 
This is one of the service entry points:
 
 public Provider[] getProviders(String name, String providerNo, String
orgName,
          String locationId, int maxResults)
  throws Exception
 {
 }
 
The others are all constructed similarly.
 

> Can you convert to doc/literal?

How do I do this?
 
> Add this parameter (dotNetSoapEncFix) to your global configuration: 
I am trying this now.
 
 
Provider.java:
 
package au.gov.qld.health.s8online.providerdir;
 
import javax.xml.namespace.QName;
 
import org.apache.axis.description.ElementDesc;
 
public class Provider
{
 protected int id;
 protected String name;
 protected String providerId;
 protected String org;
 protected String locationId;
 protected String application;
 protected String deliveryMethod;
 
 public Provider()
 {
        setId(0);
 }
 
 public void setProvider(String name, String providerNo, String org,
      String locationId, String application, String deliveryMethod)
 {
   this.name = name;
  this.providerId = providerNo;
  this.org = org;
  this.locationId = locationId;
  this.application = application;
  this.deliveryMethod = deliveryMethod;
 }
 
 public void setProvider(Provider pd)
 {
  setId(pd.getId());
  this.name = pd.getName();
  this.providerId = pd.getProviderId();
  this.org = pd.getOrg();
  this.locationId = pd.getLocationId();
  this.application = pd.getApplication();
  this.deliveryMethod = pd.getDeliveryMethod();
 }
 
 public int getId() {return id;}
 public void setId(int id) {this.id = id;}
 
 public String getName() {return name;}
 public void setName(String name){this.name = name;}
 
 public String getLocationId(){return this.locationId;}
 public void setlocationId(String locationId){this.locationId =
locationId;}
 
 public String getOrg(){return org;}
 public void setOrg(String org){this.org = org;}
 
 public String getProviderId(){return providerId;}
 public void setProviderId(String providerNo){this.providerId =
providerNo;}
 
 public String getApplication() {return application;}
 public void setApplication(String application) {this.application =
application;}
 
 public String getDeliveryMethod() {return deliveryMethod;}
 public void setDeliveryMethod(String deliveryMethod)
{this.deliveryMethod = deliveryMethod;}
 
 public String toString()
 {
  String s = "";
  if ( name != null && !name.equals(""))
   s += "name=\"" + name + "\"";
     if ( providerId != null && !providerId.equals("")) 
         s += ", providerNo=\"" + providerId + "\"";
     if ( org != null && !org.equals(""))
         s += ", org=\"" + org + "\""; 
     if ( locationId != null && !locationId.equals(""))
         s += ", locationId=\"" + locationId + "\"";
     if ( application != null && !application.equals("")) 
         s += ", application=\"" + application + "\"";
     if ( deliveryMethod != null && !deliveryMethod.equals(""))
         s += ", deliveryMethod=\"" + deliveryMethod + "\""; 
  return s;
 }
 
 public synchronized boolean equals(Object obj)
 {
  if (!(obj instanceof Provider))
   return false;
  Provider other = (Provider)obj;
  if (obj == null)
   return false;
  if (this == obj)
   return true;
  if (__equalsCalc != null) {
   return (__equalsCalc == obj);
  }
  __equalsCalc = obj;
  boolean _equals;
  _equals =
   true && (( this.name == null && other.getName() == null) ||
                (this.name != null && this.name.equals
(other.getName()))) &&
   ((this.providerId == null && other.getProviderId() == null) ||
                (this.providerId != null &&
this.providerId.equals(other.getProviderId()))) && 
   ((this.org == null && other.getOrg() == null) ||
                ( this.org != null && this.org.equals(other.getOrg())))
&&
   ((this.application == null && other.getApplication() == null) ||
                (this.application != null && this.application.equals
(other.getApplication()))) &&
            ((this.deliveryMethod == null && other.getDeliveryMethod()
== null) ||
                (this.deliveryMethod != null &&
this.deliveryMethod.equals(other.getDeliveryMethod ()))) &&
   ((this.locationId == null && other.getLocationId() == null) ||
                (this.locationId != null &&
this.locationId.equals(other.getLocationId())));
  __equalsCalc = null; 
  return _equals;
 }
 
 public synchronized int hashCode()
 {
  if (__hashCodeCalc) {
   return 0;
  }
  __hashCodeCalc = true;
     String h;
  int _hashCode = 1;
     h = getName();
     if (h != null) { _hashCode += h.hashCode(); }
     h = getProviderId();
     if (h != null) { _hashCode += h.hashCode(); }
     h = getOrg();
     if (h != null) { _hashCode += h.hashCode(); }
     h = getLocationId();
     if (h != null) { _hashCode += h.hashCode(); }
     h = getApplication();
     if (h != null) { _hashCode += h.hashCode(); }
     h = getDeliveryMethod();
     if (h != null) { _hashCode += h.hashCode(); }
  __hashCodeCalc = false;
  return _hashCode; 
 }
 
 protected Object __equalsCalc = null;
 
 protected boolean __hashCodeCalc = false;
 
 private static org.apache.axis.description.TypeDesc typeDesc =
  new org.apache.axis.description.TypeDesc(Provider.class, true);
 
 static {
  typeDesc.setXmlType(new javax.xml.namespace.QName("urn:qh",
"Provider"));
     initStringField("name");
     initStringField("providerId");
     initStringField("org"); 
     initStringField("locationId");
     initStringField("emailAddress");
     initStringField("application");
     initStringField("deliveryMethod");
 }
 
 private static void initStringField(String name)
 {
  ElementDesc elemField;
  elemField = new ElementDesc();
  elemField.setFieldName(name);
  elemField.setXmlName(new QName("", name));
  elemField.setXmlType(new
QName("http://schemas.xmlsoap.org/soap/encoding/", "string")); 
  elemField.setNillable(true);
  typeDesc.addFieldDesc(elemField);
 }
 
 /**
  * Return type metadata object
  */
 public static org.apache.axis.description.TypeDesc getTypeDesc()
 {
 return typeDesc;
 }
 
 /**
  * Get Custom Serializer
  */
 public static org.apache.axis.encoding.Serializer
getSerializer(java.lang.String mechType,
         java.lang.Class _javaType, javax.xml.namespace.QName
_xmlType)
 {
 return new org.apache.axis.encoding.ser.BeanSerializer(_javaType,
_xmlType, typeDesc);
 }
 
 /**
  * Get Custom Deserializer
  */
 public static org.apache.axis.encoding.Deserializer
getDeserializer(java.lang.String mechType,
         java.lang.Class _javaType, javax.xml.namespace.QName _xmlType)

 {
 return new org.apache.axis.encoding.ser.BeanDeserializer(_javaType,
_xmlType, typeDesc);
 }
 
}
 
 
 

Simon McMahon
 

Work: (07) 31311420
Mobile: (043) 2294180



>>> atmanes@gmail.com 06/28/06 11:11pm >>>

SOAP Encoding arrays are not particularly interoperable. Can you
convert to doc/literal?
If not, then you at least need to use the .NET SOAP Enocding fix. Add
this parameter to your global configuration: 




<parameter name="dotNetSoapEncFix" value="true"/>
 

This fix will change soapenc:string to xsd:string.

I also question whether the array is defined accurately. Is your
Provider object supposed to include another Provider object? Because
that's how it's defined now. (The "provider" element is defined as
type="impl"Provider", not as a link or reference.) 

How did you generate this WSDL?

Anne

On 6/28/06, Simon McMahon <simon_mcmahon@health.qld.gov.au > wrote:
Hi,

My web service returns an array of "Provider" (see below). 
The WSDL (see below) defines "Provider" with all my data elements but 
adds the extra one on the end 'provider'. This appears to be a link
field, maybe to support the array of these things. This extra field 
appears to mess up the consuming application (.NET).

I do the Axis side, not the .NET so I'm not sure what the .NET problem

is or how to do anything different on the Axis side. The .NET people
have asked me not to use this link field for the arrays. How can I do 
that?

Any help would be appreciated.

Thanks,

Simon. 

...
- <wsdl:types>
- <schema
targetNamespace="https://dev.health.qld.gov.au/axis/services/qh-providers
"
xmlns="http://www.w3.org/2001/XMLSchema">
  <import namespace=" http://schemas.xmlsoap.org/soap/encoding/ " />

- <complexType name="Provider">
- <sequence>
  <element name="name" nillable="true" type="soapenc:string" /> 

  <element name="providerId" nillable="true" type="soapenc:string" /> 

  <element name="org" nillable="true" type="soapenc:string" />

  <element name="locationId" nillable="true" type="soapenc:string" />

  <element name="application" nillable="true" type="soapenc:string" />



  <element name="deliveryMethod" nillable="true" type="soapenc:string"

/>

  <element name="id" type="xsd:int" />

  <element name="provider" nillable="true" type="impl:Provider" /> 

  </sequence>


  </complexType>


- <complexType name="ArrayOfProvider">
- <complexContent>
- <restriction base="soapenc:Array">
  <attribute ref="soapenc:arrayType" wsdl:arrayType="impl:Provider[]" 
/>

  </restriction>


  </complexContent>


  </complexType>








Simon McMahon

Work: (07) 31311420
Mobile: (043) 2294180



*****************************************************************
This email, including any attachments sent with it, is
confidential and for the sole use of the intended recipient(s).
This confidentiality is not waived or lost, if you receive it and 
you are not the intended recipient(s), or if it is transmitted/
received in error.

Any unauthorised use, alteration, disclosure, distribution or
review of this email is strictly prohibited.  The information 
contained in this email, including any attachment sent with
it, may be subject to a statutory duty of confidentiality if it
relates to health service matters.

If you are not the intended recipient(s), or if you have 
received this email in error, you are asked to immediately
notify the sender by telephone collect on Australia
+61 1800 198 175 or by return email.  You should also
delete this email, and any copies, from your computer 
system network and destroy any hard copies produced.

If not an intended recipient of this email, you must not copy,
distribute or take any action(s) that relies on it; any form of
disclosure, modification, distribution and/or publication of this 
email is also prohibited.

Although Queensland Health takes all reasonable steps to
ensure this email does not contain malicious software,
Queensland Health does not accept responsibility for the
consequences if any person's computer inadvertently suffers 
any disruption to services, loss of information, harm or is
infected with a virus, other malicious computer programme or
code that may occur as a consequence of receiving this
email.

Unless stated otherwise, this email represents only the views 
of the sender and not the views of the Queensland Government.
****************************************************************


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









Mime
View raw message