You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by fi...@utimaco.be on 2001/04/12 18:02:22 UTC

RE: Question: do you need to deploy when you SOAPMappingregisteri es(please HELP)(Thanks)

Thanks it is exactly what I needed. The tree I wanted is now being parsed
and sent to the server with the cgi.

Filip


                                                                                                                      
                    Jerry Feris                                                                                       
                    <jerry.feris@ibe        To:     soap-user@xml.apache.org                                          
                    rtech.com>              cc:                                                                       
                                            Subject:     RE: Question: do you need to deploy when you                 
                    12/04/2001 17:03        SOAPMappingregisteri es(please HELP)                                      
                    Please respond                                                                                    
                    to soap-user                                                                                      
                                                                                                                      
                                                                                                                      




Filip,

I searched your question for a simple mistake.  I found only what you did
not describe in the classes you expected to serialize.

I suspect that your classes that mirror samples.addressbook.Address and
samples.addressbook.PhoneNumber may not be suficiently complient JavaBeans.
Specifically, they are missing property accessor methods. For Example:

public class PhoneNumber
{
  private int    areaCode;
  private String exchange;
  private String number;

  public PhoneNumber()
  {
  }

  public PhoneNumber(int areaCode, String exchange, String number)
  {
    this.areaCode = areaCode;
    this.exchange = exchange;
    this.number   = number;
  }

  public void setAreaCode(int areaCode)
  {
    this.areaCode = areaCode;
  }

  public int getAreaCode()
  {
    return areaCode;
  }
  ...
  ...
  ...
}

In the above code fragment notice that the methods "getAreaCode" and
"setAreaCode" are accessors for the property "AreaCode" of type int.  If
your classes are missing methods that match this pattern, then the
BeanSerialiser will not emit any SOAP elements for any instance of that
class.

-----Original Message-----
From: filip.vanpraet@utimaco.be [mailto:filip.vanpraet@utimaco.be]
Sent: Thursday, April 12, 2001 8:42 AM
To: soap-user%xml.apache_.org@utimaco.be
Subject: Question: do you need to deploy when you
SOAPMappingregisteries(please HELP)


Hi there
I'm trying to use write a simple soap client that sends a soap envelope to
a cgi script on the server. Because of the complexity of the request I
tried to foolow the addressbook example by using a beanserializer to create
the element tree in the method element. I have to add that I didn't deply
any service. The result I get is an envelope with the papameter tags, but
the content which is from the serialized objects didn't show up.
Can anybody tell me what I did wrong?

Thanx

Filip


My Code:

//these are simple classes like address and phonenumber of the addressbook
example.
Header head = new Header("slfsdflksldflk");
MustRequest mrequest = new MustRequest("beb", "Nokia", "829338", "8OkePa",
"secret1", "SHA1_B64_16");

SOAPMappingRegistry smr = new SOAPMappingRegistry();
BeanSerializer beanSer = new BeanSerializer();

// Map the types.
smr.mapTypes(Constants.NS_URI_SOAP_ENC,
          new QName("urn:mUST", "mUST"),
          Header.class, beanSer, beanSer);
smr.mapTypes(Constants.NS_URI_SOAP_ENC,
          new QName("urn:mUST", "mUST"),
          MustRequest.class, beanSer, beanSer);

Call call = new Call();

call.setSOAPMappingRegistry(smr);
call.setTargetObjectURI("urn:mUST");
call.setMethodName("mUSTGetStrongPassword");
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);

Vector params = new Vector();
     params.addElement(new Parameter("mUSTHeader", Header.class, head,
null));
     params.addElement(new Parameter("mUSTRequest", MustRequest.class,
mrequest, null));

call.setParams(params);

// Invoke the call
Response resp;
.................


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org