Hey all,

I have a C# .NET web service and a Java client using Apache SOAP. I keep
getting this problem, and I am pretty sure it’s a silly error of mine,
but I can’t seem to find whats wrong with the namespace.

Generated fault: [Attributes={}] [faultCode=soap:Client]
[faultString=Server was
 unable to read request. --> Invalid namespace declaration. Line 4,
position 26.
] [faultActorURI=null] [DetailEntries=
] [FaultEntries=]

Here is the WSDL description:
<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/";
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
xmlns:s="http://www.w3.org/2001/XMLSchema";
xmlns:s0="http://localhost/SMTP_Client/literalTypes";
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:tns="http://localhost/SMTP_Client";
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/";
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/";
targetNamespace="http://localhost/SMTP_Client";
xmlns="http://schemas.xmlsoap.org/wsdl/";>
- <types>
- <s:schema elementFormDefault="qualified"
targetNamespace="http://localhost/SMTP_Client/literalTypes";>
  <s:element name="string" nillable="true" type="s:string" /> 
  </s:schema>
  </types>
- <message name="sendEmailSoapIn">
  <part name="to" type="s:string" /> 
  </message>
- <message name="sendEmailSoapOut">
  <part name="sendEmailResult" type="s:string" /> 
  </message>
- <message name="sendEmailHttpGetIn">
  <part name="to" type="s:string" /> 
  </message>
- <message name="sendEmailHttpGetOut">
  <part name="Body" element="s0:string" /> 
  </message>
- <message name="sendEmailHttpPostIn">
  <part name="to" type="s:string" /> 
  </message>
- <message name="sendEmailHttpPostOut">
  <part name="Body" element="s0:string" /> 
  </message>
- <portType name="Service1Soap">
- <operation name="sendEmail">
  <input message="tns:sendEmailSoapIn" /> 
  <output message="tns:sendEmailSoapOut" /> 
  </operation>
  </portType>
- <portType name="Service1HttpGet">
- <operation name="sendEmail">
  <input message="tns:sendEmailHttpGetIn" /> 
  <output message="tns:sendEmailHttpGetOut" /> 
  </operation>
- <portType name="Service1HttpPost">
- <operation name="sendEmail">
  <input message="tns:sendEmailHttpPostIn" /> 
  <output message="tns:sendEmailHttpPostOut" /> 
  </operation>
- <binding name="Service1Soap" type="tns:Service1Soap">
  <soap:binding transport="http://schemas.xmlsoap.org/soap/http";
style="rpc" /> 
- <operation name="sendEmail">
  <soap:operation soapAction="http://localhost/SMTP_Client/sendEmail";
style="rpc" /> 
- <input>
  <soap:body use="encoded" namespace="http://localhost/SMTP_Client";
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; /> 
  </input>
- <output>
  <soap:body use="encoded" namespace="http://localhost/SMTP_Client";
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; /> 
  </output>
  </operation>
- <binding name="Service1HttpGet" type="tns:Service1HttpGet">
  <http:binding verb="GET" /> 
- <operation name="sendEmail">
  <http:operation location="/sendEmail" /> 
- <input>
  <http:urlEncoded /> 
  </input>
- <output>
  <mime:mimeXml part="Body" /> 
  </output>
  </operation>
- <binding name="Service1HttpPost" type="tns:Service1HttpPost">
  <http:binding verb="POST" /> 
- <operation name="sendEmail">
  <http:operation location="/sendEmail" /> 
- <input>
  <mime:content type="application/x-www-form-urlencoded" /> 
  </input>
- <output>
  <mime:mimeXml part="Body" /> 
  </output>
  </operation>
- <service name="Service1">
- <port name="Service1Soap" binding="tns:Service1Soap">
  <soap:address location="http://localhost/SMTP_Client/SMTP_Client.asmx";
/> 
  </port>
- <port name="Service1HttpGet" binding="tns:Service1HttpGet">
  <http:address location="http://localhost/SMTP_Client/SMTP_Client.asmx";
/> 
  </port>
- <port name="Service1HttpPost" binding="tns:Service1HttpPost">
  <http:address location="http://localhost/SMTP_Client/SMTP_Client.asmx";
/> 
  </port>
  </service>
  </definitions>


In my Java code,

The url  = http://localhost/SMTP_Client/SMTP_Client.asmx
methodName = "sendEmail"
and the SOAPAction = http://localhost/SMTP_Client/sendEmail

Please help me out here...

Thanx in advance!

Serafina

--
To unsubscribe, e-mail:   <mailto:soap-user-unsubscribe@;xml.apache.org>
For additional commands, e-mail: <mailto:soap-user-help@;xml.apache.org>

Reply via email to