• Post Reply Bookmark Topic Watch Topic
  • New Topic

Invoking Webservice having Complex Types  RSS feed

 
Karthik Rajendiran
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends,

I was required to invoke a web service from a java client program. I am using Web logic 8.1. I am provided with the WSDL File.
I have already generated client files using ant tasks in web logic for earlier projects (Different WSDLs)
Usually I used to create one input bean ,set values and send it as argument to the method exposed in WS
And retrieve the output in output bean.

But In this New wsdl, I have nested complex types for input. When I generated the client classes, I could see the method has argument as
Javax.xml.SoapElement. I don�t know how to send my input to the service method.

But in my older WService, while generating client files, I have proper bean specified
getEmployeeDetail(EmployeeInput)
i.e getEmployeeDetail is the method exposed
input is one bean.
Remote interface was generated in this manner for existing one.

Old WSDL EmployeeDetl.wsdl, is working fine and I have client class with remote interface mentioning the correct type as input
The Remote interface has properly mentioned with InputBean name

But in New WSDL
public abstract ExceptionService_Responseinfo bAMProcessExceptionService(javax.xml.soap.SOAPElement soapelement)
throws RemoteException;
}

How to invoke with soapelement.
I am now pasting the WSDL new one.Kindly help me out



--------------------------------------------WSDL code snippet with Types and Input Message part


<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ES="http://ndc-ah-prd.am.mot.com:10753/MC87_DeviceUnlock_BAM_ControlServices/Docs" targetNamespace="http://ndc-ah-prd.am.mot.com:10753/MC87_DeviceUnlock_BAM_ControlServices/Docs">
<xsd:element name="ProcessInstanceId">
<xsd:complexType>
<xsd:sequence>
<xsd:element type="xsd:string" name="attribute" nillable="true"></xsd:element>
<xsd:element type="xsd:string" name="value" nillable="true"></xsd:element>
<xsd:any processContents="lax"></xsd:any>
</xsd:sequence>
<xsd:anyAttribute processContents="lax">
</xsd:anyAttribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="LogFields">
<xsd:complexType>
<xsd:sequence>
<xsd:element type="xsd:string" name="attribute" minOccurs="0" nillable="true"></xsd:element>
<xsd:element type="xsd:string" name="value" minOccurs="0" nillable="true"></xsd:element>
<xsd:any processContents="lax"></xsd:any>
</xsd:sequence>
<xsd:anyAttribute processContents="lax"></xsd:anyAttribute>
</xsd:complexType>
</xsd:element><xsd:element name="Attributes">
<xsd:complexType>
<xsd:sequence>
<xsd:element type="xsd:string" name="attribute" minOccurs="0" nillable="true"></xsd:element>
<xsd:element type="xsd:string" name="value" minOccurs="0" nillable="true"></xsd:element>
<xsd:any processContents="lax"></xsd:any>
</xsd:sequence>
<xsd:anyAttribute processContents="lax"></xsd:anyAttribute>
</xsd:complexType></xsd:element>
<xsd:element name="ExceptionService_Requestinfo">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="ES rocessInstanceId" maxOccurs="unbounded"></xsd:element>
<xsd:element ref="ES:LogFields" maxOccurs="unbounded"></xsd:element>
<xsd:element ref="ES:Attributes" maxOccurs="unbounded"></xsd:element>
<xsd:element type="xsd:string" name="Operation" minOccurs="0"></xsd:element>
<xsd:element type="xsd:string" name="StepName" minOccurs="0"></xsd:element>
<xsd:element type="xsd:string" name="ProcessName" minOccurs="0"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="ExceptionService_Responseinfo">
<xsd:complexType>
<xsd:sequence>
<xsd:element type="xsd:string" name="ResponseMesage" minOccurs="0" nillable="true"></xsd:element>
<xsd:element type="xsd:string" name="Code" minOccurs="0"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

<xsd:schema xmlns:tns="http://localhost/MC87_DeviceUnlock_BAM_ControlServices/ControlServices/Common/BAMProcessExceptionService" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ES="http://ndc-ah-prd.am.mot.com:10753/MC87_DeviceUnlock_BAM_ControlServices/Docs" targetNamespace="http://localhost/MC87_DeviceUnlock_BAM_ControlServices/ControlServices/Common/BAMProcessExceptionService"><xsd:import namespace="http://ndc-ah-prd.am.mot.com:10753/MC87_DeviceUnlock_BAM_ControlServices/Docs"></xsd:import>

<xsd:complexType name="ExceptionService_Request"><xsd:sequence><xsd:element minOccurs="0" ref="ES:ExceptionService_Requestinfo"></xsd:element><xsd:any processContents="lax"></xsd:any></xsd:sequence><xsd:anyAttribute processContents="lax"></xsd:anyAttribute></xsd:complexType><xsd:complexType name="ExceptionService_Response"><xsd:sequence><xsd:element minOccurs="0" ref="ES:ExceptionService_Responseinfo"></xsd:element><xsd:any processContents="lax"></xsd:any></xsd:sequence><xsd:anyAttribute processContents="lax"></xsd:anyAttribute></xsd:complexType></xsd:schema></wsdl:types>


<wsdl:message name="BAMProcessExceptionService">
<wsdl art name="ExceptionService_Requestinfo" element="wsdns1:ExceptionService_Requestinfo">
</wsdl art></wsdl:message>
 
Chris Nappin
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javax.xml.SoapElement is used by Web Services development tools when the XML Schema types in the WSDL is too complex for it to handle. If at all possible, I suggest you move to a newer version of WebLogic (e.g. 9.2) or even better still move to Java EE 5 and JAX-WS which has full support for all XML Schema types. Then your method signature should use JavaBeans, which is much simpler than manipulating XML.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!