Hi,

I have tied to deploy axis example5 with weblogic 7.0 but I am getting Deserializtion error

Error : org.xml.sax.SAXException: Deserializing parameter 'arg1': could not find deserializer for type {urn:BeanService}Order

Would you please help me to resolve this error ?

Thanks & Regards,
Shijo

Following are the files I have used


BeanService.jws package samples.userguide.example5;

public class BeanService
{
public String processOrder(Order order)
{
String sep = System.getProperty("line.separator");

String response = "Hi, " + order.getCustomerName() + "!" + sep;

response += sep + "You seem to have ordered the following:" + sep;

String [] items = order.getItemCodes();
int [] quantities = order.getQuantities();

for (int i = 0; i < items.length; i++) {
response += sep + quantities + " of item : " + items;
}

response += sep + sep +
"If this had been a real order processing system, "+
"we'd probably have charged you about now.";

return response;
}
}

Order.Java

package samples.userguide.example5;

/** This is a JavaBean which represents an order for some products.
*
* @author Glen Daniels ([EMAIL PROTECTED])
*/
public class Order
{
/** Who's ordering */
private String customerName;
/** Where do they live */
private String shippingAddress;
/** Which items do we want */
private String itemCodes[];
/** And how many */
private int quantities[];


// Bean accessors

public String getCustomerName()
{ return customerName; }
public void setCustomerName(String name)
{ customerName = name; }

public String getShippingAddress()
{ return shippingAddress; }
public void setShippingAddress(String address)
{ shippingAddress = address; }

public String [] getItemCodes()
{ return itemCodes; }
public void setItemCodes(String [] items)
{ itemCodes = items; }

public int [] getQuantities()
{ return quantities; }
public void setQuantities(int [] quants)
{ quantities = quants; }
}

Client.java
package samples.userguide.example5;

import org.apache.axis.AxisFault;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.utils.Options;

import javax.xml.namespace.QName;

import javax.xml.rpc.ParameterMode;

public class Client
{
public static void main(String [] args) throws Exception
{
Options options = new Options(args);

Order order = new Order();
order.setCustomerName("Glen Daniels");
order.setShippingAddress("275 Grove Street, Newton, MA");

String [] items = new String[] { "mp3jukebox", "1600mahBattery" };
int [] quantities = new int [] { 1, 4 };


order.setItemCodes(items);
order.setQuantities(quantities);

Service service = new Service();
Call call = (Call) service.createCall();
QName qn = new QName( "urn:BeanService", "Order" );

call.registerTypeMapping(Order.class, qn,
new org.apache.axis.encoding.ser.BeanSerializerFactory(Order.class, qn),
new org.apache.axis.encoding.ser.BeanDeserializerFactory(Order.class, qn));
String result;
try {
String endpoint = "http://localhost:"; + 7001 + "/axis/BeanService.jws";
call.setTargetEndpointAddress( new java.net.URL(endpoint));
call.setOperationName( new QName("OrderProcessor", "processOrder") );
call.addParameter( "arg1", qn, ParameterMode.IN );
call.setReturnType( org.apache.axis.encoding.XMLType.XSD_STRING );


result = (String) call.invoke( new Object[] { order } );
} catch (AxisFault fault) {
result = "Error : " + fault.toString();
}

System.out.println(result);
}
}

deploy.wsdd
<deployment xmlns="http://xml.apache.org/axis/wsdd/";
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java";>

<service name="OrderProcessor" provider="java:RPC">
<parameter name="className" value="samples.userguide.example5.BeanService"/>
<parameter name="allowedMethods" value="processOrder"/>


<beanMapping qname="myNS:Order" xmlns:myNS="urn:BeanService"
languageSpecificType="java:samples.userguide.example5.Order"/>
</service>

</deployment>

I have deployed it with below command

ýý java org.apache.axis.client.AdminClient ýVp7001 deploy.wsdd

There is no exception on the seblogic server at deployment time. Even TCP Tunnal/monitor gives no exception. And it gives the result as deployed. I can access this in the web browser with http://localhost:7001/axis/deploy.wsdd

TCP Tunnal/monitorýýs soap request & Response at the time of executing the client is given below

Request

POST /axis/BeanService.jws HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.1
Host: localhost:8000
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: ""
Content-Length: 1085


<?xml version="1.0" encoding="UTF-8"?>
<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>
<ns1:processOrder soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:ns1="OrderProcessor">
<arg1 href="#id0"/>
</ns1:processOrder>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; xsi:type="ns2:Order" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:ns2="urn:BeanService">
<customerName xsi:type="xsd:string">Glen Daniels</customerName>
<itemCodes xsi:type="soapenc:Array" soapenc:arrayType="xsd:string[2]">
<item>mp3jukebox</item>
<item>1600mahBattery</item>
</itemCodes>
<quantities xsi:type="soapenc:Array" soapenc:arrayType="xsd:int[2]">
<item>1</item>
<item>4</item>
</quantities>
<shippingAddress xsi:type="xsd:string">275 Grove Street, Newton, MA</shippingAddress>
</multiRef>
</soapenv:Body>
</soapenv:Envelope>



Response


HTTP/1.0 500 Internal Server Error
Date: Fri, 22 Aug 2003 13:47:08 GMT
Server: WebLogic WebLogic Server 7.0 SP2 Sun Jan 26 23:09:32 PST 2003 234192
Content-Type: text/xml; charset=utf-8
Set-Cookie: JSESSIONID=1Gec0OmvWV2LxQ2qMoDloRa1Jo3ZLSlraEBsnfXfBcg1z3DZHFvZ!889020784; path=/
Connection: Close <?xml version="1.0" encoding="UTF-8"?>
<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>
<soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>
<faultstring>org.xml.sax.SAXException: Deserializing parameter &apos;arg1&apos;: could not find deserializer for type {urn:BeanService}Order</faultstring>
<detail/>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>


___________________________________________________
Meet your old school or college friends from
1 Million + database...
Click here to reunite www.batchmates.com/rediff.asp




Reply via email to