Loading ...
Sorry, an error occurred while loading the content.

SOAP::Lite Client with Axis

Expand Messages
  • William McCracken
    Hello, I am using SOAP::Lite as a client connecting to an Axis server. I am having trouble sending a proper message. I have read through the messages on this
    Message 1 of 1 , Jun 5, 2002
    • 0 Attachment
      Hello,

      I am using SOAP::Lite as a client connecting to an Axis server. I am having
      trouble sending a proper message. I have read through the messages on this
      group, but have not found my answer (#1490 was close).

      I ran my .wsdl through axis' wsdl2java utility and them added in my logic.
      The important parts of the deploy.wsdd file look like:

      <service name="SOAP2JMS_Serviceport" provider="java:RPC" style="document">
      <parameter name="className"
      value="net.usi.usisphere.bridge.SOAP2JMSBindingSkeleton"/>
      <parameter name="allowedMethods" value="*"/>

      <typeMapping
      xmlns:ns="http://bridge.usisphere.usi.net/SOAP2JMSService"
      qname="ns:sendResults"
      type="java:net.usi.usisphere.bridge.SendResults"
      serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
      deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
      encodingStyle=""
      />
      <typeMapping
      xmlns:ns="http://bridge.usisphere.usi.net/SOAP2JMSService"
      qname="ns:header"
      type="java:net.usi.usisphere.bridge.Header"
      serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
      deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
      encodingStyle=""
      />
      <typeMapping
      xmlns:ns="http://bridge.usisphere.usi.net/SOAP2JMSService"
      qname="ns:transaction_result"
      type="java:net.usi.usisphere.bridge.TransactionResult"
      serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
      deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
      encodingStyle=""
      />
      <typeMapping
      xmlns:ns="http://bridge.usisphere.usi.net/SOAP2JMSService"
      qname="ns:sendResponse"
      type="java:net.usi.usisphere.bridge.SendResponse"
      serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
      deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
      encodingStyle=""
      />
      </service>


      here is the wsdl schema:

      <types>
      <schema targetNamespace="http://bridge.usisphere.usi.net/SOAP2JMSService"
      xmlns="http://www.w3.org/2001/XMLSchema"
      xmlns:xsl="http://bridge.usisphere.usi.net/SOAP2JMSService"
      elementForm="qualified" attributeForm="unqualified">
      <complexType name="sendResults">
      <sequence>
      <element name="header">
      <complexType>
      <sequence>
      <element name="collection_id" type="string"/>
      <element name="timestamp" type="string"/>
      <element name="server_id" type="string"/>
      <element name="profile_id" type="string"/>
      <element name="meas_agnt_id" type="string"/>
      <element name="collection_status" type="string"/>
      </sequence>
      </complexType>
      </element>
      <element name="transaction_result" maxOccurs="unbounded">
      <complexType>
      <sequence>
      <element name="trans_id" type="string"/>
      <element name="action" type="string"/>
      <element name="result" type="double"/>
      </sequence>
      </complexType>
      </element>
      </sequence>
      </complexType>
      <complexType name="sendResponse">
      <sequence>
      <element name="response" type="string"/>
      </sequence>
      </complexType>
      </schema>
      </types>


      In SOAP::Lite, this works:

      my $header = SOAP::Data->name('header' => \SOAP::Data->value(
      SOAP::Data->name('collection_id' => 'collect123'),
      SOAP::Data->name('timestamp' => 'c1234567'),
      SOAP::Data->name('server_id' => 'msuawa5d'),
      SOAP::Data->name('profile_id' => '14-56789'),
      SOAP::Data->name('meas_agnt_id' => 'mstawa0v'),
      SOAP::Data->name('collection_status' => 'OK'),
      ),
      );

      my $service =
      SOAP::Lite->service('http://oasislab.emc.usi.net:8080/axis/services/SOAP2JMS_Serviceport?wsdl');

      $res = $service->sendResults($header);

      changing $header to this does not:

      my $header = SOAP::Data->name('header' => \SOAP::Data->value(
      SOAP::Data->name('collection_id' => 'collect123'),
      SOAP::Data->name('timestamp' => 'c1234567'),
      SOAP::Data->name('server_id' => 'msuawa5d'),
      SOAP::Data->name('profile_id' => '14-56789'),
      SOAP::Data->name('meas_agnt_id' => 'mstawa0v'),
      SOAP::Data->name('collection_status' => 'OK'),
      ),
      SOAP::Data->name('transaction_result' => \SOAP::Data->value(
      SOAP::Data->name('trans_id' => 'ic546.65'),
      SOAP::Data->name('action' => 'exchSndMsg'),
      SOAP::Data->name('result' => '45.67')->type('double'),
      )),
      SOAP::Data->name('transaction_result' => \SOAP::Data->value(
      SOAP::Data->name('trans_id' => 'ic546.65'),
      SOAP::Data->name('action' => 'exchLogon'),
      SOAP::Data->name('result' => '45.67')->type('double'),
      )),
      );


      I get similar results with :

      my $h1 = bless {
      'collection_id' => 'collect123',
      'timestamp' => 'c1234567',
      'server_id' => 'msuawa5d',
      'profile_id' => '14-56789',
      'meas_agnt_id' => 'mstawa0v',
      'collection_status' => 'OK',
      } => 'header';

      my $d1 = bless {
      'trans_id' => 'aasdf',
      'action' => 'zzl',
      'result' => 56.78,
      } => 'transaction_result';
      my $d2 = bless {
      'trans_id' => 'aasdf',
      'action' => 'zzl',
      'result' => 56.78,
      } => 'transaction_result';

      $res = $service->sendResults($h1, $d1, $d2);

      where:

      $res = $service->sendResults($h1);
      or
      $res = $service->sendResults($d1);

      work, but

      $res = $service->sendResults($h1, $d1);

      does not.


      I get an org.xml.sax.SAXException: No such operation 'sendResults'
      when it fails and an expected message in the SOAP response on success.

      Sorry for the long message. Any ideas???

      Thanks,

      Will




      _________________________________________________________________
      Send and receive Hotmail on your mobile device: http://mobile.msn.com
    Your message has been successfully submitted and would be delivered to recipients shortly.