axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dino Chiesa" <din...@microsoft.com>
Subject RE: .NET and Axis
Date Mon, 14 Mar 2005 21:20:43 GMT
Mmkay, 
I just tried building this,  with a dummy implementation for getCustomer() , and .... it works
for me?  
 
In other words, I do not get the response you showed, but I get the response .NETis expecting.
 This is the actual response (cut-n-paste): 
 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
    <getCustomerResponse xmlns="http://inquiry.webservice.gpb.rbc.com">
      <getCustomerReturn>
        <ns1:shortName xsi:nil="true" xmlns:ns1="http://customer.util.gpb.rbc.com" />
        <ns2:currency xsi:nil="true" xmlns:ns2="http://customer.util.gpb.rbc.com" />
        <ns3:isRestrained xmlns:ns3="http://customer.util.gpb.rbc.com">false</ns3:isRestrained>
        <ns4:status xmlns:ns4="http://customer.util.gpb.rbc.com">Watchlist</ns4:status>
        <ns5:hasWarnings xmlns:ns5="http://customer.util.gpb.rbc.com">false</ns5:hasWarnings>
        <ns6:id xmlns:ns6="http://customer.util.gpb.rbc.com">
          <ns7:bank xmlns:ns7="http://util.gpb.rbc.com">17</ns7:bank>
          <ns8:transit xmlns:ns8="http://util.gpb.rbc.com">102</ns8:transit>
          <ns9:key xmlns:ns9="http://util.gpb.rbc.com">love</ns9:key>
          <ns10:number xmlns:ns10="http://util.gpb.rbc.com">0</ns10:number>
        </ns6:id>
        <ns11:isBooksKept xmlns:ns11="http://customer.util.gpb.rbc.com">false</ns11:isBooksKept>
        <ns12:officerCode xsi:nil="true" xmlns:ns12="http://customer.util.gpb.rbc.com"
/>
        <ns13:type xmlns:ns13="http://customer.util.gpb.rbc.com">
          <ns14:description xmlns:ns14="http://util.gpb.rbc.com">I don't know</ns14:description>
          <ns15:value xmlns:ns15="http://util.gpb.rbc.com">hmph</ns15:value>
        </ns13:type>
        <ns16:state xmlns:ns16="http://customer.util.gpb.rbc.com">Active</ns16:state>
        <ns17:postalCode xsi:nil="true" xmlns:ns17="http://customer.util.gpb.rbc.com" />
        <ns18:legalName xmlns:ns18="http://customer.util.gpb.rbc.com">Ozzy Osborne</ns18:legalName>
        <ns19:address4 xsi:nil="true" xmlns:ns19="http://customer.util.gpb.rbc.com" />
        <ns20:dateOpened xmlns:ns20="http://customer.util.gpb.rbc.com">2005-03-14T21:11:22.226Z</ns20:dateOpened>
        <ns21:address3 xsi:nil="true" xmlns:ns21="http://customer.util.gpb.rbc.com" />
        <ns22:dateOfBirth xmlns:ns22="http://customer.util.gpb.rbc.com">1976-04-13T05:45:58.000Z</ns22:dateOfBirth>
        <ns23:address2 xsi:nil="true" xmlns:ns23="http://customer.util.gpb.rbc.com" />
        <ns24:address1 xsi:nil="true" xmlns:ns24="http://customer.util.gpb.rbc.com" />
        <ns25:name xmlns:ns25="http://customer.util.gpb.rbc.com">Albert Einstein</ns25:name>
      </getCustomerReturn>
    </getCustomerResponse>
  </soapenv:Body>
</soapenv:Envelope>
 
 
And interop just works. 
 
-Dino
 

________________________________

From: Dino Chiesa [mailto:dinoch@microsoft.com] 
Sent: Monday, March 14, 2005 3:42 PM
To: axis-user@ws.apache.org
Subject: RE: .NET and Axis


> If you look in the deploy.wsdd that I attached with the last mail you should see a typeMapping
for getCustomerResonse (X = Customer). Are you saying you don't get these typeMappings when
you run WSDL2Java on my inquiry.wsdl?  Any idea why that is?  
 
Ah, I'm sorry.  
When I use AXIS v1.1, I don't get a typeMapping for getCustomerResponse.  
when I use AXIS v1.2RC3 , I do get a typeMapping for getCustomer and getCustomerResponse .
 
 
But I don't think this is the central mystery here.  
 
Looking at your deploy.wsdd, and the Reference.cs, and the sample XML response, I believe
it is a namespace issue. 
 
In the response XML, the CustomerDTO is serialized into an element named "getCustomerReturn".
  This elt has no namespace defined for it, and so uses the namespace of its parent, the getCustomerResponse
element, which is explicitly specified here: 
 
    <getCustomerResponse xmlns="http://inquiry.webservice.gpb.rbc.com">

But, based on the WSDL, .NET is expecting the CustomerDTO to be serialized into this namespace:
 "http://customer.util.gpb.rbc.com" .     Hence, the namespace cross-up, as we suspected.

 
Your actual response is like this: 

  <soapenv:Body>
    <getCustomerResponse xmlns="http://inquiry.webservice.gpb.rbc.com <http://inquiry.webservice.gpb.rbc.com>
">
      <getCustomerReturn>
        <isBooksKept>false</isBooksKept>
        <officerCode xsi:nil="true" />
        <hasWarnings>false</hasWarnings>
        <type xsi:nil="true" />
        <isRestrained>false</isRestrained>
        <state xsi:nil="true" />
        <currency xsi:nil="true" />
        <shortName xsi:nil="true" />
        <postalCode xsi:nil="true" />
        <legalName xsi:nil="true" />
        <id>
          <bank>1</bank>
          <transit>1880</transit>
          <key xsi:nil="true" />
          <number>1000017</number>
        </id>
        <status xsi:nil="true" />
        <address4 xsi:nil="true" />
        <dateOpened xsi:nil="true" />
        <address3 xsi:nil="true" />
        <dateOfBirth xsi:nil="true" />
        <address2 xsi:nil="true" />
        <address1 xsi:nil="true" />
        <messages xsi:nil="true" />
        <name>Test Name</name>
      </getCustomerReturn>
    </getCustomerResponse>
  </soapenv:Body>
</soapenv:Envelope>
 
But what .NET is expecting is like this: 
 
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <getCustomerResponse xmlns="http://inquiry.webservice.gpb.rbc.com">
      <getCustomerReturn>
        <shortName xsi:nil="true" xmlns="http://customer.util.gpb.rbc.com" />
        <currency xsi:nil="true" xmlns="http://customer.util.gpb.rbc.com" />
        <isRestrained xmlns="http://customer.util.gpb.rbc.com">false</isRestrained>
        <status xmlns="http://customer.util.gpb.rbc.com">Loss</status>
        <hasWarnings xmlns="http://customer.util.gpb.rbc.com">false</hasWarnings>
        <id xmlns="http://customer.util.gpb.rbc.com">
          <bank xmlns="http://util.gpb.rbc.com">17</bank>
          <transit xmlns="http://util.gpb.rbc.com">102</transit>
          <key xmlns="http://util.gpb.rbc.com">love</key>
          <number xmlns="http://util.gpb.rbc.com">0</number>
        </id>
        <isBooksKept xmlns="http://customer.util.gpb.rbc.com">false</isBooksKept>
        <officerCode xsi:nil="true" xmlns="http://customer.util.gpb.rbc.com" />
        <type xmlns="http://customer.util.gpb.rbc.com">
          <description xmlns="http://util.gpb.rbc.com">I don't know</description>
          <value xmlns="http://util.gpb.rbc.com">hmph</value>
        </type>
        <state xmlns="http://customer.util.gpb.rbc.com">Active</state>
        <postalCode xsi:nil="true" xmlns="http://customer.util.gpb.rbc.com" />
        <legalName xmlns="http://customer.util.gpb.rbc.com">Ozzy Osborne</legalName>
        <address4 xsi:nil="true" xmlns="http://customer.util.gpb.rbc.com" />
        <dateOpened xmlns="http://customer.util.gpb.rbc.com">2005-03-14T15:17:45.2805722-05:00</dateOpened>
        <address3 xsi:nil="true" xmlns="http://customer.util.gpb.rbc.com" />
        <dateOfBirth xmlns="http://customer.util.gpb.rbc.com">0001-01-01T00:00:00.0000000-05:00</dateOfBirth>
        <address2 xsi:nil="true" xmlns="http://customer.util.gpb.rbc.com" />
        <address1 xsi:nil="true" xmlns="http://customer.util.gpb.rbc.com" />
        <name xmlns="http://customer.util.gpb.rbc.com">Albert Einstein</name>
      </getCustomerReturn>
    </getCustomerResponse>
  </soap:Body>
</soap:Envelope>

Notice that the getCustomerReturn is in the http://inquiry.webservice.gpb.rbc.com namespace,
as the WSDL specifies, and the child elements of that element are all in the http://customer.util.gpb.rbc.com
 namespace, again, as the WSDL specifies.  
 
It seems the response is not agreeing with the WSDL.  
 
 
-D
 
 

________________________________

From: aedemar.cooke@rbc.com [mailto:aedemar.cooke@rbc.com] 
Sent: Monday, March 14, 2005 10:41 AM
To: axis-user@ws.apache.org
Subject: RE: .NET and Axis


Thanks again Dino.  I have replied below.

	-----Original Message-----
	From: Dino Chiesa [mailto:dinoch@microsoft.com]
	Sent: 14 March 2005 3:27 
	To: axis-user@ws.apache.org
	Subject: RE: .NET and Axis
	
	
	hmm, some questions
	your steps are:
	 
	1. java2wsdl (as I have a fully functional web application currently exposed using rpc/encoded)
	2. wsdl2java 
	3. deploy using deploy.wsdd
	4. generate c# code from wsdl
	5. invoke from c# web app
	 
	 
	can you explain a bit more about that first step?  What do you mean "I have a fully functional
web application currently exposed using rpc/encoded"?  How is that relevant here?   What do
you do with the WSDL returned from that step?   
	I was just explaining that I use the Java 2 wsdl approach not the wsdl FIRST approach as
the java classes already exist.  
	 
	Looking at your WSDL, I would remove the ArrayOf_tns2_Message and replace it with an maxOccurs="unbounded"

	 
	eg remove 
	       <element name="messages" nillable="true" type="impl:ArrayOf_tns2_Message"/>
	
	and replace with
	       <element name="messages" nillable="true" maxOccurs="unbounded"  type="tns2:Message"/>
	
	and also remove 
	   <complexType name="ArrayOf_tns2_Message">
	    <sequence>
	     <element maxOccurs="unbounded" minOccurs="0" name="item" type="tns2:Message"/>
	    </sequence>
	   </complexType>
	
	... but that should not affect interop at all, only the server-side (Java) programming model.
 
	Had already tried that to see if it would make any difference but it didn't... (as you said)
 The wsdl is auto generated. 
	 
	you wrote:
	> The main difference I can see between your service and mine is that there are type mappings
for the getX and getXResponse elements, do you know why this is?
	 
	I don't understand this.  I don't have type mappings for the getX and getXResponse in the
deploy.wsdd that is generated for the ComplexTypes web service example.  And, if I run WSDL2Java
on your inquiry.wsdl, I again do not get type mappings for getX and getXResponse in the deploy.wsdd.
  I do get type mappings for all the complex types (Code, Message, etc).   Maybe you could
explain what you mean in more detail?  Which one has type mappings, and which does not?  and
where do you find these type mappings? 
	
	If you look in the deploy.wsdd that I attached with the last mail you should see a typeMapping
for getCustomerResonse (X = Customer). Are you saying you don't get these typeMappings when
you run WSDL2Java on my inquiry.wsdl?  Any idea why that is? 
	 
	<typeMapping

	xmlns:ns="http://inquiry.webservice.gpb.rbc.com"

	qname="ns:>getCustomerResponse"

	type="java:com.rbc.gpb.webservice.inquiry.GetCustomerResponse"

	serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"

	deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"

	encodingStyle=""

	/>

	 
	I'll have more time to look at this later. . . 
	Thanks - I am ready to give up and stick to my rpc/encoded service :)
	 

	 

____________________________________________________________
This e-mail may be privileged and/or confidential, and the sender does not waive any related
rights and obligations. Any distribution, use or copying of this e-mail or the information
it contains by other than an intended recipient is unauthorized. If you received this e-mail
in error, please advise me (by return e-mail or otherwise) immediately. 

Ce courrier électronique est confidentiel et protégé. L'expéditeur ne renonce pas aux
droits et obligations qui s'y rapportent. Toute diffusion, utilisation ou copie de ce message
ou des renseignements qu'il contient par une personne autre que le (les) destinataire(s) désigné(s)
est interdite. Si vous recevez ce courrier électronique par erreur, veuillez m'en aviser
immédiatement, par retour de courrier électronique ou par un autre moyen.

============================================================


Mime
View raw message