Thanks for help from my last problem with the TcpTunnelGui, Gregg, Eduardo, and Sri.
Now, the new problem:
I can't get a valid response from a MS soap server.
I know this is a big request but could somebody check my code for what I need to add.
Thanks
Jody
Here is the request from the Apache client:
POST /TestSOAP/TestSOAP.wsdl HTTP/1.0
Host: CorePortal10
Content-Type: text/xml; charset=utf-8
Content-Length: 450
SOAPAction: "http://tempuri.org/action/SOAPService.SubmitJob"
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<ns1:SubmitJob xmlns:ns1="TestSOAP" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<JobTicket xsi:type="xsd:string">1234</JobTicket>
</ns1:SubmitJob>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Here is the response from the MS server:
HTTP/1.1 500 Internal Server ErrorServer: Microsoft-IIS/5.0Date: Fri, 27 Jul 2001 15:10:50 GMTContent-Type: text/xml; charset="UTF-8"Content-Length: 1109Expires: -1;
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>WSDLReader: None of the matching operations for soapAction http://tempuri.org/action/SOAPService.SubmitJob could successfully load the incoming request. Potential typemapper problem</faultstring>
<detail><mserror:errorInfo xmlns:mserror="http://schemas.microsoft.com/soap-toolkit/faultdetail/error/">
<mserror:returnCode>-2147024809</mserror:returnCode>
<mserror:callStack><mserror:callElement><mserror:component>WSDLReader</mserror:component><mserror:description>None of the matching operations for soapAction http://tempuri.org/action/SOAPService.SubmitJob could successfully load the incoming request. Potential typemapper problem</mserror:description><mserror:returnCode>-2147024809</mserror:returnCode>
</mserror:callElement></mserror:callStack></mserror:errorInfo></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
Here is a section of the java code:
URL url=new URL("http://bbrandin-ap550/TestSOAP/TestSOAP.wsdl"); // Address of SOAP router
try
{
Call call=new Call();
call.setSOAPMappingRegistry(new SOAPMappingRegistry());
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
// Question: What do I put for the setTargetObjectURI when I am trying to access an MS Soap Server machine?
call.setTargetObjectURI("TestSOAP");
call.setMethodName("SubmitJob");
Vector params=new Vector();
String szJobTicket = "1234";
params.addElement(new Parameter("JobTicket",String.class,szJobTicket,null));
call.setParams(params);
Response resp=call.invoke(url,"http://tempuri.org/action/SOAPService.SubmitJob");
boolean status=resp.generatedFault();
if (status == true)
{
// got a problem
Fault theFault = resp.getFault();
m_szDebug += " generatedFault(): ";
m_szDebug += theFault.getFaultString();
}
else
{
Parameter ret=resp.getReturnValue();
m_szDebug += ret.toString();
}
}
catch (RuntimeException r)
{
m_szDebug += " - RuntimeException: " + r;
}
}
Here is the MS wsdl file:
<?xml version="1.0" encoding="UTF-8" ?>
- <!-- Generated 05/10/01 by Microsoft SOAP Toolkit WSDL File Generator, Version 1.00.623.1 -->
- <definitions name="TestSOAP" targetNamespace="http://tempuri.org/wsdl/" xmlns:wsdlns="http://tempuri.org/wsdl/" xmlns:typens="http://tempuri.org/type" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:stk="http://schemas.microsoft.com/soap-toolkit/wsdl-extension" xmlns="http://schemas.xmlsoap.org/wsdl/">
- <types>
<schema targetNamespace="http://tempuri.org/type" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" elementFormDefault="qualified" />
</types>
+ <message name="SOAPService.SubmitJob">
<part name="JobTicket" type="xsd:string" />
</message>
- <message name="SOAPService.SubmitJobResponse">
<part name="Result" type="xsd:string" />
</message>
- <portType name="SOAPServiceSoapPort">
- <operation name="SubmitJob" parameterOrder="JobTicket">
<input message="wsdlns:SOAPService.SubmitJob" />
<output message="wsdlns:SOAPService.SubmitJobResponse" />
</operation>
</portType>
- <binding name="SOAPServiceSoapBinding" type="wsdlns:SOAPServiceSoapPort">
<stk:binding preferredEncoding="UTF-8" />
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
- <operation name="SubmitJob">
<soap:operation soapAction="http://tempuri.org/action/SOAPService.SubmitJob" />
- <input>
<soap:body use="encoded" namespace="http://tempuri.org/message/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</input>
- <output>
<soap:body use="encoded" namespace="http://tempuri.org/message/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</output>
</operation>
</binding>
- <service name="TestSOAP">
+ <port name="SOAPServiceSoapPort" binding="wsdlns:SOAPServiceSoapBinding">
<soap:address location="http://bbrandin-ap550/TestSOAP/TestSOAP.WSDL" />
</port>
</service>
</definitions>