Hey Peer, thanks for you response. I followed the steps in the FAQ & also gone thru the discussion linked in the FAQ.
This the portion of the "mscrm.wsdl" relavent to our discussion.
I am providing the request & response from the tcpmon here.
Still I am getting the same exception.
Here is the class WhoAmIResponse in the discussion.
When I tried to debug the code, the found that the "getDeserializer" method for this class is not getting called instead the same method of the super class "Response" is getting called. [ February 29, 2008: Message edited by: Harry Kirsten ]
Based on my own experience (and others), I recommend that you have a basic set of fundamental types that you can compose to other types (structures, records) and sequences (arrays). Be careful with enumerations (an anachronism from the time when each byte did count - use strings instead), inheritance and polymorphism (even when XML supports it).
Joined: Jun 06, 2006
Hi peer, you are right. when i was debugging the code, i figured out that Axis has problem dealing with polymorphisms/inheritance.
I am really sorry about not giving the more portion about the WSDL, but the whole WSDL is very large and I cannot post it here.
Also I am not sure whatever you guessed is completely correct or not, if you are ok with it then i can send you the whole WSDL.
I cannot give the whole stub code here, but what i have understood is that, axis created the typeMappingRegistry for every request and response.
The mapping is done between superclass - subclass in the map it was maintained with classType - QName for our example it should be (Response - WhoAmIResponse)
When it is making the request this mapping is properly build (Request - WhoAmIRequest) and thus the apporpriate Serialiser & DeSerialiser gets called.
But when at the time of processing the response this mapping is not available. i.e the Map between classType - QName is empty, so axis is unable to determine which DeSerialiser to call, hence end up calling the DeSerialiser for the class Response.
I am still searching for the solution for this, if you can provide any input it will be great help.
Thanks for your help...really appreciate it.
Best Regards Harry [ February 29, 2008: Message edited by: Harry Kirsten ]
Joined: Jun 06, 2006
Hi Peer, I also tried using Axis2 and JAX-WS. But there i faced another problem. This WSDL is not just plain document/literal format but, .Net style - document/literal wrapped format, where you can found multiple part elements under message element, which is not the case in plain document/literal fomrat.
So when i tried to wsimport[JAX-WS] and WSDL2JAVA[Apache Axis2] i got the error = more than one part element fount for message element...
Joined: Aug 19, 2005
Document/literal wrapped is a convention that was created to transfer more than one document per envelope. In a lot of cases it is used because people can't leave their RPC thinking behind in the document-oriented world (the type of document implies the operation - no operation name/method required). "Document/literal wrapped" basically allocates one request document type and one response document type per in-out host "RPC" method.
As far as I'm aware WS-I Basic Profile still only allows a single part per message in document/literal - regardless of whether it is bare or wrapped. Having more than one part breaches the interoperability protocol. The whole idea of document/literal is that the payload is a single document. If you need to ship more then one you have to use a holder document - a wrapper.
Joined: Jun 06, 2006
Hi Peer, Thanks for your response. But, a even though going thru a lot of search & several articals, i am not able to find any solution for the problem. Please check you PM i am sending the WSDL.
Can you please provide me some solution, or is there any alternative approch for the same. Integration between MS-CRM webservice & Java. I am really stuck with this.
Joined: Aug 19, 2005
This is the message that is causing the problems.
There may be a bug somewhere that caused this to "leak through" because this is the only message the breaks the interoperability protocol. So the originators of the WSDL may need to be notified about this problem - and maybe they will take action to fix it.
In the meantime - I'm not sure how critical the Retrieve operation is to what you are trying to do (the name doesn't bode well - however maybe you'll be able to use the "RetrieveMultiple" method instead to retrieve a single instance in a collection) - you should be able to make some modifications to a copy of the WSDL to see if you can get the rest to work under Axis2/JAX-WS (Axis 1.x is a lost cause I'm afraid).
delete the RetrieveSoapIn and RetrieveSoapOut message
in the portType section delete the Retrieve operation
in the binding section delete the Retrieve Operation
Now try to generate a stub from modified WSDL.
If you need access of the Retrieve method and a fix to the method isn't forth coming (fast enough) then you'll need to hand code the generation of the SOAP RetrieveSoapIn requests and the parsing of the RetrieveSoapOut responses on a separate client stub. In Axis2 this amounts to using org.apache.axis2.client.Call and building requests /parsing responses with org.apache.axis2.soap.SOAPEnvelope. Web services are supposed to have a stateless design - if yours does not then you will also need to code the SOAP interaction of the methods that are required to "build the state" required before you can call the Retrieve method. So basically
You have to identify the "Retrieve" interactions necessary for your client. You need to be specific enough so that you can code up representative scenarios in a tracer bullet/spike/vertical slice.
Use .NETs WSDL.exe to create a stub and code a minimal console app (in C# (or J#)) to exercise the representative scenarios. Capture the SOAP request/response pairs with tcpmon as your baseline input/output requirements for your Java based stub.
Now code up the scenarios one by one with your chosen Java API. As you go, refactor the interactions to a more generalized stub to be used by your client application.