Hello,

I'm hoping someone can help with this bug I'm getting.  I'm connecting
to a SOAP object that was built on a Microsoft Platform. It's a
straightforward connection with one String parameter passed in.  The
problem is that when I pass in the parameter, I get the following error:
'Value cannot be null. Parameter name: s'

I have no idea where that came from, and have hit a wall in my
troubleshooting attempts.  Does anyone know why this might happen?

The XML I am sending is:

<?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:AcceptXMLOrderString
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:ns1="http://www.portlandwinecellar.com";>
   <strXML xsi:type="xsd:string">hiya</strXML>
  </ns1:AcceptXMLOrderString>
 </soapenv:Body>
</soapenv:Envelope>

The XML it is expecting is:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
  <soap:Body>
    <AcceptXMLOrderString xmlns="http://portlandwinecellar.com/";>
      <strXML>string</strXML>
    </AcceptXMLOrderString>
  </soap:Body>
</soap:Envelope>

I don't see what the issue is here, but for some reason this is
failing!  Here is my code:

String url = "http://127.0.0.1:8080";;   // debugging via TCPmon

URL urlObj = new URL(url);

Vector values = new Vector();

values.add("hiya");    

try {

  Service  service = new Service();

  Call  call = (Call) service.createCall();
         
  call.setTargetEndpointAddress(urlObj);

  call.setOperationName(new QName("http://www.portlandwinecellar.com";,
        "AcceptXMLOrderString"));
 
call.setSOAPActionURI("http://portlandwinecellar.com/AcceptXMLOrderString";);

  call.setUseSOAPAction(true);
                        
  call.addParameter("strXML", org.apache.axis.Constants.XSD_STRING,
javax.xml.rpc.ParameterMode.IN);*/
                        
  call.setReturnType(org.apache.axis.Constants.XSD_STRING); 

  String ret = (String) call.invoke( values.toArray() );
          
  System.out.println("Sent 'Hello!', got '" + ret + "'");

} catch (Exception e) {

  System.err.println(e.toString());

}

Does anyone know why this might not work?  Could there be a problem with
the Service itself?

Thanks in advance!

Kevin Williams

Reply via email to