You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Michael Wang <mi...@s1.com> on 2002/04/23 04:24:32 UTC

Interop with state between Axis and MS Soap

I could not find my message in the mail list, so I post it again.
Hopefully, someone knows the interop issue better.

I doubt whether axis can interop MS Soap with state by using soap header or
any other form.

Here is my last post.

What I am doing is to try to communicate MSSoap service by using AXIS
client.

Scenario 1. Success.
I create a new ms soap service by using Visual Basic.  It is stateless
service.
And I created several clients by using VBScript, Apache soap and Axis soap. 
For axis client, I generated java files first by using WSDL2Java utility.
They are working fine.

Scenario 2. Fail.
I would like it to be state.  
I simple use the MS soap sample code under MSSOAP\Samples\State directory of
MS soap toolkit.

Also, I create VBScript's client, it works fine.
Since Apache soap does not support header, so I try to use Axis soap.
I generated java code by using WSDL2Java.

Here is the client code I use:

import java.util.*;
public class Tester { 
  public static void main(String [] args) throws Exception { 
    String retVal;
    // Make a service 
    System.out.println("Start Tester");

    //1. Make a service 
    org.tempuri.State service = new org.tempuri.StateLocator(); 

    //2. Now use the service to get a stub which implements the SDI. 
    org.tempuri.StateSoapPort port = service.getStateSoapPort(); 
    ((org.tempuri.StateSoapBindingStub) port).setMaintainSession (true);

    //3. Make the actual call
    boolean retVal1;
    retVal1 = port.login("state", "myPassword");

    //4. Next statefull call.
    retVal = port.doSomething("don't care");
    System.out.println("after DoSomething::retVal="+retVal);

    System.out.println("End Tester");
  } 
}

Here is runtime error I got:

Start Tester
Exception in thread "main" Cannot save an uninitialized class.  You must use
the
 global InitProperties method to initialize the class, or load the class
from a
PropertyBag before trying to save it.
        at org.apache.axis.message.SOAPFaultBuilder.endElement(Unknown
Source)
        at
org.apache.axis.encoding.DeserializationContextImpl.endElement(Unknow
n Source)
        at
org.apache.xerces.parsers.SAXParser.endElement(SAXParser.java:1403)
        at
org.apache.xerces.validators.common.XMLValidator.callEndElement(XMLVa
lidator.java:1480)
        at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.disp
atch(XMLDocumentScanner.java:1204)
        at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentS
canner.java:381)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1081)
        at javax.xml.parsers.SAXParser.parse(SAXParser.java:374)
        at org.apache.axis.encoding.DeserializationContextImpl.parse(Unknown
Sou
rce)
        at org.apache.axis.SOAPPart.getAsSOAPEnvelope(Unknown Source)
        at org.apache.axis.client.Call.invoke(Unknown Source)
        at org.apache.axis.client.Call.invoke(Unknown Source)
        at org.apache.axis.client.Call.invoke(Unknown Source)
        at org.apache.axis.client.Call.invoke(Unknown Source)
        at
org.tempuri.StateSoapBindingStub.login(StateSoapBindingStub.java:103)
	   at Tester.main(Tester.java:22)