for SOAPContext
     SOAPResponse

you have to SetContentType("text/xml");

I dont know how to do that with the Call Statements you have research use of
SOAPResponse to ensure you are getting the correct ContentType specified..

Keep me apprised,

Martin Gainty

______________________________________________

Disclaimer and confidentiality note

Everything in this e-mail and any attachments relating to the official business of Laconia Data Systems (LDS) is proprietary to the company. It is confidential, legally privileged and protected by law. LDS does not own and endorse any other content. Views and opinions are those of the sender unless clearly stated as being that of LDS.

The person addressed in the e-mail is the sole authorised recipient. Please notify the sender immediately if it has unintentionally reached you and do not read, disclose or use the content in any way.

LDS can not assure that the integrity of this communication has been maintained nor that it is free of errors, virus, interception or interference.

             _____________GMT-5___________________

 

>From: Siddhartha Mehta <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: Accessing C# Web service from Java Client...
>Date: Sat, 7 Dec 2002 12:20:30 -0800 (PST)
>MIME-Version: 1.0
>Received: from apache.org ([63.251.56.142]) by mc7-f30.law1.hotmail.com with Microsoft SMTPSVC(5.0.2195.5600); Sat, 7 Dec 2002 12:20:47 -0800
>Received: (qmail 59677 invoked by uid 500); 7 Dec 2002 20:20:25 -0000
>Received: (qmail 59666 invoked from network); 7 Dec 2002 20:20:25 -0000
>Received: from web14601.mail.yahoo.com (216.136.224.79) by daedalus.apache.org with SMTP; 7 Dec 2002 20:20:25 -0000
>Received: from [66.126.90.54] by web14601.mail.yahoo.com via HTTP; Sat, 07 Dec 2002 12:20:30 PST
>Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
>Precedence: bulk
>list-help:
>list-unsubscribe:
>list-post:
>Delivered-To: mailing list [EMAIL PROTECTED]
>Message-ID: <[EMAIL PROTECTED]>
>X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
>Return-Path: [EMAIL PROTECTED]
>X-OriginalArrivalTime: 07 Dec 2002 20:20:47.0033 (UTC) FILETIME=[2079C290:01C29E2E]
>
>
>Hi,
>
>I am using APACHE SOAP 2.2 for my Java client. I am trying to access the web services written in C#.NET. After compiling my code I get the following exception about content type:
>
>Caught SOAPException (SOAP-ENV:Protocol): Unsupported response content type "text/plain; charset=utf-8", must be: "text/xml". Response was:
>System.InvalidOperationException: Request format is invalid: text/xml; charset=utf-8.
> at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()
> at System.Web.Services.Protocols.WebServiceHandler.Invoke()
> at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
>
>
>
>I've also pasted below my code. I'm trying to access a Login function on my SOAP Web Server with 2 parameters, LoginName and Password (both values, "q").
>
>
>
>import java.io.*;
>
>import java.util.*;
>
>import java.net.*;
>
>import org.w3c.dom.*;
>
>import org.apache.soap.util.xml.*;
>
>import org.apache.soap.*;
>
>import org.apache.soap.encoding.*;
>
>import org.apache.soap.encoding.soapenc.*;
>
>import org.apache.soap.rpc.*;
>
>import org.apache.soap.transport.http.SOAPHTTPConnection;
>
>public class StoragePoint
>
>{
>
>public static void main(String[] args) throws Exception
>
>{
>
>
>
>URL url = "" URL ("http://localhost/soap/SoapUser.asmx/Login");
>
>
>
>SOAPMappingRegistry smr = new SOAPMappingRegistry ();
>
>StringDeserializer sd = new StringDeserializer ();
>
>smr.mapTypes (Constants.NS_URI_SOAP_ENC, new QName ("", "Result"), null, null, sd);
>
>// create the transport and set parameters
>
>SOAPHTTPConnection st = new SOAPHTTPConnection();
>
>// build the call.
>
>Call call = new Call ();
>
>call.setSOAPTransport(st);
>
>call.setSOAPMappingRegistry (smr);
>
>call.setTargetObjectURI ("http://tempuri.org/message/");
>
>call.setMethodName("Login");
>
>call.setEncodingStyleURI ("http://schemas.xmlsoap.org/soap/encoding/");
>
>Vector params = new Vector();
>
>params.addElement(new Parameter("LoginName", String.class, "q", null));
>
>params.addElement(new Parameter("Password", String.class, "q", null));
>
>call.setParams(params);
>
>Response resp = null;
>
>try
>
>{
>
>resp = call.invoke (url, "");
>
>}
>
>catch (SOAPException e)
>
>{
>
>System.err.println("Caught SOAPException (" + e.getFaultCode () + "): " + e.getMessage ());
>
>return;
>
>}
>
>// check response
>
>
>
>if (resp != null && !resp.generatedFault())
>
>{
>
>Parameter ret = resp.getReturnValue();
>
>Object value = ret.getValue();
>
>System.out.println ("Answer--> " + value);
>
>}
>
>else
>
>{
>
>Fault fault = resp.getFault ();
>
>System.err.println ("Generated fault: ");
>
>System.out.println (" Fault Code = " + fault.getFaultCode());
>
>System.out.println (" Fault String = " + fault.getFaultString());
>
>}
>
>}
>
>}
>
>
>
>Any help/suggestions is HIGHLY appreciated. I even used SUN's JAXP and I get the same error message.
>
>Thanks in ADVANCE!!
>
>Siddhartha
>
>
>
>---------------------------------
>Do you Yahoo!?
>Yahoo! Mail Plus - Powerful. Affordable. Sign up now


the new MSN 8 and get 2 months FREE* -- To unsubscribe, e-mail: For additional commands, e-mail:

Reply via email to