Hi All,
I am a newbie to webservices and i am using axis 1.4 and tomcat5.5
and jdk5 for writing my webservices.
I have written one webservice which is called searchservice which
does a search service depending on some id and i have generated the wsdl
for these service and generated the necessary classes using WSDL2Java
tools.
I am also sending the list of files generated by the tool and the
wsdl file.
I wrote one client which is calling this service and does the
operation but while calling these i am getting following error.
[java] AxisFault
[java] faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
[java] faultSubcode:
[java] faultString: org.xml.sax.SAXParseException: The root element
is required in a well-formed document.
[java] faultActor:
[java] faultNode:
[java] faultDetail:
[java]
{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException:
The root element is required in a well-formed document.
[java] at
org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1213)
[java] at
org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XMLDocumentScanner.java:570)
[java] at org.apache.xerces.framework.XMLDocumentScanner
$XMLDeclDispatcher.endOfInput(XMLDocumentScanner.java:790)
[java] at
org.apache.xerces.framework.XMLDocumentScanner.endOfInput(XMLDocumentScanner.java:418)
[java] at
org.apache.xerces.validators.common.XMLValidator.sendEndOfInputNotifications(XMLValidator.java:712)
[java] at
org.apache.xerces.readers.DefaultEntityHandler.changeReaders(DefaultEntityHandler.java:1031)
[java] at
org.apache.xerces.readers.XMLEntityReader.changeReaders(XMLEntityReader.java:168)
[java] at
org.apache.xerces.readers.AbstractCharReader.changeReaders(AbstractCharReader.java:150)
[java] at
org.apache.xerces.readers.AbstractCharReader.lookingAtChar(AbstractCharReader.java:217)
[java] at org.apache.xerces.framework.XMLDocumentScanner
$XMLDeclDispatcher.dispatch(XMLDocumentScanner.java:686)
[java] at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
[java] at
org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
[java] at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
[java] at
org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
[java] at
org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
[java] at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
[java] at
org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
[java] at
org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
[java] at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
[java] at org.apache.axis.client.Call.invoke(Call.java:2767)
[java] at org.apache.axis.client.Call.invoke(Call.java:2443)
[java] at org.apache.axis.client.Call.invoke(Call.java:2366)
[java] at org.apache.axis.client.Call.invoke(Call.java:1812)
[java] at
soapapi.SearchServiceSoapBindingStub.searchDeviceById(SearchServiceSoapBindingStub.java:155)
[java] at
com.trilliant.client.SearchServiceClient.main(SearchServiceClient.java:18)
[java] {http://xml.apache.org/axis/}hostname:shrabank
[java] org.xml.sax.SAXParseException: The root element is required
in a well-formed document.
[java] at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
[java] at
org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:701)
[java] at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
[java] at
org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
[java] at
org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
[java] at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
[java] at org.apache.axis.client.Call.invoke(Call.java:2767)
[java] at org.apache.axis.client.Call.invoke(Call.java:2443)
[java] at org.apache.axis.client.Call.invoke(Call.java:2366)
[java] at org.apache.axis.client.Call.invoke(Call.java:1812)
[java] at
soapapi.SearchServiceSoapBindingStub.searchDeviceById(SearchServiceSoapBindingStub.java:155)
[java] at
com.trilliant.client.SearchServiceClient.main(SearchServiceClient.java:18)
[java] Caused by: org.xml.sax.SAXParseException: The root element
is required in a well-formed document.
[java] at
org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1213)
[java] at
org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XMLDocumentScanner.java:570)
[java] at org.apache.xerces.framework.XMLDocumentScanner
$XMLDeclDispatcher.endOfInput(XMLDocumentScanner.java:790)
[java] at
org.apache.xerces.framework.XMLDocumentScanner.endOfInput(XMLDocumentScanner.java:418)
[java] at
org.apache.xerces.validators.common.XMLValidator.sendEndOfInputNotifications(XMLValidator.java:712)
[java] at
org.apache.xerces.readers.DefaultEntityHandler.changeReaders(DefaultEntityHandler.java:1031)
[java] at
org.apache.xerces.readers.XMLEntityReader.changeReaders(XMLEntityReader.java:168)
[java] at
org.apache.xerces.readers.AbstractCharReader.changeReaders(AbstractCharReader.java:150)
[java] at
org.apache.xerces.readers.AbstractCharReader.lookingAtChar(AbstractCharReader.java:217)
[java] at org.apache.xerces.framework.XMLDocumentScanner
$XMLDeclDispatcher.dispatch(XMLDocumentScanner.java:686)
[java] at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
[java] at
org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
[java] at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
[java] at
org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
[java] at
org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
[java] ... 10 more
Help from anybody is very much appreciated.
Waiting for the response.
Tahnks in advance.
This e-mail and any files transmitted with it are for the sole use of the
intended recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient or received it in error, please contact
the sender by reply e-mail and destroy all copies of the original message.
Please do not copy it for any purpose or disclose its contents.
Copyright Tarang Software Technologies Pvt. Ltd. 2004. All rights Reserved/**
* Device.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package soapapi;
public class Device implements java.io.Serializable {
private java.lang.String accountId;
private java.lang.String amr_device_number;
private java.lang.String amr_service_provider_id;
private java.lang.String deviceId;
private java.lang.String locationId;
private java.lang.String meshgateId;
public Device() {
}
public Device(
java.lang.String accountId,
java.lang.String amr_device_number,
java.lang.String amr_service_provider_id,
java.lang.String deviceId,
java.lang.String locationId,
java.lang.String meshgateId) {
this.accountId = accountId;
this.amr_device_number = amr_device_number;
this.amr_service_provider_id = amr_service_provider_id;
this.deviceId = deviceId;
this.locationId = locationId;
this.meshgateId = meshgateId;
}
/**
* Gets the accountId value for this Device.
*
* @return accountId
*/
public java.lang.String getAccountId() {
return accountId;
}
/**
* Sets the accountId value for this Device.
*
* @param accountId
*/
public void setAccountId(java.lang.String accountId) {
this.accountId = accountId;
}
/**
* Gets the amr_device_number value for this Device.
*
* @return amr_device_number
*/
public java.lang.String getAmr_device_number() {
return amr_device_number;
}
/**
* Sets the amr_device_number value for this Device.
*
* @param amr_device_number
*/
public void setAmr_device_number(java.lang.String amr_device_number) {
this.amr_device_number = amr_device_number;
}
/**
* Gets the amr_service_provider_id value for this Device.
*
* @return amr_service_provider_id
*/
public java.lang.String getAmr_service_provider_id() {
return amr_service_provider_id;
}
/**
* Sets the amr_service_provider_id value for this Device.
*
* @param amr_service_provider_id
*/
public void setAmr_service_provider_id(java.lang.String amr_service_provider_id) {
this.amr_service_provider_id = amr_service_provider_id;
}
/**
* Gets the deviceId value for this Device.
*
* @return deviceId
*/
public java.lang.String getDeviceId() {
return deviceId;
}
/**
* Sets the deviceId value for this Device.
*
* @param deviceId
*/
public void setDeviceId(java.lang.String deviceId) {
this.deviceId = deviceId;
}
/**
* Gets the locationId value for this Device.
*
* @return locationId
*/
public java.lang.String getLocationId() {
return locationId;
}
/**
* Sets the locationId value for this Device.
*
* @param locationId
*/
public void setLocationId(java.lang.String locationId) {
this.locationId = locationId;
}
/**
* Gets the meshgateId value for this Device.
*
* @return meshgateId
*/
public java.lang.String getMeshgateId() {
return meshgateId;
}
/**
* Sets the meshgateId value for this Device.
*
* @param meshgateId
*/
public void setMeshgateId(java.lang.String meshgateId) {
this.meshgateId = meshgateId;
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof Device)) return false;
Device other = (Device) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = true &&
((this.accountId==null && other.getAccountId()==null) ||
(this.accountId!=null &&
this.accountId.equals(other.getAccountId()))) &&
((this.amr_device_number==null && other.getAmr_device_number()==null) ||
(this.amr_device_number!=null &&
this.amr_device_number.equals(other.getAmr_device_number()))) &&
((this.amr_service_provider_id==null && other.getAmr_service_provider_id()==null) ||
(this.amr_service_provider_id!=null &&
this.amr_service_provider_id.equals(other.getAmr_service_provider_id()))) &&
((this.deviceId==null && other.getDeviceId()==null) ||
(this.deviceId!=null &&
this.deviceId.equals(other.getDeviceId()))) &&
((this.locationId==null && other.getLocationId()==null) ||
(this.locationId!=null &&
this.locationId.equals(other.getLocationId()))) &&
((this.meshgateId==null && other.getMeshgateId()==null) ||
(this.meshgateId!=null &&
this.meshgateId.equals(other.getMeshgateId())));
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = 1;
if (getAccountId() != null) {
_hashCode += getAccountId().hashCode();
}
if (getAmr_device_number() != null) {
_hashCode += getAmr_device_number().hashCode();
}
if (getAmr_service_provider_id() != null) {
_hashCode += getAmr_service_provider_id().hashCode();
}
if (getDeviceId() != null) {
_hashCode += getDeviceId().hashCode();
}
if (getLocationId() != null) {
_hashCode += getLocationId().hashCode();
}
if (getMeshgateId() != null) {
_hashCode += getMeshgateId().hashCode();
}
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(Device.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("http://model.trilliant.com", "Device"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("accountId");
elemField.setXmlName(new javax.xml.namespace.QName("", "accountId"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setNillable(true);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("amr_device_number");
elemField.setXmlName(new javax.xml.namespace.QName("", "amr_device_number"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setNillable(true);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("amr_service_provider_id");
elemField.setXmlName(new javax.xml.namespace.QName("", "amr_service_provider_id"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setNillable(true);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("deviceId");
elemField.setXmlName(new javax.xml.namespace.QName("", "deviceId"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setNillable(true);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("locationId");
elemField.setXmlName(new javax.xml.namespace.QName("", "locationId"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setNillable(true);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("meshgateId");
elemField.setXmlName(new javax.xml.namespace.QName("", "meshgateId"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "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);
}
}
/**
* SearchServiceService.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package soapapi;
public interface SearchServiceService extends javax.xml.rpc.Service {
public java.lang.String getSearchServiceAddress();
public soapapi.SearchService_PortType getSearchService() throws javax.xml.rpc.ServiceException;
public soapapi.SearchService_PortType getSearchService(java.net.URL portAddress) throws javax.xml.rpc.ServiceException;
}
/**
* SearchServiceServiceLocator.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package soapapi;
public class SearchServiceServiceLocator extends org.apache.axis.client.Service implements soapapi.SearchServiceService {
public SearchServiceServiceLocator() {
}
public SearchServiceServiceLocator(org.apache.axis.EngineConfiguration config) {
super(config);
}
public SearchServiceServiceLocator(java.lang.String wsdlLoc, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException {
super(wsdlLoc, sName);
}
// Use to get a proxy class for SearchService
private java.lang.String SearchService_address = "http://localhost:8080/SampleWebservice/SearchService.jws";
public java.lang.String getSearchServiceAddress() {
return SearchService_address;
}
// The WSDD service name defaults to the port name.
private java.lang.String SearchServiceWSDDServiceName = "SearchService";
public java.lang.String getSearchServiceWSDDServiceName() {
return SearchServiceWSDDServiceName;
}
public void setSearchServiceWSDDServiceName(java.lang.String name) {
SearchServiceWSDDServiceName = name;
}
public soapapi.SearchService_PortType getSearchService() throws javax.xml.rpc.ServiceException {
java.net.URL endpoint;
try {
endpoint = new java.net.URL(SearchService_address);
}
catch (java.net.MalformedURLException e) {
throw new javax.xml.rpc.ServiceException(e);
}
return getSearchService(endpoint);
}
public soapapi.SearchService_PortType getSearchService(java.net.URL portAddress) throws javax.xml.rpc.ServiceException {
try {
soapapi.SearchServiceSoapBindingStub _stub = new soapapi.SearchServiceSoapBindingStub(portAddress, this);
_stub.setPortName(getSearchServiceWSDDServiceName());
return _stub;
}
catch (org.apache.axis.AxisFault e) {
return null;
}
}
public void setSearchServiceEndpointAddress(java.lang.String address) {
SearchService_address = address;
}
/**
* For the given interface, get the stub implementation.
* If this service has no port for the given interface,
* then ServiceException is thrown.
*/
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
try {
if (soapapi.SearchService_PortType.class.isAssignableFrom(serviceEndpointInterface)) {
soapapi.SearchServiceSoapBindingStub _stub = new soapapi.SearchServiceSoapBindingStub(new java.net.URL(SearchService_address), this);
_stub.setPortName(getSearchServiceWSDDServiceName());
return _stub;
}
}
catch (java.lang.Throwable t) {
throw new javax.xml.rpc.ServiceException(t);
}
throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
}
/**
* For the given interface, get the stub implementation.
* If this service has no port for the given interface,
* then ServiceException is thrown.
*/
public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
if (portName == null) {
return getPort(serviceEndpointInterface);
}
java.lang.String inputPortName = portName.getLocalPart();
if ("SearchService".equals(inputPortName)) {
return getSearchService();
}
else {
java.rmi.Remote _stub = getPort(serviceEndpointInterface);
((org.apache.axis.client.Stub) _stub).setPortName(portName);
return _stub;
}
}
public javax.xml.namespace.QName getServiceName() {
return new javax.xml.namespace.QName("http://localhost:8080/SampleWebservice/SearchService.jws", "SearchServiceService");
}
private java.util.HashSet ports = null;
public java.util.Iterator getPorts() {
if (ports == null) {
ports = new java.util.HashSet();
ports.add(new javax.xml.namespace.QName("http://localhost:8080/SampleWebservice/SearchService.jws", "SearchService"));
}
return ports.iterator();
}
/**
* Set the endpoint address for the specified port name.
*/
public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {
if ("SearchService".equals(portName)) {
setSearchServiceEndpointAddress(address);
}
else
{ // Unknown Port Name
throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName);
}
}
/**
* Set the endpoint address for the specified port name.
*/
public void setEndpointAddress(javax.xml.namespace.QName portName, java.lang.String address) throws javax.xml.rpc.ServiceException {
setEndpointAddress(portName.getLocalPart(), address);
}
}
/**
* SearchServiceSoapBindingStub.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package soapapi;
public class SearchServiceSoapBindingStub extends org.apache.axis.client.Stub implements soapapi.SearchService_PortType {
private java.util.Vector cachedSerClasses = new java.util.Vector();
private java.util.Vector cachedSerQNames = new java.util.Vector();
private java.util.Vector cachedSerFactories = new java.util.Vector();
private java.util.Vector cachedDeserFactories = new java.util.Vector();
static org.apache.axis.description.OperationDesc [] _operations;
static {
_operations = new org.apache.axis.description.OperationDesc[1];
_initOperationDesc1();
}
private static void _initOperationDesc1(){
org.apache.axis.description.OperationDesc oper;
org.apache.axis.description.ParameterDesc param;
oper = new org.apache.axis.description.OperationDesc();
oper.setName("searchDeviceById");
param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("", "Id"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), java.lang.String.class, false, false);
oper.addParameter(param);
oper.setReturnType(new javax.xml.namespace.QName("http://model.trilliant.com", "Device"));
oper.setReturnClass(soapapi.Device.class);
oper.setReturnQName(new javax.xml.namespace.QName("", "searchDeviceByIdReturn"));
oper.setStyle(org.apache.axis.constants.Style.RPC);
oper.setUse(org.apache.axis.constants.Use.ENCODED);
_operations[0] = oper;
}
public SearchServiceSoapBindingStub() throws org.apache.axis.AxisFault {
this(null);
}
public SearchServiceSoapBindingStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
this(service);
super.cachedEndpoint = endpointURL;
}
public SearchServiceSoapBindingStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
if (service == null) {
super.service = new org.apache.axis.client.Service();
} else {
super.service = service;
}
((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2");
java.lang.Class cls;
javax.xml.namespace.QName qName;
javax.xml.namespace.QName qName2;
java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class;
java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class;
java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class;
java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class;
java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class;
java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class;
java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class;
java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;
java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class;
java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class;
qName = new javax.xml.namespace.QName("http://model.trilliant.com", "Device");
cachedSerQNames.add(qName);
cls = soapapi.Device.class;
cachedSerClasses.add(cls);
cachedSerFactories.add(beansf);
cachedDeserFactories.add(beandf);
}
protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException {
try {
org.apache.axis.client.Call _call = super._createCall();
if (super.maintainSessionSet) {
_call.setMaintainSession(super.maintainSession);
}
if (super.cachedUsername != null) {
_call.setUsername(super.cachedUsername);
}
if (super.cachedPassword != null) {
_call.setPassword(super.cachedPassword);
}
if (super.cachedEndpoint != null) {
_call.setTargetEndpointAddress(super.cachedEndpoint);
}
if (super.cachedTimeout != null) {
_call.setTimeout(super.cachedTimeout);
}
if (super.cachedPortName != null) {
_call.setPortName(super.cachedPortName);
}
java.util.Enumeration keys = super.cachedProperties.keys();
while (keys.hasMoreElements()) {
java.lang.String key = (java.lang.String) keys.nextElement();
_call.setProperty(key, super.cachedProperties.get(key));
}
// All the type mapping information is registered
// when the first call is made.
// The type mapping information is actually registered in
// the TypeMappingRegistry of the service, which
// is the reason why registration is only needed for the first call.
synchronized (this) {
if (firstCall()) {
// must set encoding style before registering serializers
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setEncodingStyle(org.apache.axis.Constants.URI_SOAP11_ENC);
for (int i = 0; i < cachedSerFactories.size(); ++i) {
java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i);
javax.xml.namespace.QName qName =
(javax.xml.namespace.QName) cachedSerQNames.get(i);
java.lang.Object x = cachedSerFactories.get(i);
if (x instanceof Class) {
java.lang.Class sf = (java.lang.Class)
cachedSerFactories.get(i);
java.lang.Class df = (java.lang.Class)
cachedDeserFactories.get(i);
_call.registerTypeMapping(cls, qName, sf, df, false);
}
else if (x instanceof javax.xml.rpc.encoding.SerializerFactory) {
org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory)
cachedSerFactories.get(i);
org.apache.axis.encoding.DeserializerFactory df = (org.apache.axis.encoding.DeserializerFactory)
cachedDeserFactories.get(i);
_call.registerTypeMapping(cls, qName, sf, df, false);
}
}
}
}
return _call;
}
catch (java.lang.Throwable _t) {
throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t);
}
}
public soapapi.Device searchDeviceById(java.lang.String id) throws java.rmi.RemoteException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[0]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("http://DefaultNamespace", "searchDeviceById"));
setRequestHeaders(_call);
setAttachments(_call);
try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {id});
if (_resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)_resp;
}
else {
extractAttachments(_call);
try {
return (soapapi.Device) _resp;
} catch (java.lang.Exception _exception) {
return (soapapi.Device) org.apache.axis.utils.JavaUtils.convert(_resp, soapapi.Device.class);
}
}
} catch (org.apache.axis.AxisFault axisFaultException) {
throw axisFaultException;
}
}
}
/**
* SearchService_PortType.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package soapapi;
public interface SearchService_PortType extends java.rmi.Remote {
public soapapi.Device searchDeviceById(java.lang.String id) throws java.rmi.RemoteException;
}
service.wsdl
Description: application/xml
package com.trilliant.client;
import java.rmi.RemoteException;
import javax.xml.rpc.ServiceException;
import soapapi.Device;
import soapapi.SearchServiceService;
import soapapi.SearchServiceServiceLocator;
import soapapi.SearchService_PortType;
public class SearchServiceClient {
public static void main(String[] args) {
SearchServiceService service=new SearchServiceServiceLocator();
try {
SearchService_PortType serv=service.getSearchService();
Device dev=serv.searchDeviceById("1");
System.out.println("The account id is"+dev.getDeviceId());
System.out.println("The location id is"+dev.getLocationId());
} catch (ServiceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
