You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@ws.apache.org by Indrasish N Basuroychowdhury <in...@fanniemae.com> on 2002/07/12 17:55:10 UTC
Need urgent help. Please help.
Could Scott or any other expert please help?
I am trying to send and receive object to a .NET service via. Java client.
I am receiving following error message:
Fault Code = soap:Client
Fault String = System.Web.Services.Protocols.SoapException: Server was unable to
read request. ---> System.Exception: There is an error in XML document (5, 2).
---> System.Exception: The specified type was not recognized:
name='ReturnService', namespace='http://localhost/FirstTry/WebServices/', at <ah
xmlns=''>.
at
System.Xml.Serialization.XmlSerializationReader.ReadTypedPrimitive(XmlQualifiedName
type)
at
System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement(String
name, String ns, Boolean throwOnUnknownType, Boolean ignoreIfNoId, String&
fixupReference)
at
System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement(String
name, String ns, String& fixupReference)
at
n2499d7d93ffa468fbd8861780677ee41.XmlSerializationReader1.Read4_ReturnService()
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader)
at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
at System.Web.Services.Protocols.WebServiceHandler.Invoke()
at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
Here is the protocol of .NET service.
SOAP
The following is a sample SOAP request and response. The placeholders shown need
to be replaced with actual values.
POST /FirstTry/WebServices/Objects/TestObjSer.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://localhost/FirstTry/WebServices/ReturnService"
<?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:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://localhost/FirstTry/WebServices/"
xmlns:types="http://localhost/FirstTry/WebServices/encodedTypes"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:ReturnService>
<ah href="#id1" />
</tns:ReturnService>
<types:AuthHeader id="id1" xsi:type="types:AuthHeader">
<Username xsi:type="xsd:string">string</Username>
<Password xsi:type="xsd:string">string</Password>
</types:AuthHeader>
</soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?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:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://localhost/FirstTry/WebServices/"
xmlns:types="http://localhost/FirstTry/WebServices/encodedTypes"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:ReturnServiceResponse>
<ReturnServiceResult href="#id1" />
</tns:ReturnServiceResponse>
<types:ReturnObj id="id1" xsi:type="types:ReturnObj">
<Username xsi:type="xsd:string">string</Username>
<Password xsi:type="xsd:string">string</Password>
<Together xsi:type="xsd:string">string</Together>
</types:ReturnObj>
</soap:Body>
</soap:Envelope>
And here is my code:
import org.apache.soap.encoding.*;
import org.apache.soap.encoding.soapenc.*;
import org.apache.soap.util.xml.*;
import org.apache.soap.rpc.*;
import org.apache.soap.*;
import java.util.*;
import java.net.*;
class AuthHeader {
public String Username;
public String Password;
}
class ReturnObj {
public String Username;
public String Password;
public String Together;
}
public class ClientNetObj {
static String XMLSOAP = "http://schemas.xmlsoap.org/soap/encoding/";
static String __targetNS = "http://localhost/FirstTry/WebServices/";
static String __methNsURI = __targetNS;
static String __baseURL =
"http://localhost/FirstTry/WebServices/Objects/TestObjSer.asmx";
static String __soapAction =
"http://localhost/FirstTry/WebServices/ReturnService";
static String __methodName = "ReturnService";
public static void main(String args[]) throws Exception
{
Call call = new Call();
SOAPMappingRegistry smr = new SOAPMappingRegistry();
BeanSerializer beanSer = new BeanSerializer();
smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName(__targetNS,
"ReturnService"),
AuthHeader.class, beanSer, beanSer);
// smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName(__targetNS,
"ReturnServiceResult"),
ReturnObj.class, beanSer, beanSer);
call.setSOAPMappingRegistry(smr);
call.setEncodingStyleURI(XMLSOAP);
call.setTargetObjectURI(__methNsURI);
call.setMethodName(__methodName);
Vector params = new Vector();
// params.addElement(new Parameter("strInput", String.class, "Test",
null));
AuthHeader ah = new AuthHeader();
ah.Username = "Indrasish";
ah.Password = "Genius";
params.addElement(new Parameter("ah", AuthHeader.class, ah, null));
call.setParams(params);
URL url = new URL(__baseURL);
Response res = call.invoke(url, __soapAction);
if (res.generatedFault())
{
Fault f = res.getFault();
System.out.println("Fault Code = " + f.getFaultCode());
System.out.println("Fault String = " + f.getFaultString());
}
else
{
Parameter p = res.getReturnValue();
System.out.println(" Object Value = " + p.getValue());
}
}
I need urgent help.
Any help is appreciated.
Thanks,
Indrasish.
Re: Need urgent help. Please help.
Posted by Scott Nichol <sn...@scottnichol.com>.
I suggest you post your client code and/or a wire dump in order to get help.
Scott Nichol
----- Original Message -----
From: "Indrasish N Basuroychowdhury"
<in...@fanniemae.com>
To: <so...@xml.apache.org>
Sent: Friday, July 12, 2002 11:55 AM
Subject: Need urgent help. Please help.
> Could Scott or any other expert please help?
>
> I am trying to send and receive object to a .NET service via. Java client.
>
> I am receiving following error message:
> Fault Code = soap:Client
> Fault String = System.Web.Services.Protocols.SoapException: Server was
unable to
> read request. ---> System.Exception: There is an error in XML document (5,
2).
> ---> System.Exception: The specified type was not recognized:
> name='ReturnService', namespace='http://localhost/FirstTry/WebServices/',
at <ah
> xmlns=''>.
> at
>
System.Xml.Serialization.XmlSerializationReader.ReadTypedPrimitive(XmlQualif
iedName
> type)
> at
>
System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement(Strin
g
> name, String ns, Boolean throwOnUnknownType, Boolean ignoreIfNoId, String&
> fixupReference)
> at
>
System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement(Strin
g
> name, String ns, String& fixupReference)
> at
>
n2499d7d93ffa468fbd8861780677ee41.XmlSerializationReader1.Read4_ReturnServic
e()
> at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader
xmlReader)
> at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
> at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
> at System.Web.Services.Protocols.WebServiceHandler.Invoke()
> at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
>
> Here is the protocol of .NET service.
>
> SOAP
> The following is a sample SOAP request and response. The placeholders
shown need
> to be replaced with actual values.
>
> POST /FirstTry/WebServices/Objects/TestObjSer.asmx HTTP/1.1
> Host: localhost
> Content-Type: text/xml; charset=utf-8
> Content-Length: length
> SOAPAction: "http://localhost/FirstTry/WebServices/ReturnService"
>
> <?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:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:tns="http://localhost/FirstTry/WebServices/"
> xmlns:types="http://localhost/FirstTry/WebServices/encodedTypes"
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> <soap:Body
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
> <tns:ReturnService>
> <ah href="#id1" />
> </tns:ReturnService>
> <types:AuthHeader id="id1" xsi:type="types:AuthHeader">
> <Username xsi:type="xsd:string">string</Username>
> <Password xsi:type="xsd:string">string</Password>
> </types:AuthHeader>
> </soap:Body>
> </soap:Envelope>
> HTTP/1.1 200 OK
> Content-Type: text/xml; charset=utf-8
> Content-Length: length
>
> <?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:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:tns="http://localhost/FirstTry/WebServices/"
> xmlns:types="http://localhost/FirstTry/WebServices/encodedTypes"
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> <soap:Body
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
> <tns:ReturnServiceResponse>
> <ReturnServiceResult href="#id1" />
> </tns:ReturnServiceResponse>
> <types:ReturnObj id="id1" xsi:type="types:ReturnObj">
> <Username xsi:type="xsd:string">string</Username>
> <Password xsi:type="xsd:string">string</Password>
> <Together xsi:type="xsd:string">string</Together>
> </types:ReturnObj>
> </soap:Body>
> </soap:Envelope>
>
>
> And here is my code:
> import org.apache.soap.encoding.*;
> import org.apache.soap.encoding.soapenc.*;
> import org.apache.soap.util.xml.*;
> import org.apache.soap.rpc.*;
> import org.apache.soap.*;
> import java.util.*;
> import java.net.*;
>
> class AuthHeader {
> public String Username;
> public String Password;
> }
>
> class ReturnObj {
> public String Username;
> public String Password;
> public String Together;
> }
>
> public class ClientNetObj {
>
> static String XMLSOAP = "http://schemas.xmlsoap.org/soap/encoding/";
> static String __targetNS = "http://localhost/FirstTry/WebServices/";
> static String __methNsURI = __targetNS;
> static String __baseURL =
> "http://localhost/FirstTry/WebServices/Objects/TestObjSer.asmx";
> static String __soapAction =
> "http://localhost/FirstTry/WebServices/ReturnService";
> static String __methodName = "ReturnService";
>
> public static void main(String args[]) throws Exception
> {
> Call call = new Call();
> SOAPMappingRegistry smr = new SOAPMappingRegistry();
> BeanSerializer beanSer = new BeanSerializer();
> smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName(__targetNS,
> "ReturnService"),
>
> AuthHeader.class, beanSer, beanSer);
> // smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName(__targetNS,
> "ReturnServiceResult"),
>
> ReturnObj.class, beanSer, beanSer);
>
> call.setSOAPMappingRegistry(smr);
> call.setEncodingStyleURI(XMLSOAP);
> call.setTargetObjectURI(__methNsURI);
> call.setMethodName(__methodName);
>
> Vector params = new Vector();
> // params.addElement(new Parameter("strInput", String.class, "Test",
> null));
> AuthHeader ah = new AuthHeader();
> ah.Username = "Indrasish";
> ah.Password = "Genius";
> params.addElement(new Parameter("ah", AuthHeader.class, ah, null));
> call.setParams(params);
>
> URL url = new URL(__baseURL);
> Response res = call.invoke(url, __soapAction);
> if (res.generatedFault())
> {
> Fault f = res.getFault();
> System.out.println("Fault Code = " + f.getFaultCode());
> System.out.println("Fault String = " + f.getFaultString());
> }
> else
> {
> Parameter p = res.getReturnValue();
> System.out.println(" Object Value = " + p.getValue());
> }
> }
>
>
> I need urgent help.
>
> Any help is appreciated.
>
> Thanks,
>
> Indrasish.
>
>
>
>
>
> --
> To unsubscribe, e-mail: <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>
Re: Need urgent help. Please help.
Posted by Scott Nichol <sn...@scottnichol.com>.
I suggest you post your client code and/or a wire dump in order to get help.
Scott Nichol
----- Original Message -----
From: "Indrasish N Basuroychowdhury"
<in...@fanniemae.com>
To: <so...@xml.apache.org>
Sent: Friday, July 12, 2002 11:55 AM
Subject: Need urgent help. Please help.
> Could Scott or any other expert please help?
>
> I am trying to send and receive object to a .NET service via. Java client.
>
> I am receiving following error message:
> Fault Code = soap:Client
> Fault String = System.Web.Services.Protocols.SoapException: Server was
unable to
> read request. ---> System.Exception: There is an error in XML document (5,
2).
> ---> System.Exception: The specified type was not recognized:
> name='ReturnService', namespace='http://localhost/FirstTry/WebServices/',
at <ah
> xmlns=''>.
> at
>
System.Xml.Serialization.XmlSerializationReader.ReadTypedPrimitive(XmlQualif
iedName
> type)
> at
>
System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement(Strin
g
> name, String ns, Boolean throwOnUnknownType, Boolean ignoreIfNoId, String&
> fixupReference)
> at
>
System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement(Strin
g
> name, String ns, String& fixupReference)
> at
>
n2499d7d93ffa468fbd8861780677ee41.XmlSerializationReader1.Read4_ReturnServic
e()
> at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader
xmlReader)
> at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
> at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
> at System.Web.Services.Protocols.WebServiceHandler.Invoke()
> at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
>
> Here is the protocol of .NET service.
>
> SOAP
> The following is a sample SOAP request and response. The placeholders
shown need
> to be replaced with actual values.
>
> POST /FirstTry/WebServices/Objects/TestObjSer.asmx HTTP/1.1
> Host: localhost
> Content-Type: text/xml; charset=utf-8
> Content-Length: length
> SOAPAction: "http://localhost/FirstTry/WebServices/ReturnService"
>
> <?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:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:tns="http://localhost/FirstTry/WebServices/"
> xmlns:types="http://localhost/FirstTry/WebServices/encodedTypes"
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> <soap:Body
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
> <tns:ReturnService>
> <ah href="#id1" />
> </tns:ReturnService>
> <types:AuthHeader id="id1" xsi:type="types:AuthHeader">
> <Username xsi:type="xsd:string">string</Username>
> <Password xsi:type="xsd:string">string</Password>
> </types:AuthHeader>
> </soap:Body>
> </soap:Envelope>
> HTTP/1.1 200 OK
> Content-Type: text/xml; charset=utf-8
> Content-Length: length
>
> <?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:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:tns="http://localhost/FirstTry/WebServices/"
> xmlns:types="http://localhost/FirstTry/WebServices/encodedTypes"
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> <soap:Body
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
> <tns:ReturnServiceResponse>
> <ReturnServiceResult href="#id1" />
> </tns:ReturnServiceResponse>
> <types:ReturnObj id="id1" xsi:type="types:ReturnObj">
> <Username xsi:type="xsd:string">string</Username>
> <Password xsi:type="xsd:string">string</Password>
> <Together xsi:type="xsd:string">string</Together>
> </types:ReturnObj>
> </soap:Body>
> </soap:Envelope>
>
>
> And here is my code:
> import org.apache.soap.encoding.*;
> import org.apache.soap.encoding.soapenc.*;
> import org.apache.soap.util.xml.*;
> import org.apache.soap.rpc.*;
> import org.apache.soap.*;
> import java.util.*;
> import java.net.*;
>
> class AuthHeader {
> public String Username;
> public String Password;
> }
>
> class ReturnObj {
> public String Username;
> public String Password;
> public String Together;
> }
>
> public class ClientNetObj {
>
> static String XMLSOAP = "http://schemas.xmlsoap.org/soap/encoding/";
> static String __targetNS = "http://localhost/FirstTry/WebServices/";
> static String __methNsURI = __targetNS;
> static String __baseURL =
> "http://localhost/FirstTry/WebServices/Objects/TestObjSer.asmx";
> static String __soapAction =
> "http://localhost/FirstTry/WebServices/ReturnService";
> static String __methodName = "ReturnService";
>
> public static void main(String args[]) throws Exception
> {
> Call call = new Call();
> SOAPMappingRegistry smr = new SOAPMappingRegistry();
> BeanSerializer beanSer = new BeanSerializer();
> smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName(__targetNS,
> "ReturnService"),
>
> AuthHeader.class, beanSer, beanSer);
> // smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName(__targetNS,
> "ReturnServiceResult"),
>
> ReturnObj.class, beanSer, beanSer);
>
> call.setSOAPMappingRegistry(smr);
> call.setEncodingStyleURI(XMLSOAP);
> call.setTargetObjectURI(__methNsURI);
> call.setMethodName(__methodName);
>
> Vector params = new Vector();
> // params.addElement(new Parameter("strInput", String.class, "Test",
> null));
> AuthHeader ah = new AuthHeader();
> ah.Username = "Indrasish";
> ah.Password = "Genius";
> params.addElement(new Parameter("ah", AuthHeader.class, ah, null));
> call.setParams(params);
>
> URL url = new URL(__baseURL);
> Response res = call.invoke(url, __soapAction);
> if (res.generatedFault())
> {
> Fault f = res.getFault();
> System.out.println("Fault Code = " + f.getFaultCode());
> System.out.println("Fault String = " + f.getFaultString());
> }
> else
> {
> Parameter p = res.getReturnValue();
> System.out.println(" Object Value = " + p.getValue());
> }
> }
>
>
> I need urgent help.
>
> Any help is appreciated.
>
> Thanks,
>
> Indrasish.
>
>
>
>
>
> --
> To unsubscribe, e-mail: <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>